main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0//true
  5. let momentTourBlackNewType = false
  6. !function() {
  7. "use strict";
  8. function t(t, i) {
  9. return typeof t === i
  10. }
  11. function i(t, i) {
  12. return t instanceof i
  13. }
  14. function n(t) {
  15. return t && t.nodeType
  16. }
  17. function e(t) {
  18. return n(t) ? t : i(t, g) ? t[0] : void 0
  19. }
  20. function o(t, i, n) {
  21. return g.each(t, function(t, e) {
  22. n = i.call(e, n, t, e)
  23. }),
  24. n
  25. }
  26. function r(t, i, n) {
  27. var e, o, r;
  28. if (t === i)
  29. return !0;
  30. if (!t || !i || t.constructor !== i.constructor)
  31. return !1;
  32. for (e = 0,
  33. o = n.length; o > e; e += 1) {
  34. if (r = n[e],
  35. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  36. return !1;
  37. if (t[r] !== i[r])
  38. return !1
  39. }
  40. return !0
  41. }
  42. function s(t, i, n, e) {
  43. this.left = E(t),
  44. this.top = E(i),
  45. this.width = E(n),
  46. this.height = E(e),
  47. this.right = this.left + this.width,
  48. this.bottom = this.top + this.height
  49. }
  50. function h(t, i, n, e) {
  51. this.visible = t || 0,
  52. this.viewport = i || 0,
  53. this.possible = n || 0,
  54. this.rects = e && T({}, e) || null
  55. }
  56. function l(t, i) {
  57. this.els = t,
  58. this.viewport = i
  59. }
  60. function c(t, i, n) {
  61. var e;
  62. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  63. e ? e[n] : 0
  64. }
  65. function u(t, i) {
  66. return t.val - i.val
  67. }
  68. function a(t, i) {
  69. return i.val - t.val
  70. }
  71. function f(t) {
  72. var i = s.ofContent(t, !0)
  73. , n = s.ofViewport(t, !0)
  74. , e = i.width - n.width
  75. , o = i.height - n.height;
  76. this.content = i,
  77. this.viewport = n,
  78. this.width = 0 >= e ? null : n.left / e,
  79. this.height = 0 >= o ? null : n.top / o,
  80. this.left = n.left,
  81. this.top = n.top,
  82. this.right = i.right - n.right,
  83. this.bottom = i.bottom - n.bottom
  84. }
  85. function p(t) {
  86. this.el = t || window
  87. }
  88. function d(t, i) {
  89. this.context = t,
  90. this.viewport = i,
  91. this.init()
  92. }
  93. function v(t, i, n, e) {
  94. this.context = new l(t,i),
  95. this.property = n,
  96. this.descending = e,
  97. this.init()
  98. }
  99. function w(t) {
  100. t && t !== window && t !== document ? (this.context = t,
  101. this.$autoTarget = g(t)) : this.context = window,
  102. this.init()
  103. }
  104. var g = jQuery
  105. , m = g(window)
  106. , b = g(document)
  107. , T = g.extend
  108. , y = g.isFunction
  109. , k = Math.max
  110. , V = Math.min
  111. , E = Math.round
  112. , x = function() {
  113. var t = {}
  114. , i = 1;
  115. return function(n) {
  116. return n ? (t[n] || (t[n] = i,
  117. i += 1),
  118. t[n]) : 0
  119. }
  120. }();
  121. T(s.prototype, {
  122. equals: function(t) {
  123. return r(this, t, ["left", "top", "width", "height"])
  124. },
  125. area: function() {
  126. return this.width * this.height
  127. },
  128. relativeTo: function(t) {
  129. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  130. },
  131. intersection: function(t) {
  132. if (!i(t, s))
  133. return null;
  134. var n = k(this.left, t.left)
  135. , e = V(this.right, t.right)
  136. , o = k(this.top, t.top)
  137. , r = V(this.bottom, t.bottom)
  138. , h = e - n
  139. , l = r - o;
  140. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  141. },
  142. envelope: function(t) {
  143. if (!i(t, s))
  144. return this;
  145. var n = V(this.left, t.left)
  146. , e = k(this.right, t.right)
  147. , o = V(this.top, t.top)
  148. , r = k(this.bottom, t.bottom)
  149. , h = e - n
  150. , l = r - o;
  151. return new s(n,o,h,l)
  152. }
  153. }),
  154. T(s, {
  155. ofContent: function(t, i) {
  156. 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())
  157. },
  158. ofViewport: function(t, i) {
  159. 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())
  160. },
  161. ofElement: function(t) {
  162. var i = g(t);
  163. if (!i.is(":visible"))
  164. return null;
  165. var n = i.offset();
  166. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  167. }
  168. }),
  169. T(h.prototype, {
  170. equals: function(t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t)
  172. },
  173. fracsEqual: function(t) {
  174. return r(this, t, ["visible", "viewport", "possible"])
  175. },
  176. rectsEqual: function(t) {
  177. return r(this.rects, t.rects, ["document", "element", "viewport"])
  178. }
  179. }),
  180. T(h, {
  181. of: function(t, i) {
  182. var e, o, r;
  183. return t = n(t) && s.ofElement(t) || t,
  184. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  185. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  186. r = V(t.width, i.width) * V(t.height, i.height),
  187. new h(o / t.area(),o / i.area(),o / r,{
  188. document: e,
  189. element: e.relativeTo(t),
  190. viewport: e.relativeTo(i)
  191. })) : new h
  192. }
  193. });
  194. var q = ["width", "height", "left", "right", "top", "bottom"]
  195. , S = ["possible", "visible", "viewport"];
  196. T(l.prototype, {
  197. sorted: function(t, i) {
  198. var n = this.viewport;
  199. return g.map(this.els, function(i) {
  200. return {
  201. el: i,
  202. val: c(i, n, t)
  203. }
  204. }).sort(i ? a : u)
  205. },
  206. best: function(t, i) {
  207. return this.els.length ? this.sorted(t, i)[0] : null
  208. }
  209. }),
  210. T(f.prototype, {
  211. equals: function(t) {
  212. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  213. }
  214. }),
  215. T(p.prototype, {
  216. equals: function(t) {
  217. return r(this, t, ["el"])
  218. },
  219. scrollState: function() {
  220. return new f(this.el)
  221. },
  222. scrollTo: function(t, i, n) {
  223. var e = g(this.el === window ? "html,body" : this.el);
  224. t = t || 0,
  225. i = i || 0,
  226. n = isNaN(n) ? 1e3 : n,
  227. e.stop(!0).animate({
  228. scrollLeft: t,
  229. scrollTop: i
  230. }, n)
  231. },
  232. scroll: function(t, i, n) {
  233. var e = this.el === window ? m : g(this.el);
  234. t = t || 0,
  235. i = i || 0,
  236. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  237. },
  238. scrollToRect: function(t, i, n, e) {
  239. i = i || 0,
  240. n = n || 0,
  241. this.scrollTo(t.left - i, t.top - n, e)
  242. },
  243. scrollToElement: function(t, i, n, e) {
  244. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  245. this.scrollToRect(o, i, n, e)
  246. }
  247. });
  248. var C = {
  249. init: function() {
  250. this.callbacks = g.Callbacks("memory unique"),
  251. this.currVal = null,
  252. this.prevVal = null,
  253. this.checkProxy = g.proxy(this.check, this),
  254. this.autoCheck()
  255. },
  256. bind: function(t) {
  257. this.callbacks.add(t)
  258. },
  259. unbind: function(t) {
  260. t ? this.callbacks.remove(t) : this.callbacks.empty()
  261. },
  262. trigger: function() {
  263. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  264. },
  265. check: function(t) {
  266. var i = this.updatedValue(t);
  267. return void 0 !== i && (this.prevVal = this.currVal,
  268. this.currVal = i,
  269. this.trigger(),
  270. !0)
  271. },
  272. $autoTarget: m,
  273. autoEvents: "load resize scroll",
  274. autoCheck: function(t) {
  275. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  276. }
  277. };
  278. T(d.prototype, C, {
  279. updatedValue: function() {
  280. var t = h.of(this.context, this.viewport);
  281. return this.currVal && this.currVal.equals(t) ? void 0 : t
  282. }
  283. }),
  284. T(v.prototype, C, {
  285. updatedValue: function() {
  286. var t = this.context.best(this.property, this.descending);
  287. return t && (t = t.val > 0 ? t.el : null,
  288. this.currVal !== t) ? t : void 0
  289. }
  290. }),
  291. T(w.prototype, C, {
  292. updatedValue: function() {
  293. var t = new f(this.context);
  294. return this.currVal && this.currVal.equals(t) ? void 0 : t
  295. }
  296. });
  297. var L = function(t, i) {
  298. var n = [].slice
  299. , e = jQuery
  300. , o = e.extend
  301. , r = e.isFunction
  302. , s = o({}, i)
  303. , h = function(i, n, o, s) {
  304. return o = r(o) ? o.apply(i, n) : o,
  305. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  306. }
  307. , l = function() {
  308. return h(this, n.call(arguments), s.defaultStatic, l)
  309. }
  310. , c = function(t) {
  311. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  312. }
  313. , u = function(t) {
  314. t && (o(l, t.statics),
  315. o(c, t.methods)),
  316. l.modplug = u
  317. };
  318. u.prev = {
  319. statics: e[t],
  320. methods: e.fn[t]
  321. },
  322. u(i),
  323. e[t] = l,
  324. e.fn[t] = c
  325. }
  326. , M = "fracs";
  327. L(M, {
  328. statics: {
  329. version: "0.15.0",
  330. Rect: s,
  331. Fractions: h,
  332. Group: l,
  333. ScrollState: f,
  334. Viewport: p,
  335. FracsCallbacks: d,
  336. GroupCallbacks: v,
  337. ScrollStateCallbacks: w,
  338. fracs: function(t, i) {
  339. return h.of(t, i)
  340. }
  341. },
  342. methods: {
  343. content: function(t) {
  344. return this.length ? s.ofContent(this[0], t) : null
  345. },
  346. envelope: function() {
  347. return o(this, function(t) {
  348. var i = s.ofElement(this);
  349. return t ? t.envelope(i) : i
  350. })
  351. },
  352. fracs: function(i, n, o) {
  353. t(i, "string") || (o = n,
  354. n = i,
  355. i = null),
  356. y(n) || (o = n,
  357. n = null),
  358. o = e(o);
  359. var r = M + ".fracs." + x(o);
  360. return "unbind" === i ? this.each(function() {
  361. var t = g(this).data(r);
  362. t && t.unbind(n)
  363. }) : "check" === i ? this.each(function() {
  364. var t = g(this).data(r);
  365. t && t.check()
  366. }) : y(n) ? this.each(function() {
  367. var t = g(this)
  368. , i = t.data(r);
  369. i || (i = new d(this,o),
  370. t.data(r, i)),
  371. i.bind(n)
  372. }) : this.length ? h.of(this[0], o) : null
  373. },
  374. intersection: function() {
  375. return o(this, function(t) {
  376. var i = s.ofElement(this);
  377. return t ? t.intersection(i) : i
  378. })
  379. },
  380. max: function(t, i, n) {
  381. return y(i) || (n = i,
  382. i = null),
  383. n = e(n),
  384. i ? (new v(this,n,t,!0).bind(i),
  385. this) : this.pushStack(new l(this,n).best(t, !0).el)
  386. },
  387. min: function(t, i, n) {
  388. return y(i) || (n = i,
  389. i = null),
  390. n = e(n),
  391. i ? (new v(this,n,t).bind(i),
  392. this) : this.pushStack(new l(this,n).best(t).el)
  393. },
  394. rect: function() {
  395. return this.length ? s.ofElement(this[0]) : null
  396. },
  397. scrollState: function(i, n) {
  398. var e = M + ".scrollState";
  399. return t(i, "string") || (n = i,
  400. i = null),
  401. "unbind" === i ? this.each(function() {
  402. var t = g(this).data(e);
  403. t && t.unbind(n)
  404. }) : "check" === i ? this.each(function() {
  405. var t = g(this).data(e);
  406. t && t.check()
  407. }) : y(n) ? this.each(function() {
  408. var t = g(this)
  409. , i = t.data(e);
  410. i || (i = new w(this),
  411. t.data(e, i)),
  412. i.bind(n)
  413. }) : this.length ? new f(this[0]) : null
  414. },
  415. scroll: function(t, i, n) {
  416. return this.each(function() {
  417. new p(this).scroll(t, i, n)
  418. })
  419. },
  420. scrollTo: function(t, i, n, o) {
  421. return g.isNumeric(t) && (o = n,
  422. n = i,
  423. i = t,
  424. t = null),
  425. t = e(t),
  426. this.each(function() {
  427. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  428. })
  429. },
  430. scrollToThis: function(t, i, n, o) {
  431. return o = new p(e(o)),
  432. o.scrollToElement(this[0], t, i, n),
  433. this
  434. },
  435. softLink: function(t, i, n, o) {
  436. return o = new p(e(o)),
  437. this.filter("a[href^=#]").each(function() {
  438. var e = g(this);
  439. e.on("click", function() {
  440. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  441. })
  442. })
  443. },
  444. sort: function(i, n, o) {
  445. return t(n, "boolean") || (o = n,
  446. n = null),
  447. o = e(o),
  448. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  449. return t.el
  450. }))
  451. },
  452. viewport: function(t) {
  453. return this.length ? s.ofViewport(this[0], t) : null
  454. }
  455. },
  456. defaultStatic: "fracs",
  457. defaultMethod: "fracs"
  458. })
  459. }();
  460. if ("undefined" == typeof jQuery)
  461. throw new Error("Bootstrap's JavaScript requires jQuery");
  462. +function(t) {
  463. "use strict";
  464. function e(e) {
  465. return this.each(function() {
  466. var o = t(this)
  467. , s = o.data("bs.tooltip")
  468. , n = "object" == typeof e && e;
  469. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  470. "string" == typeof e && s[e]())
  471. })
  472. }
  473. var i = function(t, e) {
  474. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  475. this.init("tooltip", t, e)
  476. };
  477. i.VERSION = "3.2.0",
  478. i.DEFAULTS = {
  479. animation: !0,
  480. placement: "top",
  481. selector: !1,
  482. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  483. trigger: "hover focus",
  484. title: "",
  485. delay: 0,
  486. html: !1,
  487. container: !1,
  488. viewport: {
  489. selector: "body",
  490. padding: 0
  491. }
  492. },
  493. i.prototype.init = function(e, i, o) {
  494. this.enabled = !0,
  495. this.type = e,
  496. this.$element = t(i),
  497. this.options = this.getOptions(o),
  498. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  499. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  500. var r = s[n];
  501. if ("click" == r)
  502. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  503. else if ("manual" != r) {
  504. var a = "hover" == r ? "mouseenter" : "focusin"
  505. , l = "hover" == r ? "mouseleave" : "focusout";
  506. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  507. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  508. }
  509. }
  510. this.options.selector ? this._options = t.extend({}, this.options, {
  511. trigger: "manual",
  512. selector: ""
  513. }) : this.fixTitle()
  514. }
  515. ,
  516. i.prototype.getDefaults = function() {
  517. return i.DEFAULTS
  518. }
  519. ,
  520. i.prototype.getOptions = function(e) {
  521. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  522. e.delay && "number" == typeof e.delay && (e.delay = {
  523. show: e.delay,
  524. hide: e.delay
  525. }),
  526. e
  527. }
  528. ,
  529. i.prototype.getDelegateOptions = function() {
  530. var e = {}
  531. , i = this.getDefaults();
  532. return this._options && t.each(this._options, function(t, o) {
  533. i[t] != o && (e[t] = o)
  534. }),
  535. e
  536. }
  537. ,
  538. i.prototype.enter = function(e) {
  539. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  540. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  541. t(e.currentTarget).data("bs." + this.type, i)),
  542. clearTimeout(i.timeout),
  543. i.hoverState = "in",
  544. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  545. // "in" == i.hoverState && i.show()
  546. }, i.options.delay.show)) : i.show()
  547. }
  548. ,
  549. i.prototype.leave = function(e) {
  550. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  551. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  552. t(e.currentTarget).data("bs." + this.type, i)),
  553. clearTimeout(i.timeout),
  554. i.hoverState = "out",
  555. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  556. "out" == i.hoverState && i.hide()
  557. }, i.options.delay.hide)) : i.hide()
  558. }
  559. ,
  560. i.prototype.show = function() {
  561. var e = t.Event("show.bs." + this.type);
  562. if (this.hasContent() && this.enabled) {
  563. this.$element.trigger(e);
  564. var i = t.contains(document.documentElement, this.$element[0]);
  565. if (e.isDefaultPrevented() || !i)
  566. return;
  567. var o = this
  568. , s = this.tip()
  569. , n = this.getUID(this.type);
  570. this.setContent(),
  571. s.attr("id", n),
  572. this.$element.attr("aria-describedby", n),
  573. this.options.animation && s.addClass("fade");
  574. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  575. , a = /\s?auto?\s?/i
  576. , l = a.test(r);
  577. l && (r = r.replace(a, "") || "top"),
  578. s.detach().css({
  579. top: 0,
  580. left: 0,
  581. display: "block"
  582. }).addClass(r).data("bs." + this.type, this),
  583. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  584. var p = this.getPosition()
  585. , h = s[0].offsetWidth
  586. , f = s[0].offsetHeight;
  587. if (l) {
  588. var u = r
  589. , c = this.$element.parent()
  590. , d = this.getPosition(c);
  591. 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,
  592. s.removeClass(u).addClass(r)
  593. }
  594. var g = this.getCalculatedOffset(r, p, h, f);
  595. this.applyPlacement(g, r);
  596. var y = function() {
  597. o.$element.trigger("shown.bs." + o.type),
  598. o.hoverState = null
  599. };
  600. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  601. }
  602. }
  603. ,
  604. i.prototype.applyPlacement = function(e, i) {
  605. var o = this.tip()
  606. , s = o[0].offsetWidth
  607. , n = o[0].offsetHeight
  608. , r = parseInt(o.css("margin-top"), 10)
  609. , a = parseInt(o.css("margin-left"), 10);
  610. isNaN(r) && (r = 0),
  611. isNaN(a) && (a = 0),
  612. e.top = e.top + r,
  613. e.left = e.left + a,
  614. t.offset.setOffset(o[0], t.extend({
  615. using: function(t) {
  616. o.css({
  617. top: Math.round(t.top),
  618. left: Math.round(t.left)
  619. })
  620. }
  621. }, e), 0),
  622. o.addClass("in");
  623. var l = o[0].offsetWidth
  624. , p = o[0].offsetHeight;
  625. "top" == i && p != n && (e.top = e.top + n - p);
  626. var h = this.getViewportAdjustedDelta(i, e, l, p);
  627. h.left ? e.left += h.left : e.top += h.top;
  628. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  629. , u = h.left ? "left" : "top"
  630. , c = h.left ? "offsetWidth" : "offsetHeight";
  631. o.offset(e),
  632. this.replaceArrow(f, o[0][c], u)
  633. }
  634. ,
  635. i.prototype.replaceArrow = function(t, e, i) {
  636. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  637. }
  638. ,
  639. i.prototype.setContent = function() {
  640. var t = this.tip()
  641. , e = this.getTitle();
  642. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  643. t.removeClass("fade in top bottom left right")
  644. }
  645. ,
  646. i.prototype.hide = function() {
  647. function e() {
  648. "in" != i.hoverState && o.detach(),
  649. i.$element.trigger("hidden.bs." + i.type)
  650. }
  651. var i = this
  652. , o = this.tip()
  653. , s = t.Event("hide.bs." + this.type);
  654. if (this.$element.removeAttr("aria-describedby"),
  655. this.$element.trigger(s),
  656. !s.isDefaultPrevented())
  657. return o.removeClass("in"),
  658. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  659. this.hoverState = null,
  660. this
  661. }
  662. ,
  663. i.prototype.fixTitle = function() {
  664. var t = this.$element;
  665. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  666. }
  667. ,
  668. i.prototype.hasContent = function() {
  669. return this.getTitle()
  670. }
  671. ,
  672. i.prototype.getPosition = function(e) {
  673. e = e || this.$element;
  674. var i = e[0]
  675. , o = "BODY" == i.tagName;
  676. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  677. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  678. width: o ? t(window).width() : e.outerWidth(),
  679. height: o ? t(window).height() : e.outerHeight()
  680. }, o ? {
  681. top: 0,
  682. left: 0
  683. } : e.offset())
  684. }
  685. ,
  686. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  687. return "bottom" == t ? {
  688. top: e.top + e.height,
  689. left: e.left + e.width / 2 - i / 2
  690. } : "top" == t ? {
  691. top: e.top - o,
  692. left: e.left + e.width / 2 - i / 2
  693. } : "left" == t ? {
  694. top: e.top + e.height / 2 - o / 2,
  695. left: e.left - i
  696. } : {
  697. top: e.top + e.height / 2 - o / 2,
  698. left: e.left + e.width
  699. }
  700. }
  701. ,
  702. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  703. var s = {
  704. top: 0,
  705. left: 0
  706. };
  707. if (!this.$viewport)
  708. return s;
  709. var n = this.options.viewport && this.options.viewport.padding || 0
  710. , r = this.getPosition(this.$viewport);
  711. if (/right|left/.test(t)) {
  712. var a = e.top - n - r.scroll
  713. , l = e.top + n - r.scroll + o;
  714. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  715. } else {
  716. var p = e.left - n
  717. , h = e.left + n + i;
  718. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  719. }
  720. return s
  721. }
  722. ,
  723. i.prototype.getTitle = function() {
  724. var t, e = this.$element, i = this.options;
  725. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  726. }
  727. ,
  728. i.prototype.getUID = function(t) {
  729. do
  730. t += ~~(1e6 * Math.random());
  731. while (document.getElementById(t));return t
  732. }
  733. ,
  734. i.prototype.tip = function() {
  735. return this.$tip = this.$tip || t(this.options.template)
  736. }
  737. ,
  738. i.prototype.arrow = function() {
  739. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  740. }
  741. ,
  742. i.prototype.validate = function() {
  743. this.$element[0].parentNode || (this.hide(),
  744. this.$element = null,
  745. this.options = null)
  746. }
  747. ,
  748. i.prototype.enable = function() {
  749. this.enabled = !0
  750. }
  751. ,
  752. i.prototype.disable = function() {
  753. this.enabled = !1
  754. }
  755. ,
  756. i.prototype.toggleEnabled = function() {
  757. this.enabled = !this.enabled
  758. }
  759. ,
  760. i.prototype.toggle = function(e) {
  761. var i = this;
  762. e && (i = t(e.currentTarget).data("bs." + this.type),
  763. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  764. t(e.currentTarget).data("bs." + this.type, i))),
  765. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  766. }
  767. ,
  768. i.prototype.destroy = function() {
  769. clearTimeout(this.timeout),
  770. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  771. }
  772. ;
  773. var o = t.fn.tooltip;
  774. t.fn.tooltip = e,
  775. t.fn.tooltip.Constructor = i,
  776. t.fn.tooltip.noConflict = function() {
  777. return t.fn.tooltip = o,
  778. this
  779. }
  780. }(jQuery);
  781. !function(e, t, n) {
  782. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  783. }("Keen", this, function() {
  784. "use strict";
  785. function Keen() {
  786. return _init.apply(this, arguments)
  787. }
  788. function _init(e) {
  789. if (_isUndefined(e))
  790. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  791. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  792. throw new Error("Please provide a projectId");
  793. this.configure(e)
  794. }
  795. function _extend(e) {
  796. for (var t = 1; t < arguments.length; t++)
  797. for (var n in arguments[t])
  798. e[n] = arguments[t][n];
  799. return e
  800. }
  801. function _isUndefined(e) {
  802. return void 0 === e
  803. }
  804. function _type(e) {
  805. var t = e && e.constructor ? e.constructor.toString() : void 0;
  806. return t ? t.match(/function (.*)\(/)[1] : "Null"
  807. }
  808. function _each(e, t, n) {
  809. var r;
  810. if (!e)
  811. return 0;
  812. if (n = n ? n : e,
  813. "array" === _type(e)) {
  814. for (r = 0; r < e.length; r++)
  815. if (t.call(n, e[r], r, e) === !1)
  816. return 0
  817. } else
  818. for (r in e)
  819. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  820. return 0;
  821. return 1
  822. }
  823. function _parse_params(e) {
  824. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  825. return decodeURIComponent(e.replace(r, " "))
  826. }, a = e.split("?")[1]; t = i.exec(a); )
  827. n[o(t[1])] = o(t[2]);
  828. return n
  829. }
  830. function _set_protocol(e) {
  831. switch (e) {
  832. case "http":
  833. return "http";
  834. case "auto":
  835. return location.protocol.replace(/:/g, "");
  836. case "https":
  837. case void 0:
  838. default:
  839. return "https"
  840. }
  841. }
  842. function _set_request_type(e) {
  843. var t = e || "jsonp"
  844. , n = !1;
  845. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  846. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  847. }
  848. function _build_url(e) {
  849. return this.client.endpoint + "/projects/" + this.client.projectId + e
  850. }
  851. function _uploadEvent(e, t, n, r, i) {
  852. var o = _build_url.apply(this, ["/events/" + e])
  853. , a = {};
  854. n = n !== !1,
  855. this.client.globalProperties && (a = this.client.globalProperties(e));
  856. for (var c in t)
  857. t.hasOwnProperty(c) && (a[c] = t[c]);
  858. switch (this.client.requestType) {
  859. case "xhr":
  860. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  861. break;
  862. case "jsonp":
  863. var s = JSON.stringify(a)
  864. , l = Keen.Base64.encode(s);
  865. o = o + "?api_key=" + this.client.writeKey,
  866. o = o + "&data=" + l,
  867. o = o + "&modified=" + (new Date).getTime(),
  868. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  869. break;
  870. case "beacon":
  871. var s = JSON.stringify(a)
  872. , l = Keen.Base64.encode(s);
  873. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  874. o = o + "&data=" + encodeURIComponent(l),
  875. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  876. o += "&c=clv1",
  877. _request.beacon.apply(this, [o, null, r, i])
  878. }
  879. }
  880. Keen.prototype.configure = function(e) {
  881. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  882. e.protocol = _set_protocol(e.protocol),
  883. e.requestType = _set_request_type(e.requestType),
  884. this.client = {
  885. projectId: e.projectId,
  886. writeKey: e.writeKey,
  887. readKey: e.readKey,
  888. globalProperties: null,
  889. endpoint: e.protocol + "://" + e.host,
  890. requestType: e.requestType
  891. },
  892. Keen.trigger("client", this, e),
  893. this.trigger("ready"),
  894. this
  895. }
  896. ;
  897. var _request = {
  898. xhr: function(e, t, n, r, i, o, a, c) {
  899. if (!i)
  900. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  901. var s = new XMLHttpRequest;
  902. if (s.onreadystatechange = function() {
  903. if (4 == s.readyState)
  904. if (s.status >= 200 && s.status < 300) {
  905. var e;
  906. try {
  907. e = JSON.parse(s.responseText)
  908. } catch (e) {
  909. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  910. c && c(s, e)
  911. }
  912. a && e && a(e)
  913. } else
  914. Keen.log("HTTP request failed."),
  915. c && c(s, null)
  916. }
  917. ,
  918. s.open(e, t, o),
  919. i && s.setRequestHeader("Authorization", i),
  920. r && s.setRequestHeader("Content-Type", "application/json"),
  921. n)
  922. for (var l in n)
  923. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  924. var u = r ? JSON.stringify(r) : null;
  925. s.send(u)
  926. },
  927. jsonp: function(e, t, n, r) {
  928. if (!t)
  929. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  930. if (t && e.indexOf("api_key") < 0) {
  931. var i = e.indexOf("?") > 0 ? "&" : "?";
  932. e = e + i + "api_key=" + t
  933. }
  934. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  935. o += "a";
  936. var a = !1;
  937. window[o] = function(e) {
  938. a = !0,
  939. n && e && n(e),
  940. window[o] = void 0
  941. }
  942. ,
  943. e = e + "&jsonp=" + o;
  944. var c = document.createElement("script");
  945. c.id = "keen-jsonp",
  946. c.src = e,
  947. document.getElementsByTagName("head")[0].appendChild(c),
  948. c.onreadystatechange = function() {
  949. a === !1 && "loaded" === this.readyState && (a = !0,
  950. r && r())
  951. }
  952. ,
  953. c.onerror = function() {
  954. a === !1 && (a = !0,
  955. r && r())
  956. }
  957. },
  958. beacon: function(e, t, n, r) {
  959. if (t && e.indexOf("api_key") < 0) {
  960. var i = e.indexOf("?") > 0 ? "&" : "?";
  961. e = e + i + "api_key=" + t
  962. }
  963. var o = !1
  964. , a = document.createElement("img");
  965. a.onload = function() {
  966. if (o = !0,
  967. "naturalHeight"in this) {
  968. if (this.naturalHeight + this.naturalWidth === 0)
  969. return void this.onerror()
  970. } else if (this.width + this.height === 0)
  971. return void this.onerror();
  972. n && n({
  973. created: !0
  974. })
  975. }
  976. ,
  977. a.onerror = function() {
  978. o = !0,
  979. r && r()
  980. }
  981. ,
  982. a.src = e
  983. }
  984. }
  985. , Events = Keen.Events = {
  986. on: function(e, t) {
  987. this.listeners || (this.listeners = {});
  988. var n = this.listeners[e] || (this.listeners[e] = []);
  989. return n.push({
  990. callback: t
  991. }),
  992. this
  993. },
  994. off: function(e, t) {
  995. if (!e && !t)
  996. return this.listeners = void 0,
  997. delete this.listeners,
  998. this;
  999. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1000. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1001. t && 0 != n.length || (this.listeners[e] = void 0,
  1002. delete this.listeners[e]);
  1003. return this
  1004. },
  1005. trigger: function(e) {
  1006. if (!this.listeners)
  1007. return this;
  1008. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1009. n[r].callback.apply(this, t);
  1010. return this
  1011. }
  1012. };
  1013. _extend(Keen.prototype, Events),
  1014. _extend(Keen, Events),
  1015. Keen.loaded = !0,
  1016. Keen.utils = {
  1017. each: _each,
  1018. extend: _extend,
  1019. parseParams: _parse_params
  1020. },
  1021. Keen.ready = function(e) {
  1022. Keen.loaded ? e() : Keen.on("ready", e)
  1023. }
  1024. ,
  1025. Keen.log = function(e) {
  1026. "object" == typeof console && console.log("[Keen IO]", e)
  1027. }
  1028. ;
  1029. var Plugins = Keen.Plugins = {};
  1030. Keen.prototype.addEvent = function() {
  1031. _uploadEvent.apply(this, arguments)
  1032. }
  1033. ,
  1034. Keen.prototype.addEventSync = function(e, t, n, r) {
  1035. _uploadEvent.apply(this, [e, t, !1, n, r])
  1036. }
  1037. ,
  1038. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1039. var o = e
  1040. , a = o.metaKey
  1041. , c = o.target
  1042. , s = !1
  1043. , l = function() {};
  1044. return void 0 === r && (r = 500),
  1045. "A" === c.nodeName ? l = function() {
  1046. a || s || (s = !0,
  1047. window.location = c.href)
  1048. }
  1049. : "FORM" === c.nodeName && (l = function() {
  1050. s || (s = !0,
  1051. c.submit())
  1052. }
  1053. ),
  1054. i && (l = function() {
  1055. s || (s = !0,
  1056. i())
  1057. }
  1058. ),
  1059. _uploadEvent.call(this, t, n, l, l),
  1060. setTimeout(function() {
  1061. l()
  1062. }, r),
  1063. !!a && void 0
  1064. }
  1065. ,
  1066. Keen.prototype.setGlobalProperties = function(e) {
  1067. if (!this.client)
  1068. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1069. if (!e || "function" != typeof e)
  1070. throw new Error("Invalid value for global properties: " + e);
  1071. this.client.globalProperties = e
  1072. }
  1073. ,
  1074. Keen.Base64 = {
  1075. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1076. encode: function(e) {
  1077. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1078. for (e = this.utf8.encode(e); l < e.length; )
  1079. t = e.charCodeAt(l++),
  1080. n = e.charCodeAt(l++),
  1081. r = e.charCodeAt(l++),
  1082. i = t >> 2,
  1083. o = (3 & t) << 4 | n >> 4,
  1084. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1085. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1086. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1087. return s
  1088. },
  1089. decode: function(e) {
  1090. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1091. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1092. t = u.indexOf(e.charAt(l++)),
  1093. n = u.indexOf(e.charAt(l++)),
  1094. r = u.indexOf(e.charAt(l++)),
  1095. i = u.indexOf(e.charAt(l++)),
  1096. o = t << 2 | n >> 4,
  1097. a = (15 & n) << 4 | r >> 2,
  1098. c = (3 & r) << 6 | i,
  1099. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1100. return this.utf8.decode(s)
  1101. },
  1102. utf8: {
  1103. encode: function(e) {
  1104. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1105. t = e.charCodeAt(r++),
  1106. 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);
  1107. return n
  1108. },
  1109. decode: function(e) {
  1110. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1111. n = e.charCodeAt(i),
  1112. 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];
  1113. return r
  1114. }
  1115. }
  1116. },
  1117. "object" != typeof JSON && (JSON = {}),
  1118. function() {
  1119. function f(e) {
  1120. return 10 > e ? "0" + e : e
  1121. }
  1122. function quote(e) {
  1123. return escapable.lastIndex = 0,
  1124. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1125. var t = meta[e];
  1126. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1127. }) + '"' : '"' + e + '"'
  1128. }
  1129. function str(e, t) {
  1130. var n, r, i, o, a, c = gap, s = t[e];
  1131. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1132. "function" == typeof rep && (s = rep.call(t, e, s)),
  1133. typeof s) {
  1134. case "string":
  1135. return quote(s);
  1136. case "number":
  1137. return isFinite(s) ? String(s) : "null";
  1138. case "boolean":
  1139. case "null":
  1140. return String(s);
  1141. case "object":
  1142. if (!s)
  1143. return "null";
  1144. if (gap += indent,
  1145. a = [],
  1146. "[object Array]" === Object.prototype.toString.apply(s)) {
  1147. for (o = s.length,
  1148. n = 0; o > n; n += 1)
  1149. a[n] = str(n, s) || "null";
  1150. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1151. gap = c,
  1152. i
  1153. }
  1154. if (rep && "object" == typeof rep)
  1155. for (o = rep.length,
  1156. n = 0; o > n; n += 1)
  1157. "string" == typeof rep[n] && (r = rep[n],
  1158. i = str(r, s),
  1159. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1160. else
  1161. for (r in s)
  1162. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1163. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1164. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1165. gap = c,
  1166. i
  1167. }
  1168. }
  1169. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1170. 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
  1171. }
  1172. ,
  1173. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1174. return this.valueOf()
  1175. }
  1176. );
  1177. 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 = {
  1178. "\b": "\\b",
  1179. "\t": "\\t",
  1180. "\n": "\\n",
  1181. "\f": "\\f",
  1182. "\r": "\\r",
  1183. '"': '\\"',
  1184. "\\": "\\\\"
  1185. }, rep;
  1186. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1187. var r;
  1188. if (gap = "",
  1189. indent = "",
  1190. "number" == typeof n)
  1191. for (r = 0; n > r; r += 1)
  1192. indent += " ";
  1193. else
  1194. "string" == typeof n && (indent = n);
  1195. if (rep = t,
  1196. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1197. throw new Error("JSON.stringify");
  1198. return str("", {
  1199. "": e
  1200. })
  1201. }
  1202. ),
  1203. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1204. function walk(e, t) {
  1205. var n, r, i = e[t];
  1206. if (i && "object" == typeof i)
  1207. for (n in i)
  1208. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1209. void 0 !== r ? i[n] = r : delete i[n]);
  1210. return reviver.call(e, t, i)
  1211. }
  1212. var j;
  1213. if (text = String(text),
  1214. cx.lastIndex = 0,
  1215. cx.test(text) && (text = text.replace(cx, function(e) {
  1216. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1217. })),
  1218. /^[\],:{}\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, "")))
  1219. return j = eval("(" + text + ")"),
  1220. "function" == typeof reviver ? walk({
  1221. "": j
  1222. }, "") : j;
  1223. throw new SyntaxError("JSON.parse")
  1224. }
  1225. )
  1226. }(),
  1227. !function(e, t, n) {
  1228. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1229. }("domready", Keen.utils, function(e) {
  1230. function t(e) {
  1231. for (d = 1; e = r.shift(); )
  1232. e()
  1233. }
  1234. 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]);
  1235. return o[l] && o[l](s, n = function() {
  1236. o.removeEventListener(s, n, i),
  1237. t()
  1238. }
  1239. , i),
  1240. c && o.attachEvent(u, n = function() {
  1241. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1242. t())
  1243. }
  1244. ),
  1245. e = c ? function(t) {
  1246. self != top ? d ? t() : r.push(t) : function() {
  1247. try {
  1248. a.doScroll("left")
  1249. } catch (n) {
  1250. return setTimeout(function() {
  1251. e(t)
  1252. }, 50)
  1253. }
  1254. t()
  1255. }()
  1256. }
  1257. : function(e) {
  1258. d ? e() : r.push(e)
  1259. }
  1260. });
  1261. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1262. if (loaded && cached) {
  1263. clients = cached.clients || {},
  1264. ready = cached.ready || [];
  1265. for (var instance in clients)
  1266. if (clients.hasOwnProperty(instance)) {
  1267. var client = clients[instance];
  1268. for (var method in Keen.prototype)
  1269. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1270. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1271. ,
  1272. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1273. ,
  1274. client._config && (client.configure.call(client, client._config),
  1275. delete client._config),
  1276. client._setGlobalProperties) {
  1277. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1278. client.setGlobalProperties.apply(client, globals[i]);
  1279. delete client._setGlobalProperties
  1280. }
  1281. if (client._addEvent) {
  1282. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1283. client.addEvent.apply(client, queue[i]);
  1284. delete client._addEvent
  1285. }
  1286. var callback = client._on || [];
  1287. if (client._on) {
  1288. for (var i = 0; i < callback.length; i++)
  1289. client.on.apply(client, callback[i]);
  1290. client.trigger("ready"),
  1291. delete client._on
  1292. }
  1293. }
  1294. for (var i = 0; i < ready.length; i++) {
  1295. var callback = ready[i];
  1296. Keen.on("ready", function() {
  1297. callback()
  1298. })
  1299. }
  1300. }
  1301. return Keen.loaded && setTimeout(function() {
  1302. Keen.utils.domready(function() {
  1303. Keen.trigger("ready")
  1304. })
  1305. }, 0),
  1306. Keen
  1307. });
  1308. !function() {
  1309. var t = window.analytics = window.analytics || [];
  1310. if (!t.initialize) {
  1311. if (t.invoked)
  1312. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1313. t.invoked = !0,
  1314. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1315. t.factory = function(e) {
  1316. return function() {
  1317. var n = Array.prototype.slice.call(arguments);
  1318. return n.unshift(e),
  1319. t.push(n),
  1320. t
  1321. }
  1322. }
  1323. ;
  1324. for (var e = 0; e < t.methods.length; e++) {
  1325. var n = t.methods[e];
  1326. t[n] = t.factory(n)
  1327. }
  1328. t.load = function(t) {
  1329. var e = document.createElement("script");
  1330. e.type = "text/javascript",
  1331. e.async = !0,
  1332. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1333. var n = document.getElementsByTagName("script")[0];
  1334. n.parentNode.insertBefore(e, n)
  1335. }
  1336. ,
  1337. t.SNIPPET_VERSION = "4.0.0"
  1338. }
  1339. }();
  1340. !function(i, e) {
  1341. "use strict";
  1342. var s = ""
  1343. , r = "?"
  1344. , o = "function"
  1345. , a = "undefined"
  1346. , n = "object"
  1347. , t = "major"
  1348. , d = "model"
  1349. , w = "name"
  1350. , l = "type"
  1351. , p = "vendor"
  1352. , m = "version"
  1353. , c = "architecture"
  1354. , u = "console"
  1355. , g = "mobile"
  1356. , f = "tablet"
  1357. , h = "smarttv"
  1358. , b = {
  1359. has: function(i, e) {
  1360. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1361. },
  1362. lowerize: function(i) {
  1363. return i.toLowerCase()
  1364. }
  1365. }
  1366. , y = {
  1367. rgx: function() {
  1368. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1369. var c = m[p]
  1370. , u = m[p + 1];
  1371. if (typeof i === a) {
  1372. i = {};
  1373. for (t in u)
  1374. d = u[t],
  1375. typeof d === n ? i[d[0]] = e : i[d] = e
  1376. }
  1377. for (s = r = 0; s < c.length; s++)
  1378. if (w = c[s].exec(this.getUA())) {
  1379. for (t = 0; t < u.length; t++)
  1380. l = w[++r],
  1381. d = u[t],
  1382. 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;
  1383. break
  1384. }
  1385. if (w)
  1386. break
  1387. }
  1388. return i
  1389. },
  1390. str: function(i, s) {
  1391. for (var o in s)
  1392. if (typeof s[o] === n && s[o].length > 0) {
  1393. for (var a = 0; a < s[o].length; a++)
  1394. if (b.has(s[o][a], i))
  1395. return o === r ? e : o
  1396. } else if (b.has(s[o], i))
  1397. return o === r ? e : o;
  1398. return i
  1399. }
  1400. }
  1401. , v = {
  1402. browser: {
  1403. oldsafari: {
  1404. major: {
  1405. 1: ["/8", "/1", "/3"],
  1406. 2: "/4",
  1407. "?": "/"
  1408. },
  1409. version: {
  1410. "1.0": "/8",
  1411. 1.2: "/1",
  1412. 1.3: "/3",
  1413. "2.0": "/412",
  1414. "2.0.2": "/416",
  1415. "2.0.3": "/417",
  1416. "2.0.4": "/419",
  1417. "?": "/"
  1418. }
  1419. }
  1420. },
  1421. device: {
  1422. sprint: {
  1423. model: {
  1424. "Evo Shift 4G": "7373KT"
  1425. },
  1426. vendor: {
  1427. HTC: "APA",
  1428. Sprint: "Sprint"
  1429. }
  1430. }
  1431. },
  1432. os: {
  1433. windows: {
  1434. version: {
  1435. ME: "4.90",
  1436. "NT 3.11": "NT3.51",
  1437. "NT 4.0": "NT4.0",
  1438. 2e3: "NT 5.0",
  1439. XP: ["NT 5.1", "NT 5.2"],
  1440. Vista: "NT 6.0",
  1441. 7: "NT 6.1",
  1442. 8: "NT 6.2",
  1443. 8.1: "NT 6.3",
  1444. RT: "ARM"
  1445. }
  1446. }
  1447. }
  1448. }
  1449. , k = {
  1450. 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]],
  1451. 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]],
  1452. 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]],
  1453. 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]],
  1454. 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]]
  1455. }
  1456. , x = function(e) {
  1457. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1458. return this instanceof x ? (this.getBrowser = function() {
  1459. return y.rgx.apply(this, k.browser)
  1460. }
  1461. ,
  1462. this.getCPU = function() {
  1463. return y.rgx.apply(this, k.cpu)
  1464. }
  1465. ,
  1466. this.getDevice = function() {
  1467. return y.rgx.apply(this, k.device)
  1468. }
  1469. ,
  1470. this.getEngine = function() {
  1471. return y.rgx.apply(this, k.engine)
  1472. }
  1473. ,
  1474. this.getOS = function() {
  1475. return y.rgx.apply(this, k.os)
  1476. }
  1477. ,
  1478. this.getResult = function() {
  1479. return {
  1480. ua: this.getUA(),
  1481. browser: this.getBrowser(),
  1482. engine: this.getEngine(),
  1483. os: this.getOS(),
  1484. device: this.getDevice(),
  1485. cpu: this.getCPU()
  1486. }
  1487. }
  1488. ,
  1489. this.getUA = function() {
  1490. return r
  1491. }
  1492. ,
  1493. this.setUA = function(i) {
  1494. return r = i,
  1495. this
  1496. }
  1497. ,
  1498. void this.setUA(r)) : new x(e).getResult()
  1499. };
  1500. if (typeof exports !== a)
  1501. typeof module !== a && module.exports && (exports = module.exports = x),
  1502. exports.UAParser = x;
  1503. else if (i.UAParser = x,
  1504. typeof define === o && define.amd && define(function() {
  1505. return x
  1506. }),
  1507. typeof i.jQuery !== a) {
  1508. var A = i.jQuery
  1509. , _ = new x;
  1510. A.ua = _.getResult(),
  1511. A.ua.get = function() {
  1512. return _.getUA()
  1513. }
  1514. ,
  1515. A.ua.set = function(i) {
  1516. _.setUA(i);
  1517. var e = _.getResult();
  1518. for (var s in e)
  1519. A.ua[s] = e[s]
  1520. }
  1521. }
  1522. }(this);
  1523. window.Modernizr = function(n, e, t) {
  1524. function o(n) {
  1525. d.cssText = n
  1526. }
  1527. function r(n, e) {
  1528. return typeof n === e
  1529. }
  1530. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1531. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1532. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1533. return e in n && r(n.constructor.prototype[e], "undefined")
  1534. }
  1535. : function(n, e) {
  1536. return v.call(n, e)
  1537. }
  1538. ,
  1539. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1540. var e = this;
  1541. if ("function" != typeof e)
  1542. throw new TypeError;
  1543. var t = b.call(arguments, 1)
  1544. , o = function() {
  1545. if (this instanceof o) {
  1546. var r = function() {};
  1547. r.prototype = e.prototype;
  1548. var i = new r
  1549. , c = e.apply(i, t.concat(b.call(arguments)));
  1550. return Object(c) === c ? c : i
  1551. }
  1552. return e.apply(n, t.concat(b.call(arguments)))
  1553. };
  1554. return o
  1555. }
  1556. ),
  1557. y.webgl = function() {
  1558. return !!n.WebGLRenderingContext
  1559. }
  1560. ;
  1561. for (var h in y)
  1562. u(y, h) && (c = h.toLowerCase(),
  1563. f[c] = y[h](),
  1564. w.push((f[c] ? "" : "no-") + c));
  1565. return f.addTest = function(n, e) {
  1566. if ("object" == typeof n)
  1567. for (var o in n)
  1568. u(n, o) && f.addTest(o, n[o]);
  1569. else {
  1570. if (n = n.toLowerCase(),
  1571. f[n] !== t)
  1572. return f;
  1573. e = "function" == typeof e ? e() : e,
  1574. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1575. f[n] = e
  1576. }
  1577. return f
  1578. }
  1579. ,
  1580. o(""),
  1581. p = i = null,
  1582. f._version = a,
  1583. f
  1584. }(this, this.document);
  1585. !function(e, t, a) {
  1586. "use strict";
  1587. function n(t, h, m) {
  1588. function H(a) {
  1589. var n = 0
  1590. , i = Ee.length;
  1591. if (Ce.old = e.extend({}, Ce),
  1592. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1593. ke = Be[ge.horizontal ? "width" : "height"](),
  1594. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1595. Ee.length = 0,
  1596. Ce.start = 0,
  1597. Ce.end = q(ze - Ie, 0),
  1598. Re) {
  1599. n = Ne.length,
  1600. qe = Pe.children(ge.itemSelector),
  1601. Ne.length = 0;
  1602. 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;
  1603. ze = 0,
  1604. qe.each(function(t, a) {
  1605. var n = e(a)
  1606. , i = a.getBoundingClientRect()
  1607. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1608. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1609. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1610. , h = l + d + p
  1611. , m = !d || !p
  1612. , g = {};
  1613. g.el = a,
  1614. g.size = m ? l : h,
  1615. g.half = g.size / 2,
  1616. g.start = ze + (m ? d : 0),
  1617. g.center = g.start - E(Ie / 2 - g.size / 2),
  1618. g.end = g.start - Ie + g.size,
  1619. t || (ze += s),
  1620. ze += h,
  1621. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1622. t === v && (g.end += o,
  1623. ze += o,
  1624. f = m ? p : 0),
  1625. Ne.push(g),
  1626. r = g
  1627. }),
  1628. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1629. ze -= f,
  1630. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1631. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1632. }
  1633. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1634. Q(),
  1635. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1636. Te = d(Te, ge.minHandleSize, ke),
  1637. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1638. xe.end = ke - Te,
  1639. it || j()),
  1640. !we && Ie > 0) {
  1641. var p = Ce.start
  1642. , h = "";
  1643. if (Re)
  1644. e.each(Ne, function(e, t) {
  1645. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1646. Ee.push(p),
  1647. p += Ie,
  1648. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1649. });
  1650. else
  1651. for (; p - Ie < Ce.end; )
  1652. Ee.push(p),
  1653. p += Ie;
  1654. if (De[0] && i !== Ee.length) {
  1655. for (var m = 0; m < Ee.length; m++)
  1656. h += ge.pageBuilder.call(ye, m);
  1657. Ae = De.html(h).children(),
  1658. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1659. }
  1660. }
  1661. if (Oe.slideeSize = ze,
  1662. Oe.frameSize = Ie,
  1663. Oe.sbSize = ke,
  1664. Oe.handleSize = Te,
  1665. Re) {
  1666. a && null != ge.startAt && (W(ge.startAt),
  1667. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1668. var g = Ne[Oe.activeItem];
  1669. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1670. } else
  1671. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1672. pe("load")
  1673. }
  1674. function X(e, t, a) {
  1675. if (Re && at.released && !a) {
  1676. var n = $(e)
  1677. , i = e > Ce.start && e < Ce.end;
  1678. Le ? (i && (e = Ne[n.centerItem].center),
  1679. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1680. }
  1681. 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),
  1682. et.start = +new Date,
  1683. et.time = 0,
  1684. et.from = Ce.cur,
  1685. et.to = e,
  1686. et.delta = e - Ce.cur,
  1687. et.tweesing = at.tweese || at.init && !at.slidee,
  1688. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1689. at.tweese = 0,
  1690. e !== Ce.dest && (Ce.dest = e,
  1691. pe("change"),
  1692. it || Y()),
  1693. K(),
  1694. Q(),
  1695. Z(),
  1696. F()
  1697. }
  1698. function Y() {
  1699. if (ye.initialized) {
  1700. if (!it)
  1701. return it = w(Y),
  1702. void (at.released && pe("moveStart"));
  1703. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1704. 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),
  1705. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1706. et.to === Ce.cur ? (Ce.cur = et.to,
  1707. at.tweese = it = 0) : it = w(Y),
  1708. pe("move"),
  1709. 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"),
  1710. !it && at.released && pe("moveEnd"),
  1711. j()
  1712. }
  1713. }
  1714. function j() {
  1715. 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,
  1716. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1717. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1718. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1719. }
  1720. function F() {
  1721. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1722. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1723. pe("activePage", _e.page))
  1724. }
  1725. function M() {
  1726. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1727. ot = at.init ? w(M) : 0,
  1728. tt.now = +new Date,
  1729. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1730. X(at.init ? tt.pos : E(tt.pos)),
  1731. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1732. tt.lastTime = tt.now
  1733. }
  1734. function L(e, t, n) {
  1735. if ("boolean" === i(t) && (n = t,
  1736. t = a),
  1737. t === a)
  1738. X(Ce[e], n);
  1739. else {
  1740. if (Le && "center" !== e)
  1741. return;
  1742. var r = ye.getPos(t);
  1743. r && X(r[e], n, !Le)
  1744. }
  1745. }
  1746. function R(e) {
  1747. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1748. }
  1749. function U(e) {
  1750. return R(l(e) && 0 > e ? e + Ne.length : e)
  1751. }
  1752. function W(e, t) {
  1753. var a = R(e);
  1754. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1755. qe.eq(a).addClass(ge.activeClass),
  1756. _e.active = Oe.activeItem = a,
  1757. Z(),
  1758. pe("active", a)),
  1759. a)
  1760. }
  1761. function $(e) {
  1762. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1763. var t = {}
  1764. , a = Me ? 0 : Ie / 2;
  1765. if (!we)
  1766. for (var n = 0, i = Ee.length; i > n; n++) {
  1767. if (e >= Ce.end || n === Ee.length - 1) {
  1768. t.activePage = Ee.length - 1;
  1769. break
  1770. }
  1771. if (e <= Ee[n] + a) {
  1772. t.activePage = n;
  1773. break
  1774. }
  1775. }
  1776. if (Re) {
  1777. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1778. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1779. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1780. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1781. s = c;
  1782. break
  1783. }
  1784. t.firstItem = l(r) ? r : 0,
  1785. t.centerItem = l(o) ? o : t.firstItem,
  1786. t.lastItem = l(s) ? s : t.centerItem
  1787. }
  1788. return t
  1789. }
  1790. function Q(t) {
  1791. e.extend(Oe, $(t))
  1792. }
  1793. function Z() {
  1794. var e = Ce.dest <= Ce.start
  1795. , t = Ce.dest >= Ce.end
  1796. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1797. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1798. Je.is("button,input") && Je.prop("disabled", e),
  1799. Ke.is("button,input") && Ke.prop("disabled", t),
  1800. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1801. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1802. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1803. Qe.is("button,input") && Qe.prop("disabled", e),
  1804. $e.is("button,input") && $e.prop("disabled", t)),
  1805. Re && null != Oe.activeItem) {
  1806. var n = 0 === Oe.activeItem
  1807. , i = Oe.activeItem >= Ne.length - 1
  1808. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1809. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1810. Ze.is("button,input") && Ze.prop("disabled", n),
  1811. Ge.is("button,input") && Ge.prop("disabled", i),
  1812. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1813. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1814. }
  1815. }
  1816. function G(e, t, a) {
  1817. if (e = U(e),
  1818. t = U(t),
  1819. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1820. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1821. var n = t > e ? e : a ? t : t - 1
  1822. , i = e > t ? e : a ? t + 1 : t
  1823. , r = e > t;
  1824. 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)),
  1825. H()
  1826. }
  1827. }
  1828. function J(e, t) {
  1829. for (var a = 0, n = Ve[e].length; n > a; a++)
  1830. if (Ve[e][a] === t)
  1831. return a;
  1832. return -1
  1833. }
  1834. function K() {
  1835. at.released && !ye.isPaused && ye.resume()
  1836. }
  1837. function V(e) {
  1838. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1839. }
  1840. function _() {
  1841. at.history[0] = at.history[1],
  1842. at.history[1] = at.history[2],
  1843. at.history[2] = at.history[3],
  1844. at.history[3] = at.delta
  1845. }
  1846. function ee(e) {
  1847. at.released = 0,
  1848. at.source = e,
  1849. at.slidee = "slidee" === e
  1850. }
  1851. function te(t) {
  1852. var a = "touchstart" === t.type
  1853. , n = t.data.source
  1854. , i = "slidee" === n;
  1855. 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),
  1856. ee(n),
  1857. at.init = 0,
  1858. at.$source = e(t.target),
  1859. at.touch = a,
  1860. at.pointer = a ? t.originalEvent.touches[0] : t,
  1861. at.initX = at.pointer.pageX,
  1862. at.initY = at.pointer.pageY,
  1863. at.initPos = i ? Ce.cur : xe.cur,
  1864. at.start = +new Date,
  1865. at.time = 0,
  1866. at.path = 0,
  1867. at.delta = 0,
  1868. at.locked = 0,
  1869. at.history = [0, 0, 0, 0],
  1870. at.pathToLock = i ? a ? 30 : 10 : 0,
  1871. b.on(a ? z : I, ae),
  1872. ye.pause(1),
  1873. (i ? Pe : Se).addClass(ge.draggedClass),
  1874. pe("moveStart"),
  1875. i && (rt = setInterval(_, 10)))
  1876. }
  1877. function ae(e) {
  1878. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1879. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1880. at.pathX = at.pointer.pageX - at.initX,
  1881. at.pathY = at.pointer.pageY - at.initY,
  1882. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1883. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1884. at.released || !(at.path < 1)) {
  1885. if (!at.init) {
  1886. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1887. return ne();
  1888. at.init = 1
  1889. }
  1890. r(e),
  1891. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1892. at.$source.on(B, s)),
  1893. at.released && (ne(),
  1894. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1895. at.delta += at.swing,
  1896. at.tweese = x(at.swing) > 10)),
  1897. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1898. }
  1899. }
  1900. function ne() {
  1901. clearInterval(rt),
  1902. at.released = !0,
  1903. b.off(at.touch ? z : I, ae),
  1904. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1905. setTimeout(function() {
  1906. at.$source.off(B, s)
  1907. }),
  1908. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1909. ye.resume(1),
  1910. at.init = 0
  1911. }
  1912. function ie(t) {
  1913. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1914. }
  1915. function re() {
  1916. ye.stop(),
  1917. b.off("mouseup", re)
  1918. }
  1919. function se(e) {
  1920. switch (r(e),
  1921. this) {
  1922. case $e[0]:
  1923. case Qe[0]:
  1924. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1925. b.on("mouseup", re);
  1926. break;
  1927. case Ze[0]:
  1928. ye.prev();
  1929. break;
  1930. case Ge[0]:
  1931. ye.next();
  1932. break;
  1933. case Je[0]:
  1934. ye.prevPage();
  1935. break;
  1936. case Ke[0]:
  1937. ye.nextPage()
  1938. }
  1939. }
  1940. function oe(e) {
  1941. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1942. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1943. Re ? (p = +new Date,
  1944. nt.last < p - nt.resetTime && (nt.delta = 0),
  1945. nt.last = p,
  1946. nt.delta += nt.curDelta,
  1947. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1948. nt.delta %= 1),
  1949. nt.finalDelta) : nt.curDelta
  1950. }
  1951. function le(e) {
  1952. e.originalEvent[g] = ye;
  1953. var t = +new Date;
  1954. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1955. return void (O = t);
  1956. if (ge.scrollBy && Ce.start !== Ce.end) {
  1957. var a = oe(e.originalEvent);
  1958. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1959. ye.slideBy(ge.scrollBy * a)
  1960. }
  1961. }
  1962. function ce(e) {
  1963. ge.clickBar && e.target === Be[0] && (r(e),
  1964. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1965. }
  1966. function de(e) {
  1967. if (ge.keyboardNavBy)
  1968. switch (e.which) {
  1969. case ge.horizontal ? 37 : 38:
  1970. r(e),
  1971. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1972. break;
  1973. case ge.horizontal ? 39 : 40:
  1974. r(e),
  1975. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1976. }
  1977. }
  1978. function ue(e) {
  1979. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1980. }
  1981. function fe() {
  1982. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1983. }
  1984. function ve(e) {
  1985. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1986. }
  1987. function pe(e, t) {
  1988. if (Ve[e]) {
  1989. for (me = Ve[e].length,
  1990. T.length = 0,
  1991. he = 0; me > he; he++)
  1992. T.push(Ve[e][he]);
  1993. for (he = 0; me > he; he++)
  1994. T[he].call(ye, e, t)
  1995. }
  1996. }
  1997. 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 = {
  1998. start: 0,
  1999. center: 0,
  2000. end: 0,
  2001. cur: 0,
  2002. dest: 0
  2003. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2004. start: 0,
  2005. end: 0,
  2006. cur: 0
  2007. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2008. firstItem: 0,
  2009. lastItem: 0,
  2010. centerItem: 0,
  2011. activeItem: null,
  2012. activePage: 0
  2013. }, 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 = {
  2014. released: 1
  2015. }, nt = {
  2016. last: 0,
  2017. delta: 0,
  2018. resetTime: 200
  2019. }, it = 0, rt = 0, st = 0, ot = 0;
  2020. we || (t = be[0]),
  2021. ye.initialized = 0,
  2022. ye.frame = t,
  2023. ye.slidee = Pe[0],
  2024. ye.pos = Ce,
  2025. ye.rel = Oe,
  2026. ye.items = Ne,
  2027. ye.pages = Ee,
  2028. ye.isPaused = 0,
  2029. ye.options = ge,
  2030. ye.dragging = at,
  2031. ye.reload = function() {
  2032. H()
  2033. }
  2034. ,
  2035. ye.getPos = function(e) {
  2036. if (Re) {
  2037. var t = R(e);
  2038. return -1 !== t && Ne[t]
  2039. }
  2040. var a = Pe.find(e).eq(0);
  2041. if (a[0]) {
  2042. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2043. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2044. return {
  2045. start: n,
  2046. center: n - Ie / 2 + i / 2,
  2047. end: n - Ie + i,
  2048. size: i
  2049. }
  2050. }
  2051. return !1
  2052. }
  2053. ,
  2054. ye.moveBy = function(e) {
  2055. tt.speed = e,
  2056. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2057. tt.startPos = Ce.cur,
  2058. ee("button"),
  2059. at.init = 1,
  2060. pe("moveStart"),
  2061. y(ot),
  2062. M())
  2063. }
  2064. ,
  2065. ye.stop = function() {
  2066. "button" === at.source && (at.init = 0,
  2067. at.released = 1)
  2068. }
  2069. ,
  2070. ye.prev = function() {
  2071. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2072. }
  2073. ,
  2074. ye.next = function() {
  2075. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2076. }
  2077. ,
  2078. ye.prevPage = function() {
  2079. ye.activatePage(Oe.activePage - 1)
  2080. }
  2081. ,
  2082. ye.nextPage = function() {
  2083. ye.activatePage(Oe.activePage + 1)
  2084. }
  2085. ,
  2086. ye.slideBy = function(e, t) {
  2087. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2088. }
  2089. ,
  2090. ye.slideTo = function(e, t) {
  2091. X(e, t)
  2092. }
  2093. ,
  2094. ye.toStart = function(e, t) {
  2095. L("start", e, t)
  2096. }
  2097. ,
  2098. ye.toEnd = function(e, t) {
  2099. L("end", e, t)
  2100. }
  2101. ,
  2102. ye.toCenter = function(e, t) {
  2103. L("center", e, t)
  2104. }
  2105. ,
  2106. ye.getIndex = R,
  2107. ye.activate = function(e, t) {
  2108. var a = W(e);
  2109. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2110. }
  2111. ,
  2112. ye.activatePage = function(e, t) {
  2113. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2114. }
  2115. ,
  2116. ye.resume = function(e) {
  2117. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2118. st ? st = clearTimeout(st) : pe("resume"),
  2119. st = setTimeout(function() {
  2120. switch (pe("cycle"),
  2121. ge.cycleBy) {
  2122. case "items":
  2123. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2124. break;
  2125. case "pages":
  2126. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2127. }
  2128. }, ge.cycleInterval))
  2129. }
  2130. ,
  2131. ye.pause = function(e) {
  2132. e < ye.isPaused || (ye.isPaused = e || 100,
  2133. st && (st = clearTimeout(st),
  2134. pe("pause")))
  2135. }
  2136. ,
  2137. ye.toggle = function() {
  2138. ye[st ? "pause" : "resume"]()
  2139. }
  2140. ,
  2141. ye.set = function(t, a) {
  2142. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2143. }
  2144. ,
  2145. ye.add = function(t, a) {
  2146. var n = e(t);
  2147. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2148. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2149. H()
  2150. }
  2151. ,
  2152. ye.remove = function(t) {
  2153. if (Re) {
  2154. var a = U(t);
  2155. if (a > -1) {
  2156. qe.eq(a).remove();
  2157. var n = a === Oe.activeItem;
  2158. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2159. H(),
  2160. n && (_e.active = null,
  2161. ye.activate(Oe.activeItem))
  2162. }
  2163. } else
  2164. e(t).remove(),
  2165. H()
  2166. }
  2167. ,
  2168. ye.moveAfter = function(e, t) {
  2169. G(e, t, 1)
  2170. }
  2171. ,
  2172. ye.moveBefore = function(e, t) {
  2173. G(e, t)
  2174. }
  2175. ,
  2176. ye.on = function(e, t) {
  2177. if ("object" === i(e))
  2178. for (var a in e)
  2179. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2180. else if ("function" === i(t))
  2181. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2182. Ve[n[r]] = Ve[n[r]] || [],
  2183. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2184. else if ("array" === i(t))
  2185. for (var o = 0, l = t.length; l > o; o++)
  2186. ye.on(e, t[o])
  2187. }
  2188. ,
  2189. ye.one = function(e, t) {
  2190. function a() {
  2191. t.apply(ye, arguments),
  2192. ye.off(e, a)
  2193. }
  2194. ye.on(e, a)
  2195. }
  2196. ,
  2197. ye.off = function(e, t) {
  2198. if (t instanceof Array)
  2199. for (var a = 0, n = t.length; n > a; a++)
  2200. ye.off(e, t[a]);
  2201. else
  2202. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2203. if (Ve[i[r]] = Ve[i[r]] || [],
  2204. null == t)
  2205. Ve[i[r]].length = 0;
  2206. else {
  2207. var o = J(i[r], t);
  2208. -1 !== o && Ve[i[r]].splice(o, 1)
  2209. }
  2210. }
  2211. ,
  2212. ye.destroy = function() {
  2213. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2214. b.off("keydown", de),
  2215. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2216. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2217. De.empty(),
  2218. we || (be.off("." + g),
  2219. He.restore(),
  2220. Xe.restore(),
  2221. Ye.restore(),
  2222. je.restore(),
  2223. e.removeData(t, g)),
  2224. Ne.length = Ee.length = 0,
  2225. _e = {},
  2226. ye.initialized = 0,
  2227. ye
  2228. }
  2229. ,
  2230. ye.init = function() {
  2231. if (!ye.initialized) {
  2232. ye.on(m);
  2233. var e = ["overflow", "position"]
  2234. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2235. He.save.apply(He, e),
  2236. Ye.save.apply(Ye, e),
  2237. Xe.save.apply(Xe, t),
  2238. je.save.apply(je, t);
  2239. var a = Se;
  2240. return we || (a = a.add(Pe),
  2241. be.css("overflow", "hidden"),
  2242. f || "static" !== be.css("position") || be.css("position", "relative")),
  2243. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2244. a.css({
  2245. position: "absolute"
  2246. })),
  2247. ge.forward && $e.on(S, se),
  2248. ge.backward && Qe.on(S, se),
  2249. ge.prev && Ze.on(B, se),
  2250. ge.next && Ge.on(B, se),
  2251. ge.prevPage && Je.on(B, se),
  2252. ge.nextPage && Ke.on(B, se),
  2253. Ue.on(C, le),
  2254. Be[0] && Be.on(B, ce),
  2255. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2256. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2257. We.on(P, {
  2258. source: "slidee"
  2259. }, te),
  2260. Se && Se.on(P, {
  2261. source: "handle"
  2262. }, te),
  2263. b.on("keydown", de),
  2264. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2265. be.on("scroll." + g, o)),
  2266. ye.initialized = 1,
  2267. H(!0),
  2268. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2269. ye
  2270. }
  2271. }
  2272. }
  2273. function i(e) {
  2274. 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
  2275. }
  2276. function r(e, t) {
  2277. e.preventDefault(),
  2278. t && e.stopPropagation()
  2279. }
  2280. function s(t) {
  2281. r(t, 1),
  2282. e(this).off(t.type, s)
  2283. }
  2284. function o() {
  2285. this.scrollLeft = 0,
  2286. this.scrollTop = 0
  2287. }
  2288. function l(e) {
  2289. return !isNaN(parseFloat(e)) && isFinite(e)
  2290. }
  2291. function c(e, t) {
  2292. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2293. }
  2294. function d(e, t, a) {
  2295. return t > e ? t : e > a ? a : e
  2296. }
  2297. function u(e) {
  2298. var t = {};
  2299. return t.style = {},
  2300. t.save = function() {
  2301. if (e && e.nodeType) {
  2302. for (var a = 0; a < arguments.length; a++)
  2303. t.style[arguments[a]] = e.style[arguments[a]];
  2304. return t
  2305. }
  2306. }
  2307. ,
  2308. t.restore = function() {
  2309. if (e && e.nodeType) {
  2310. for (var a in t.style)
  2311. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2312. return t
  2313. }
  2314. }
  2315. ,
  2316. t
  2317. }
  2318. 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;
  2319. b.on(C, function(e) {
  2320. var t = e.originalEvent[g]
  2321. , a = +new Date;
  2322. (!t || t.options.scrollHijack < a - O) && (O = a)
  2323. }),
  2324. function(e) {
  2325. function t(e) {
  2326. var t = (new Date).getTime()
  2327. , n = Math.max(0, 16 - (t - a))
  2328. , i = setTimeout(e, n);
  2329. return a = t,
  2330. i
  2331. }
  2332. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2333. var a = (new Date).getTime()
  2334. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2335. y = function(t) {
  2336. n.call(e, t)
  2337. }
  2338. }(window),
  2339. function() {
  2340. function e(e) {
  2341. for (var n = 0, i = t.length; i > n; n++) {
  2342. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2343. if (null != a.style[r])
  2344. return r
  2345. }
  2346. }
  2347. var t = ["", "webkit", "moz", "ms", "o"]
  2348. , a = document.createElement("div");
  2349. f = e("transform"),
  2350. v = e("perspective") ? "translateZ(0) " : ""
  2351. }(),
  2352. t[m] = n,
  2353. e.fn[h] = function(t, a) {
  2354. var r, s;
  2355. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2356. s = Array.prototype.slice.call(arguments, 1)),
  2357. t = {}),
  2358. this.each(function(i, o) {
  2359. var l = e.data(o, g);
  2360. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2361. })
  2362. }
  2363. ,
  2364. n.defaults = {
  2365. slidee: null,
  2366. horizontal: !1,
  2367. itemNav: null,
  2368. itemSelector: null,
  2369. smart: !1,
  2370. activateOn: null,
  2371. activateMiddle: !1,
  2372. scrollSource: null,
  2373. scrollBy: 0,
  2374. scrollHijack: 300,
  2375. scrollTrap: !1,
  2376. dragSource: null,
  2377. mouseDragging: !1,
  2378. touchDragging: !1,
  2379. releaseSwing: !1,
  2380. swingSpeed: .2,
  2381. elasticBounds: !1,
  2382. interactive: null,
  2383. scrollBar: null,
  2384. dragHandle: !1,
  2385. dynamicHandle: !1,
  2386. minHandleSize: 50,
  2387. clickBar: !1,
  2388. syncSpeed: .5,
  2389. pagesBar: null,
  2390. activatePageOn: null,
  2391. pageBuilder: function(e) {
  2392. return "<li>" + (e + 1) + "</li>"
  2393. },
  2394. forward: null,
  2395. backward: null,
  2396. prev: null,
  2397. next: null,
  2398. prevPage: null,
  2399. nextPage: null,
  2400. cycleBy: null,
  2401. cycleInterval: 5e3,
  2402. pauseOnHover: !1,
  2403. startPaused: !1,
  2404. moveBy: 300,
  2405. speed: 0,
  2406. easing: "swing",
  2407. startAt: null,
  2408. keyboardNavBy: null,
  2409. draggedClass: "dragged",
  2410. activeClass: "active",
  2411. disabledClass: "disabled"
  2412. }
  2413. }(jQuery, window);
  2414. !function e(t, i, n) {
  2415. function r(a, s) {
  2416. if (!i[a]) {
  2417. if (!t[a]) {
  2418. var l = "function" == typeof require && require;
  2419. if (!s && l)
  2420. return l(a, !0);
  2421. if (o)
  2422. return o(a, !0);
  2423. var c = new Error("Cannot find module '" + a + "'");
  2424. throw c.code = "MODULE_NOT_FOUND",
  2425. c
  2426. }
  2427. var h = i[a] = {
  2428. exports: {}
  2429. };
  2430. t[a][0].call(h.exports, function(e) {
  2431. var i = t[a][1][e];
  2432. return r(i ? i : e)
  2433. }, h, h.exports, e, t, i, n)
  2434. }
  2435. return i[a].exports
  2436. }
  2437. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2438. r(n[a]);
  2439. return r
  2440. }({
  2441. 1: [function(e, t, i) {
  2442. (function(i) {
  2443. "use strict";
  2444. function n(e) {
  2445. this.player = null,
  2446. this.director = null,
  2447. this.modelManager = null,
  2448. this.container = null,
  2449. this.tagManager = null,
  2450. this.fadeInSpeed = e,
  2451. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2452. }
  2453. var r = e("three")
  2454. , o = e("./util/logger")
  2455. , a = (e("./util/common"),
  2456. e("./enum/PlayerEvents"))
  2457. , s = e("./enum/DirectorEvents")
  2458. , l = e("./settings")
  2459. , c = e("./enum/Viewmode")
  2460. , h = (e("./enum/WarpStyle"),
  2461. e("./enum/BlackoutStyle"),
  2462. e("./enum/ModelManagerEvents"))
  2463. , u = e("./enum/tagEvents")
  2464. , d = e("./util/transitions")
  2465. , p = e("./util/lerp")
  2466. , f = new o(i);
  2467. //window.THREE = r;
  2468. n.prototype.init = function(e, t, i, n, r) {
  2469. window.app = this;
  2470. this.player = t,
  2471. this.director = e,
  2472. this.modelManager = i,
  2473. this.tagManager = n,
  2474. this.container = r,
  2475. this.updateModel(),
  2476. this.bindEvents()
  2477. }
  2478. ,
  2479. n.prototype.bindEvents = function() {
  2480. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2481. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2482. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2483. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2484. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2485. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2486. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2487. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2488. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2489. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2490. }
  2491. ,
  2492. n.prototype.updateModel = function() {
  2493. //模型this.model
  2494. this.model = this.modelManager.getActiveModel()
  2495. }
  2496. ,
  2497. n.prototype.handleWarpStarted = function() {
  2498. this.hidePlayerReticule()
  2499. }
  2500. ,
  2501. n.prototype.ontagActivated = function() {
  2502. this.hidePlayerReticule()
  2503. }
  2504. ,
  2505. n.prototype.onNavigationTotag = function() {
  2506. this.hidePlayerReticule()
  2507. }
  2508. ,
  2509. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2510. var n = this.modelManager.getActiveModel()
  2511. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2512. n.fadePanoMarkers(r),
  2513. n.setMode(t)
  2514. }
  2515. ,
  2516. n.prototype.handlePlayerModeChanged = function(e, t) {
  2517. var i = this.modelManager.getActiveModel()
  2518. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2519. i.setSide(n),
  2520. i.setMode(t)
  2521. }
  2522. ,
  2523. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2524. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2525. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2526. }
  2527. ,
  2528. n.prototype.handleActionInterruption = function() {}
  2529. ,
  2530. n.prototype.handleStartInside = function(e) {
  2531. var t = l[this.player.mode]
  2532. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2533. this.fadeIn(this.fadeInSpeed),
  2534. this.model.alpha = 0,
  2535. this.model.skybox.material.uniforms.opacity.value = 1,
  2536. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2537. var n = this.player.reticule;
  2538. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2539. }
  2540. ,
  2541. n.prototype.handleStartOutside = function(e) {
  2542. this.fadeIn(e)
  2543. }
  2544. ,
  2545. n.prototype.fadeIn = function(e) {
  2546. null !== e && void 0 !== e || (e = 2e3,
  2547. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2548. $(this.container).fadeIn(e)
  2549. }
  2550. ,
  2551. n.prototype.hidePlayerReticule = function() {
  2552. this.player.reticule.hide()
  2553. }
  2554. ,
  2555. t.exports = n
  2556. }
  2557. ).call(this, "/js/DisplayController.js")
  2558. }
  2559. , {
  2560. "./enum/BlackoutStyle": 18,
  2561. "./enum/DirectorEvents": 23,
  2562. "./enum/tagEvents": 32,
  2563. "./enum/ModelManagerEvents": 33,
  2564. "./enum/PlayerEvents": 40,
  2565. "./enum/Viewmode": 51,
  2566. "./enum/WarpStyle": 52,
  2567. "./settings": 166,
  2568. "./util/common": 185,
  2569. "./util/lerp": 188,
  2570. "./util/logger": 189,
  2571. "./util/transitions": 195,
  2572. three: 217
  2573. }],
  2574. 2: [function(e, t, i) {
  2575. "use strict";
  2576. function n() {
  2577. this.baseStartTime = performance.timing.navigationStart,
  2578. this.loadingStartTime = null,
  2579. this.waitingStartTime = null,
  2580. this.appReadyTime = null
  2581. }
  2582. n.prototype.setBaseStartTime = function(e) {
  2583. this.baseStartTime = e || Date.now()
  2584. }
  2585. ,
  2586. n.prototype.setWaitingStartTime = function(e) {
  2587. this.waitingStartTime = e || Date.now()
  2588. }
  2589. ,
  2590. n.prototype.setLoadingStartTime = function(e) {
  2591. this.loadingStartTime = e || Date.now()
  2592. }
  2593. ,
  2594. n.prototype.setAppReadyTime = function(e) {
  2595. this.appReadyTime = e || Date.now()
  2596. }
  2597. ,
  2598. n.prototype.calcFullLoadingTime = function() {
  2599. var e = this.appReadyTime - this.baseStartTime;
  2600. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2601. e
  2602. }
  2603. ,
  2604. t.exports = n
  2605. }
  2606. , {}],
  2607. 3: [function(e, t, i) {
  2608. (function(i) {
  2609. "use strict";
  2610. function n() {
  2611. return 100 * Math.random()
  2612. }
  2613. var r = e("./util/logger")
  2614. , o = e("./util/browser")
  2615. , a = new r(i)
  2616. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2617. initialized: !1,
  2618. init: function(e, t) {
  2619. if (t = t || {},
  2620. !this.initialized) {
  2621. this.initialized = !0,
  2622. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2623. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2624. for (var i in e) {
  2625. var r = i.match("^sc_tilegen_([0-9]+)$");
  2626. r && (s.tilegen = n() < parseInt(r[1]));
  2627. var l = i.match("^sc_imgopt_([0-9]+)$");
  2628. l && (s.imgopt = n() < parseInt(l[1]))
  2629. }
  2630. for (var c in t)
  2631. s[c] = t[c],
  2632. a.debug("A/B override:", c, s[c])
  2633. }
  2634. },
  2635. changeIfTileGenerating: function(e) {
  2636. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2637. e += ""),
  2638. e
  2639. },
  2640. changeIfImageOptimzing: function(e) {
  2641. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2642. e += ""),
  2643. e
  2644. },
  2645. tilegen: !1,
  2646. imgopt: !1
  2647. };
  2648. t.exports = s
  2649. }
  2650. ).call(this, "/js/ab.js")
  2651. }
  2652. , {
  2653. "./util/browser": 182,
  2654. "./util/logger": 189
  2655. }],
  2656. 4: [function(e, t, i) {
  2657. (function(i) {
  2658. "use strict";
  2659. function n() {
  2660. return {
  2661. addons: [{
  2662. name: "keen:ua_parser",
  2663. input: {
  2664. ua_string: "user_agent"
  2665. },
  2666. output: "parsed_user_agent"
  2667. }]
  2668. }
  2669. }
  2670. function r(e, t, i, n) {
  2671. function r(t) {
  2672. l[t.sid] = !0;
  2673. var i = t.billboard.media && t.billboard.media.type
  2674. , n = {
  2675. tag_id: t.sid,
  2676. tags_visited: Object.keys(l).length,
  2677. tag_count: Object.keys(e.tags).length,
  2678. tag_view_count: ++E,
  2679. has_media: !!i
  2680. };
  2681. i && (n.media_type = i),
  2682. u("tag_opened", n)
  2683. }
  2684. var l = {}
  2685. , h = Date.now() - N
  2686. , f = null;
  2687. n && (f = Date.now() - window.navigationStart);
  2688. var g;
  2689. try {
  2690. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2691. } catch (e) {
  2692. g = !1
  2693. }
  2694. var v, A = e.supportsVR;
  2695. A || (v = "VR disabled at the model/account level",
  2696. 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"))),
  2697. u("model_loaded", {
  2698. duration: h,
  2699. duration_from_navigation_start: f,
  2700. has_hlr: g,
  2701. has_vr: A,
  2702. vr_reason: v
  2703. });
  2704. var I = 0;
  2705. e.panos.forEach(function(e) {
  2706. e.on("enter", function() {
  2707. c("pano_viewed", {
  2708. pano_id: e.id,
  2709. pano_view_count: ++I,
  2710. alignment_type: e.alignmentType,
  2711. interaction_source: O,
  2712. navigation_source: p
  2713. })
  2714. })
  2715. });
  2716. var E = 0;
  2717. for (var T in e.tags)
  2718. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2719. t.on("tour_auto", function(e) {
  2720. p = "tour_" + e
  2721. }),
  2722. t.on("tour_manual", function(e) {
  2723. O = "gui-" + e,
  2724. p = "tour_manual"
  2725. }),
  2726. i.on(C.InteractionKey, function() {
  2727. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2728. }),
  2729. i.on(C.InteractionDirect, function() {
  2730. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2731. }),
  2732. o(t),
  2733. a(),
  2734. s()
  2735. }
  2736. function o(e) {
  2737. I.on(T.OPENED, function() {
  2738. c("showcase_share_intent", {
  2739. pano_id: e.currentPano && e.currentPano.id
  2740. })
  2741. }),
  2742. I.on(T.LINK_CLICKED, function(t) {
  2743. c("showcase_share_action", {
  2744. channel: t.channel,
  2745. pano_id: e.currentPano && e.currentPano.id
  2746. })
  2747. }),
  2748. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2749. c("showcase_share_origin_link_clicked")
  2750. })
  2751. }
  2752. function a() {}
  2753. function s() {
  2754. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2755. gui_action: "click_vr_button"
  2756. })),
  2757. b.on(S.LAUNCH, function(e) {
  2758. c("showcase_gui", {
  2759. gui_action: "launch_vr",
  2760. vr_platform: e.vr_platform,
  2761. vr_app: e.vr_app
  2762. })
  2763. }),
  2764. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2765. gui_action: "vr_modal_prev"
  2766. })),
  2767. b.on(S.NEXT, function(e) {
  2768. c("showcase_gui", {
  2769. gui_action: e.nextAction
  2770. })
  2771. }),
  2772. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2773. gui_action: "vr_modal_close"
  2774. })),
  2775. b.on(S.falseICECHOSEN, function(e) {
  2776. c("showcase_gui", {
  2777. gui_action: e.name + " "
  2778. })
  2779. }),
  2780. b.on(S.STORE, function(e) {
  2781. c("showcase_gui", {
  2782. gui_action: "launch_store",
  2783. store: e
  2784. })
  2785. })
  2786. }
  2787. function l(e, t) {
  2788. if (f)
  2789. try {
  2790. f.addEvent(e, v.extendObject({
  2791. host: window.location.host,
  2792. keen: n(),
  2793. user_agent: "${keen.user_agent}",
  2794. referrer: {
  2795. url: v.normalizeUrl(document.referrer),
  2796. domain: v.domainFromUrl(document.referrer),
  2797. url_original: document.referrer
  2798. },
  2799. embedded: m.inIframe(),
  2800. is_mobile: m.isMobile(),
  2801. version: "2.25.6-0-gd87e5b1"
  2802. }, t))
  2803. } catch (e) {
  2804. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2805. }
  2806. }
  2807. function c(e, t) {
  2808. if (t = t || {},
  2809. L)
  2810. try {
  2811. window.analytics.track(e, v.extendObject(t, B), {
  2812. context: {
  2813. app: {
  2814. name: "showcase",
  2815. version: "2.25.6-0-gd87e5b1"
  2816. },
  2817. screen: {
  2818. width: window.screen.width,
  2819. height: window.screen.height,
  2820. density: window.devicePixelRatio
  2821. }
  2822. }
  2823. })
  2824. } catch (t) {
  2825. console.warn("Failed to send data to segment for " + e)
  2826. }
  2827. }
  2828. function h(e, t) {
  2829. if (t = t || {},
  2830. navigator.sendBeacon && L)
  2831. try {
  2832. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2833. event: e,
  2834. anonymousId: window.analytics.user().anonymousId(),
  2835. properties: v.extendObject(t, B),
  2836. writeKey: L,
  2837. sentAt: Date.now(),
  2838. type: "track",
  2839. context: {
  2840. userAgent: m.userAgent(),
  2841. library: {
  2842. name: "showcase-beacon",
  2843. version: "2.25.6-0-gd87e5b1"
  2844. },
  2845. app: {
  2846. name: "showcase",
  2847. version: "2.25.6-0-gd87e5b1"
  2848. }
  2849. }
  2850. }))
  2851. } catch (e) {
  2852. console.warn("Failed to send async segment request")
  2853. }
  2854. }
  2855. function u(e, t) {
  2856. t = t || {},
  2857. c(e, t)
  2858. }
  2859. function d(e, t) {
  2860. O = e === C.InteractionGui ? "gui-" + t : e,
  2861. p = "self_guided"
  2862. }
  2863. var p, f, g = (e("three"),
  2864. e("./util/ajax"),
  2865. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2866. 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"),
  2867. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2868. t.exports = {
  2869. report: function(e, t, i, n) {
  2870. l("Session starts", {
  2871. model: e,
  2872. status: t,
  2873. loadtime: Date.now() - (N || Date.now()),
  2874. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2875. autoplay: i,
  2876. quickstart: n,
  2877. ab_tilegen: g.tilegen,
  2878. ab_imgopt: g.imgopt
  2879. })
  2880. },
  2881. impression: function(e) {
  2882. e = e || {};
  2883. var t = void 0 === e.isVisible || e.isVisible
  2884. , i = (void 0 !== e.immediate && e.immediate,
  2885. window.location.search.substr(1).split("&"));
  2886. u("impression", {
  2887. visible: t,
  2888. url_params: i
  2889. })
  2890. },
  2891. initKeen: function(e) {
  2892. return e.token && e.appId ? void (f = new Keen({
  2893. projectId: e.appId,
  2894. writeKey: e.token,
  2895. readKey: "",
  2896. requestType: "xhr"
  2897. })) : void P.warn("no keen token/appId")
  2898. },
  2899. initSegment: function(e) {
  2900. return e.token ? (L = e.token,
  2901. window.analytics.load(e.token),
  2902. B = {
  2903. model_id: e.model,
  2904. start_source: e.startSource,
  2905. autoplay: e.autoplay,
  2906. quickstart: e.quickstart,
  2907. language_tag: A.languageTag,
  2908. is_mobile: m.isMobile(),
  2909. iframe: m.inIframe(),
  2910. aspect_ratio: m.aspectRatio(),
  2911. session_id: F,
  2912. window: {
  2913. width: $("#player").width(),
  2914. height: $("#player").height()
  2915. },
  2916. platform: {
  2917. browser: {
  2918. name: $.ua.browser.name,
  2919. major: $.ua.browser.major,
  2920. version: $.ua.browser.version
  2921. },
  2922. os: {
  2923. name: $.ua.os.name,
  2924. version: $.ua.os.version
  2925. },
  2926. device: {
  2927. vendor: $.ua.device.vendor,
  2928. model: $.ua.device.model,
  2929. type: $.ua.device.type
  2930. }
  2931. }
  2932. },
  2933. D = Math.random() < A.analytics.sessionTrackingRate,
  2934. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2935. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2936. },
  2937. sessionStart: function(e) {
  2938. P.debug("analytics user_session_start"),
  2939. c("session_started"),
  2940. N = Date.now(),
  2941. window.addEventListener("unload", function() {
  2942. h("session_ended", {
  2943. duration: Date.now() - N
  2944. })
  2945. })
  2946. },
  2947. modelLoaded: function(e, t, i, n) {
  2948. r(e, t, i, n)
  2949. },
  2950. loadComplete: function(e) {
  2951. var t = {
  2952. time_to_app_start: e
  2953. };
  2954. c("load_times", t)
  2955. },
  2956. track: function(e, t) {
  2957. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2958. c(e, t))
  2959. },
  2960. trackAlways: function(e, t) {
  2961. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2962. c(e, t)
  2963. },
  2964. getSessionId: function() {
  2965. return F
  2966. },
  2967. updateInteraction: d
  2968. }
  2969. }
  2970. ).call(this, "/js/analytics.js")
  2971. }
  2972. , {
  2973. "./ab": 3,
  2974. "./enum/ControlEvents": 21,
  2975. "./enum/PlayerEvents": 40,
  2976. "./enum/VROption": 47,
  2977. "./enum/VRPlatforms": 49,
  2978. "./enum/Viewmode": 51,
  2979. "./gui/sharing/ShareEvents": 76,
  2980. "./gui/sharing/modal": 77,
  2981. "./gui/title/TitleEvents": 80,
  2982. "./gui/title/titleBar": 82,
  2983. "./gui/vr/vrEvent": 85,
  2984. "./gui/vr/vrModal": 87,
  2985. "./localization/localize": 108,
  2986. "./tag/Billboard/BillboardEvent": 120,
  2987. "./settings": 166,
  2988. "./util/ajax": 181,
  2989. "./util/browser": 182,
  2990. "./util/common": 185,
  2991. "./util/logger": 189,
  2992. three: 217
  2993. }],
  2994. 5: [function(e, t, i) {
  2995. "use strict";
  2996. function n() {
  2997. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2998. this.controls = null
  2999. }
  3000. var r = e("three")
  3001. , o = e("../constants")
  3002. , a = e("../util/cameraLight");
  3003. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3004. n.prototype.updateAspect = function(e) {
  3005. this.aspect = e,
  3006. this.updateProjectionMatrix()
  3007. }
  3008. ,
  3009. t.exports = n
  3010. }
  3011. , {
  3012. "../constants": 8,
  3013. "../util/cameraLight": 184,
  3014. three: 217
  3015. }],
  3016. 6: [function(e, t, i) {
  3017. "use strict";
  3018. function n() {
  3019. var e = $("#player").width() / $("#player").height();
  3020. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3021. this.controls = null,
  3022. this.updateAspect(e)
  3023. }
  3024. var r = e("three")
  3025. , o = e("../constants");
  3026. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3027. n.prototype.updateAspect = function(e) {
  3028. this.aspect = e,
  3029. this.top = o.orthoBase / e,
  3030. this.bottom = -o.orthoBase / e,
  3031. this.updateProjectionMatrix()
  3032. }
  3033. ,
  3034. t.exports = n
  3035. }
  3036. , {
  3037. "../constants": 8,
  3038. three: 217
  3039. }],
  3040. 7: [function(e, t, i) {
  3041. "use strict";
  3042. function n() {
  3043. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3044. this.controls = null
  3045. }
  3046. var r = e("three")
  3047. , o = e("../settings")
  3048. , a = e("../util/cameraLight");
  3049. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3050. n.prototype.updateAspect = function(e) {
  3051. this.aspect = e,
  3052. this.updateProjectionMatrix()
  3053. }
  3054. ,
  3055. t.exports = n
  3056. }
  3057. , {
  3058. "../settings": 166,
  3059. "../util/cameraLight": 184,
  3060. three: 217
  3061. }],
  3062. 8: [function(e, t, i) {
  3063. "use strict";
  3064. t.exports = {
  3065. signedUrlDefaultExpireTime: 24e4,
  3066. signedUrlCheckInterval: 1e4,
  3067. signedUrlRefreshBuffer: 15e3,
  3068. dollhouseFOV: 70,
  3069. dollhouseNear: 1,
  3070. dollhouseFar: 5e3,
  3071. insideFOV: 70,
  3072. insideFOVMax: 120,
  3073. insideNear: .1,
  3074. insideFar: 5e3,
  3075. insideLookSpeed: .12,
  3076. insideLookLimitUp: 40,
  3077. insideLookLimitDown: -40,
  3078. orthoNear: 1,
  3079. orthoFar: 5e3,
  3080. orthoBase: 10,
  3081. narrowLandscapeHeight: 290,
  3082. reallyNarrowLandscapeHeight: 250,
  3083. visionTilingStartDate: new Date("8/26/2016"),
  3084. visionTilingStartVersion: "1.1.407.13667",
  3085. windowHeightHighQualityThreshold: 900,
  3086. tourStepDelayDefault: 3500,
  3087. tourStepDelaySlideShow: 5e3,
  3088. workshopApsect: 9 / 16,
  3089. highQualityMaxZoom: 2,
  3090. ultraHighQualityMaxZoom: 3
  3091. }
  3092. }
  3093. , {}],
  3094. 9: [function(e, t, i) {
  3095. "use strict";
  3096. function n() {
  3097. this.activeControl = null,
  3098. this.controls = {},
  3099. this.cameras = {}
  3100. }
  3101. var r = e("./PanoramaControls")
  3102. , o = e("./DollhouseControls")
  3103. , a = e("./FloorplanControls")
  3104. , s = e("../cameras/PanoramaCamera")
  3105. , l = e("../cameras/DollhouseCamera")
  3106. , c = e("../cameras/FloorplanCamera")
  3107. , h = e("events").EventEmitter
  3108. , u = e("../enum/ControlEvents")
  3109. , d = e("../enum/ModelManagerEvents")
  3110. , p = e("../enum/Viewmode")
  3111. , f = e("../settings");
  3112. n.prototype = Object.create(h.prototype),
  3113. n.prototype.init = function(e, t) {
  3114. this.setUpControls(),
  3115. this.bindEvents(e, t)
  3116. }
  3117. ,
  3118. n.prototype.activateControls = function(e) {
  3119. this.activeControl && (this.activeControl.reset(),
  3120. this.activeControl.enabled = !1),
  3121. this.controls[e] && (this.controls[e].enabled = !0),
  3122. this.activeControl = this.controls[e]
  3123. }
  3124. ,
  3125. n.prototype.setUpControls = function() {
  3126. var e = {}
  3127. , t = {}
  3128. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3129. , n = [s, l, c]
  3130. , h = [r, o, a];
  3131. i.forEach(function(i, r) {
  3132. e[i] = new n[r],
  3133. t[i] = new h[r](e[i]),
  3134. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3135. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3136. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3137. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3138. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3139. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3140. }
  3141. .bind(this)),
  3142. this.controls = t,
  3143. this.cameras = e
  3144. }
  3145. ,
  3146. n.prototype.bindEvents = function(e, t) {
  3147. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3148. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3149. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3150. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3151. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3152. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3153. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3154. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3155. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3156. e.addEventListener("contextmenu", function(e) {
  3157. e.preventDefault()
  3158. }),
  3159. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3160. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3161. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3162. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3163. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3164. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3165. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3166. t.on(d.ActiveModelChanged, function(e) {
  3167. this.setModelForControls(e.model)
  3168. }
  3169. .bind(this))
  3170. }
  3171. ,
  3172. n.prototype.setModelForControls = function(e) {
  3173. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3174. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3175. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3176. this.controls[e].setBounds(t)
  3177. }
  3178. .bind(this))
  3179. }
  3180. ,
  3181. n.prototype.onMouseDown = function(e) {
  3182. e.preventDefault(),
  3183. this.activeControl && this.activeControl.onMouseDown(e)
  3184. }
  3185. ,
  3186. n.prototype.onMouseMove = function(e) {
  3187. e.preventDefault(),
  3188. this.activeControl && this.activeControl.onMouseMove(e)
  3189. }
  3190. ,
  3191. n.prototype.onMouseUp = function(e) {
  3192. e.preventDefault(),
  3193. this.activeControl && this.activeControl.onMouseUp(e)
  3194. }
  3195. ,
  3196. n.prototype.onMouseOver = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseOver(e)
  3199. }
  3200. ,
  3201. n.prototype.onMouseWheel = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onMouseWheel(e)
  3204. }
  3205. ,
  3206. n.prototype.onTouchStart = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onTouchStart(e);
  3209. var hotList = $('#hotListWrap')[0];
  3210. hotList.classList.remove('hotListActive');
  3211. $('#hotListContent ul .active').removeClass('active');
  3212. if($('#hotList')&&$('#hotList')[0]) $('#hotList')[0].classList.remove('active')
  3213. }
  3214. ,
  3215. n.prototype.onTouchMove = function(e) {
  3216. e.preventDefault(),
  3217. this.activeControl && this.activeControl.onTouchMove(e)
  3218. }
  3219. ,
  3220. n.prototype.onTouchEnd = function(e) {
  3221. e.preventDefault(),
  3222. this.activeControl && this.activeControl.onTouchEnd(e)
  3223. }
  3224. ,
  3225. n.prototype.onPointerDown = function(e) {
  3226. if (e.preventDefault(),
  3227. this.activeControl)
  3228. switch (e.pointerType) {
  3229. case "mouse":
  3230. this.activeControl.onMouseDown(e);
  3231. break;
  3232. default:
  3233. this.activeControl.onPointerDown(e)
  3234. }
  3235. }
  3236. ,
  3237. n.prototype.onPointerMove = function(e) {
  3238. if (e.preventDefault(),
  3239. this.activeControl)
  3240. switch (e.pointerType) {
  3241. case "mouse":
  3242. this.activeControl.onMouseMove(e);
  3243. break;
  3244. default:
  3245. this.activeControl.onPointerMove(e)
  3246. }
  3247. }
  3248. ,
  3249. n.prototype.onPointerUp = function(e) {
  3250. if (e.preventDefault(),
  3251. this.activeControl)
  3252. switch (e.pointerType) {
  3253. case "mouse":
  3254. this.activeControl.onMouseUp(e);
  3255. break;
  3256. default:
  3257. this.activeControl.onPointerUp(e)
  3258. }
  3259. }
  3260. ,
  3261. n.prototype.onPointerCancel = function(e) {
  3262. e.preventDefault(),
  3263. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3264. }
  3265. ,
  3266. n.prototype.onKeyDown = function(e) {
  3267. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3268. this.activeControl && this.activeControl.onKeyDown(e))
  3269. }
  3270. ,
  3271. n.prototype.onKeyUp = function(e) {
  3272. e.preventDefault(),
  3273. this.activeControl && this.activeControl.onKeyUp(e)
  3274. }
  3275. ,
  3276. t.exports = n
  3277. }
  3278. , {
  3279. "../cameras/DollhouseCamera": 5,
  3280. "../cameras/FloorplanCamera": 6,
  3281. "../cameras/PanoramaCamera": 7,
  3282. "../enum/ControlEvents": 21,
  3283. "../enum/ModelManagerEvents": 33,
  3284. "../enum/Viewmode": 51,
  3285. "../settings": 166,
  3286. "./DollhouseControls": 10,
  3287. "./FloorplanControls": 11,
  3288. "./PanoramaControls": 13,
  3289. events: 202
  3290. }],
  3291. 10: [function(e, t, i) {
  3292. "use strict";
  3293. function n(e) {
  3294. a.call(this, e),
  3295. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3296. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3297. this.minDistance = o.dollhouseDefault.minDistance,
  3298. this.maxDistance = o.dollhouseDefault.maxDistance,
  3299. this.adjustedMinDistance = this.minDistance,
  3300. this.adjustedMaxDistance = this.maxDistance
  3301. }
  3302. var r = e("three")
  3303. , o = e("../settings")
  3304. , a = e("./OutsideControls");
  3305. n.prototype = Object.create(a.prototype),
  3306. n.prototype.pan = function(e, t) {
  3307. this.camera.updateMatrix();
  3308. var i = this.camera.position.clone().sub(this.target).length();
  3309. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3310. this.panLeft(2 * e * i / $("#player").height()),
  3311. this.panUp(-2 * t * i / $("#player").height())
  3312. }
  3313. ,
  3314. n.prototype.updateZoom = function() {
  3315. var e = this.offset.length();
  3316. return e * this.scale
  3317. }
  3318. ,
  3319. n.prototype.setZoomBounds = function(e) {
  3320. var t = e.min.distanceTo(e.max);
  3321. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3322. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3323. this.minDistance = this.adjustedMinDistance,
  3324. this.maxDistance = this.adjustedMaxDistance
  3325. }
  3326. ,
  3327. n.prototype.resetRanges = function(e, t) {
  3328. e ? (this.minDistance = Math.min(e, this.minDistance),
  3329. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3330. this.maxDistance = this.adjustedMaxDistance),
  3331. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3332. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3333. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3334. }
  3335. ,
  3336. n.prototype.toJSON = function() {
  3337. return a.prototype.toJSON.call(this)
  3338. }
  3339. ,
  3340. t.exports = n
  3341. }
  3342. , {
  3343. "../settings": 166,
  3344. "./OutsideControls": 12,
  3345. three: 217
  3346. }],
  3347. 11: [function(e, t, i) {
  3348. "use strict";
  3349. function n(e) {
  3350. a.call(this, e),
  3351. this.minDistance = 15,
  3352. this.maxDistance = 50,
  3353. this.noRotateUpDown = !0,
  3354. this.minPolarAngle = 0,
  3355. this.maxPolarAngle = 0,
  3356. this.mouseActions[l.LEFT] = s.PAN,
  3357. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3358. this.mouseActions[l.RIGHT] = s.ROTATE,
  3359. this.touchActions[1] = s.PAN,
  3360. this.touchActions[2] = s.ROTATE_DOLLY,
  3361. this.absoluteScale = 1,
  3362. this.currentScale = 1
  3363. }
  3364. var r = e("three")
  3365. , o = e("../settings")
  3366. , a = e("./OutsideControls")
  3367. , s = e("../enum/ControlActions")
  3368. , l = e("../enum/MouseButton")
  3369. , c = e("../util/math")
  3370. , h = e("../util/browser");
  3371. n.prototype = Object.create(a.prototype),
  3372. n.prototype.zoomToContain = function(e) {
  3373. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3374. this.currentScale = this.absoluteScale
  3375. }
  3376. ,
  3377. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3378. let defaultRatio = 1.2 , absoluteScale
  3379. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3380. var angle = parseFloat(_settings.floorPlanAngle)
  3381. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3382. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3383. var screenSize = Math.min($("#player").width(), $("#player").height())
  3384. var maxSize = 800;//模型最大占据像素
  3385. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3386. absoluteScale = n / 2 / o.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3387. }else{
  3388. var t = Math.max(modelSize.x, modelSize.z)
  3389. , i = Math.min(modelSize.x, modelSize.z)
  3390. , n = Math.max(t, i * this.camera.aspect)
  3391. , r = Math.max(i, t * this.camera.aspect);
  3392. absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * defaultRatio
  3393. }
  3394. return absoluteScale
  3395. },
  3396. n.prototype.rotateToView = function(modelSize, direction) {
  3397. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3398. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3399. i = parseFloat(_settings.floorPlanAngle)
  3400. }else{
  3401. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3402. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3403. {
  3404. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3405. {
  3406. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3407. }
  3408. //(第二种情况) 不做处理
  3409. }
  3410. else if(direction.x > 0)
  3411. {
  3412. i = Math.PI / 2;
  3413. }
  3414. else
  3415. {
  3416. i = -Math.PI / 2;
  3417. }
  3418. }
  3419. if(_settings.angleShift2d){
  3420. i += THREE.Math.degToRad(_settings.angleShift2d)
  3421. }
  3422. this.rotateLeft(i);
  3423. this.update(0);
  3424. }
  3425. ,
  3426. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3427. this.rotateLeft(angle + this.lon);
  3428. this.update(0);
  3429. }
  3430. ,
  3431. n.prototype.pan = function(e, t) {
  3432. this.camera.updateMatrix(),
  3433. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3434. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3435. }
  3436. ,
  3437. n.prototype.updateZoom = function() {
  3438. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3439. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3440. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3441. this.camera.left = -o.orthoBase * this.currentScale,
  3442. this.camera.right = o.orthoBase * this.currentScale,
  3443. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3444. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3445. this.camera.updateProjectionMatrix(),
  3446. this.offset.length()
  3447. }
  3448. ,
  3449. n.prototype.toJSON = function() {
  3450. var e = new r.Quaternion
  3451. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3452. , i = new r.Quaternion;
  3453. return function() {
  3454. var n = a.prototype.toJSON.call(this);
  3455. return e.copy(n.camera_quaternion),
  3456. i.copy(t),
  3457. i.multiply(e),
  3458. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3459. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3460. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3461. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3462. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3463. n
  3464. }
  3465. }(),
  3466. t.exports = n
  3467. }
  3468. , {
  3469. "../enum/ControlActions": 20,
  3470. "../enum/MouseButton": 34,
  3471. "../settings": 166,
  3472. "../util/browser": 182,
  3473. "../util/math": 190,
  3474. "./OutsideControls": 12,
  3475. three: 217
  3476. }],
  3477. 12: [function(e, t, i) {
  3478. "use strict";
  3479. function n(e) {
  3480. this.camera = e,
  3481. this.camera.controls = this,
  3482. this.enabled = !1,
  3483. this.target = new r.Vector3,
  3484. this.targetBounds = new r.Box3,
  3485. this.zoomSpeed = 1,
  3486. this.minDistance = 0,
  3487. this.maxDistance = 1 / 0,
  3488. this.noRotateUpDown = !1,
  3489. this.rotateSpeed = 1,
  3490. this.keyboardZoomSpeed = 0,
  3491. this.keyPanSpeed = 7,
  3492. this.autoRotate = !1,
  3493. this.autoRotateSpeed = 2,
  3494. this.autoPan = !1,
  3495. this.autoPanPosition = new r.Vector3,
  3496. this.minPolarAngle = r.Math.degToRad(25),
  3497. this.maxPolarAngle = r.Math.degToRad(65),
  3498. this.rotationAcceleration = new r.Vector2,
  3499. this.rotationSpeed = new r.Vector2,
  3500. this.panAcceleration = new r.Vector2,
  3501. this.panSpeed = new r.Vector2,
  3502. this.rotateStart = new r.Vector2,
  3503. this.rotateEnd = new r.Vector2,
  3504. this.rotateDelta = new r.Vector2,
  3505. this.panStart = new r.Vector2,
  3506. this.panEnd = new r.Vector2,
  3507. this.panDelta = new r.Vector2,
  3508. this.panOffset = new r.Vector3,
  3509. this.offset = new r.Vector3,
  3510. this.dollyStart = new r.Vector2,
  3511. this.dollyEnd = new r.Vector2,
  3512. this.dollyDelta = new r.Vector2,
  3513. this.phiDelta = 0,
  3514. this.thetaDelta = 0,
  3515. this.scale = 1,
  3516. this.panVector = new r.Vector3,
  3517. this.lastPosition = new r.Vector3,
  3518. this.state = c.NONE,
  3519. this.mouseActions = {},
  3520. this.mouseActions[h.LEFT] = c.ROTATE,
  3521. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3522. this.mouseActions[h.RIGHT] = c.PAN,
  3523. this.touchActions = {},
  3524. this.touchActions[1] = c.ROTATE,
  3525. this.touchActions[2] = c.PAN_DOLLY,
  3526. this.lastMoveTime = 0,
  3527. this.pointersLimit = 2,
  3528. this.pointers = []
  3529. }
  3530. var r = e("three")
  3531. , o = e("../settings")
  3532. , a = e("../util/common")
  3533. , s = e("../util/math")
  3534. , l = e("../enum/Vectors")
  3535. , c = e("../enum/ControlActions")
  3536. , h = e("../enum/MouseButton")
  3537. , u = e("../enum/Keys")
  3538. , d = e("../enum/ControlEvents")
  3539. , p = e("events").EventEmitter
  3540. , f = 1e-6;
  3541. n.prototype = Object.create(p.prototype),
  3542. n.prototype.setBounds = function(e) {
  3543. this.targetBounds = e
  3544. }
  3545. ,
  3546. n.prototype.isEngaged = function() {
  3547. return this.state !== c.NONE
  3548. }
  3549. ,
  3550. n.prototype.rotateLeft = function(e) {
  3551. void 0 === e && (e = this.getAutoRotationAngle()),
  3552. this.thetaDelta -= e
  3553. }
  3554. ,
  3555. n.prototype.rotateUp = function(e) {
  3556. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3557. this.phiDelta -= e)
  3558. }
  3559. ,
  3560. n.prototype.panLeft = function(e) {
  3561. var t = this.camera.matrix.elements;
  3562. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3563. this.panOffset.multiplyScalar(-e),
  3564. this.panVector.add(this.panOffset)
  3565. }
  3566. ,
  3567. n.prototype.panUp = function(e) {
  3568. var t = this.camera.matrix.elements;
  3569. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3570. this.panOffset.multiplyScalar(-e),
  3571. this.panVector.add(this.panOffset)
  3572. }
  3573. ,
  3574. n.prototype.startRotating = function(e, t) {
  3575. e && this.navRotationAcc("x", e),
  3576. t && this.navRotationAcc("y", t)
  3577. }
  3578. ,
  3579. n.prototype.stopRotating = function(e) {
  3580. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3581. this.navRotationAcc("x", 0),
  3582. this.navRotationAcc("y", 0)
  3583. }
  3584. ,
  3585. n.prototype.setAutoPanPosition = function(e, t) {
  3586. var i = new r.Vector3
  3587. , n = new r.Vector3;
  3588. return function(e, t) {
  3589. i.copy(this.camera.position),
  3590. void 0 === e && null === e || i.setX(e),
  3591. void 0 === t && null === t || i.setZ(t);
  3592. var r = this.camera.position.distanceTo(this.target)
  3593. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3594. this.targetClamped = !1,
  3595. n.copy(i).addScaledVector(o, r),
  3596. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3597. i.copy(n).addScaledVector(o, -r),
  3598. this.targetClamped = !0),
  3599. this.autoPanPosition.x = i.x,
  3600. this.autoPanPosition.z = i.z,
  3601. this.autoPan && this.stopAutoPanning()
  3602. }
  3603. }(),
  3604. n.prototype.stopAutoPanning = function() {
  3605. var e = this.autoPan;
  3606. this.autoPan = !1,
  3607. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3608. }
  3609. ,
  3610. n.prototype.dollyIn = function(e) {
  3611. void 0 === e && (e = this.getZoomScale()),
  3612. this.scale /= e
  3613. }
  3614. ,
  3615. n.prototype.dollyOut = function(e) {
  3616. void 0 === e && (e = this.getZoomScale()),
  3617. this.scale *= e
  3618. }
  3619. ,
  3620. n.prototype.updatePan = function(e) {
  3621. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3622. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3623. this.autoPan) {
  3624. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3625. t.setY(0).clampLength(0, 50 * e),
  3626. this.target.add(t),
  3627. this.camera.position.add(t),
  3628. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3629. this.stopAutoPanning())
  3630. }
  3631. }
  3632. ,
  3633. n.prototype.update = function(e) {
  3634. e || (e = 1 / 60)
  3635. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3636. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3637. this.rotateLeft(-this.rotationSpeed.x),
  3638. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3639. this.updatePan(e);
  3640. var t = this.camera.position;
  3641. this.offset.copy(t).sub(this.target);
  3642. var i = Math.atan2(this.offset.x, this.offset.z)
  3643. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3644. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3645. i += this.thetaDelta,
  3646. n += this.phiDelta,
  3647. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3648. n = Math.max(f, Math.min(Math.PI - f, n));
  3649. this.lon = i, this.lat = n//add
  3650. var r = this.updateZoom();
  3651. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3652. this.target.add(this.panVector),
  3653. this.targetBounds.clampPoint(this.target, this.target),
  3654. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3655. this.offset.y = r * Math.cos(n),
  3656. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3657. t.copy(this.target).add(this.offset),
  3658. this.camera.lookAt(this.target),
  3659. this.thetaDelta = 0,
  3660. this.phiDelta = 0,
  3661. this.scale = 1,
  3662. this.panVector.set(0, 0, 0),
  3663. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3664. }
  3665. ,
  3666. n.prototype.getAutoRotationAngle = function() {
  3667. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3668. }
  3669. ,
  3670. n.prototype.getZoomScale = function() {
  3671. return Math.pow(.95, this.zoomSpeed)
  3672. }
  3673. ,
  3674. n.prototype.onMouseDown = function(e) {
  3675. if (this.enabled) {
  3676. switch (e.preventDefault(),
  3677. this.stopAutoPanning(),
  3678. this.mouseDown = !0,
  3679. this.state = this.mouseActions[e.button],
  3680. this.state) {
  3681. case c.ROTATE:
  3682. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3683. this.rotationSpeed.set(0, 0);
  3684. break;
  3685. case c.DOLLY:
  3686. this.dollyStart.set(e.clientX, e.clientY);
  3687. break;
  3688. case c.PAN:
  3689. this.panStart.set(e.clientX, e.clientY)
  3690. }
  3691. this.emit(d.InputStart, "mouse")
  3692. }
  3693. }
  3694. ,
  3695. n.prototype.onMouseMove = function(e) {
  3696. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3697. switch (e.preventDefault(),
  3698. this.state) {
  3699. case c.ROTATE:
  3700. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3701. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3702. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3703. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3704. this.rotateStart.copy(this.rotateEnd);
  3705. break;
  3706. case c.DOLLY:
  3707. this.dollyEnd.set(e.clientX, e.clientY),
  3708. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3709. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3710. t.call(this),
  3711. this.dollyStart.copy(this.dollyEnd);
  3712. break;
  3713. case c.PAN:
  3714. this.panEnd.set(e.clientX, e.clientY),
  3715. this.panDelta.subVectors(this.panEnd, this.panStart),
  3716. this.pan(this.panDelta.x, this.panDelta.y),
  3717. this.panStart.copy(this.panEnd)
  3718. }
  3719. this.emit(d.Move, "mouse"),
  3720. this.lastMoveTime = e.timeStamp,
  3721. this.update()
  3722. }
  3723. }
  3724. ,
  3725. n.prototype.onMouseUp = function(e) {
  3726. this.enabled && (this.mouseDown = !1,
  3727. this.state = c.NONE,
  3728. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3729. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3730. this.update(),
  3731. this.rotationAcceleration.set(0, 0),
  3732. this.rotateDelta.set(0, 0)))
  3733. }
  3734. ,
  3735. n.prototype.onMouseOver = function(e) {
  3736. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3737. }
  3738. ,
  3739. n.prototype.onMouseWheel = function(e) {
  3740. if (this.enabled && o.useWheel) {
  3741. this.emit(d.Move, "wheel");
  3742. var t = e.wheelDelta || -e.detail
  3743. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3744. i.call(this),
  3745. this.update()
  3746. }
  3747. }
  3748. ,
  3749. n.prototype.onKeyDown = function(e) {
  3750. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3751. this.handleKeyDown(e.which)))
  3752. }
  3753. ,
  3754. n.prototype.navRotationAcc = function(e, t) {
  3755. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3756. }
  3757. ,
  3758. n.prototype.navPanAcc = function(e, t) {
  3759. this.stopAutoPanning(),
  3760. this.panAcceleration[e] = t
  3761. }
  3762. ,
  3763. n.prototype.handleKeyDown = function(e) {
  3764. var t = !0;
  3765. switch (e) {
  3766. case u.UPARROW:
  3767. case u.I:
  3768. this.navRotationAcc("y", 1);
  3769. break;
  3770. case u.DOWNARROW:
  3771. case u.K:
  3772. this.navRotationAcc("y", -1);
  3773. break;
  3774. case u.LEFTARROW:
  3775. case u.J:
  3776. this.navRotationAcc("x", -1);
  3777. break;
  3778. case u.RIGHTARROW:
  3779. case u.L:
  3780. this.navRotationAcc("x", 1);
  3781. break;
  3782. case u.W:
  3783. this.navPanAcc("y", 1);
  3784. break;
  3785. case u.S:
  3786. this.navPanAcc("y", -1);
  3787. break;
  3788. case u.A:
  3789. this.navPanAcc("x", -1);
  3790. break;
  3791. case u.D:
  3792. this.navPanAcc("x", 1);
  3793. break;
  3794. default:
  3795. t = !1
  3796. }
  3797. t && this.emit(d.Move, "key")
  3798. }
  3799. ,
  3800. n.prototype.onKeyUp = function(e) {
  3801. this.enabled && (e.preventDefault(),
  3802. e.stopPropagation(),
  3803. this.handleKeyUp(e.which))
  3804. }
  3805. ,
  3806. n.prototype.handleKeyUp = function(e) {
  3807. switch (e) {
  3808. case u.I:
  3809. case u.K:
  3810. case u.UPARROW:
  3811. case u.DOWNARROW:
  3812. this.keyboardZoomSpeed = 0,
  3813. this.rotationAcceleration.y = 0;
  3814. break;
  3815. case u.J:
  3816. case u.L:
  3817. case u.LEFTARROW:
  3818. case u.RIGHTARROW:
  3819. this.rotationAcceleration.x = 0;
  3820. break;
  3821. case u.S:
  3822. case u.W:
  3823. this.panAcceleration.y = 0;
  3824. break;
  3825. case u.A:
  3826. case u.D:
  3827. this.panAcceleration.x = 0
  3828. }
  3829. }
  3830. ,
  3831. n.prototype.onTouchStart = function(e) {
  3832. if (this.enabled || this.state === c.NONE) {
  3833. e.preventDefault(),
  3834. e.stopPropagation(),
  3835. this.stopAutoPanning();
  3836. var t = function() {
  3837. if (2 === e.touches.length) {
  3838. var t = e.touches[0].pageX - e.touches[1].pageX
  3839. , i = e.touches[0].pageY - e.touches[1].pageY;
  3840. this.dollyStart.set(t, i)
  3841. }
  3842. }
  3843. .bind(this)
  3844. , i = function() {
  3845. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3846. }
  3847. .bind(this)
  3848. , n = function() {
  3849. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3850. }
  3851. .bind(this);
  3852. switch (this.state = this.touchActions[e.touches.length],
  3853. this.state) {
  3854. case c.PAN_DOLLY:
  3855. t();
  3856. case c.PAN:
  3857. i();
  3858. break;
  3859. case c.ROTATE_DOLLY:
  3860. t();
  3861. case c.ROTATE:
  3862. n()
  3863. }
  3864. this.rotationSpeed.set(0, 0),
  3865. this.emit(d.InputStart, "touch")
  3866. }
  3867. }
  3868. ,
  3869. n.prototype.onTouchMove = function(e) {
  3870. if (this.enabled && this.state !== c.NONE) {
  3871. e.preventDefault(),
  3872. e.stopPropagation();
  3873. var t = function() {
  3874. var t = e.touches[0].pageX - e.touches[1].pageX
  3875. , i = e.touches[0].pageY - e.touches[1].pageY;
  3876. this.dollyEnd.set(t, i);
  3877. var n = this.dollyStart.length() - this.dollyEnd.length();
  3878. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3879. this.dollyStart.copy(this.dollyEnd)
  3880. }
  3881. .bind(this)
  3882. , i = function() {
  3883. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3884. this.panDelta.subVectors(this.panEnd, this.panStart),
  3885. this.pan(this.panDelta.x, this.panDelta.y),
  3886. this.panStart.copy(this.panEnd),
  3887. this.rotateDelta.set(0, 0)
  3888. }
  3889. .bind(this)
  3890. , n = function() {
  3891. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3892. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3893. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3894. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3895. this.rotateStart.copy(this.rotateEnd)
  3896. }
  3897. .bind(this)
  3898. , r = function() {
  3899. if (2 === e.touches.length) {
  3900. var i = window.devicePixelRatio || 1
  3901. , r = e.touches[1].pageX - e.touches[0].pageX
  3902. , s = e.touches[1].pageY - e.touches[0].pageY
  3903. , l = Math.sqrt(r * r + s * s)
  3904. , h = Math.abs(this.dollyStart.length() - l);
  3905. if (h > o.input.touchMoveThreshold * i)
  3906. this.state = c.DOLLY,
  3907. t();
  3908. else {
  3909. var u = a.average(e.touches, "pageX")
  3910. , d = a.average(e.touches, "pageY")
  3911. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3912. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3913. this.rotateStart.set(u, d),
  3914. n())
  3915. }
  3916. }
  3917. }
  3918. .bind(this);
  3919. switch (this.state) {
  3920. case c.PAN_DOLLY:
  3921. t();
  3922. case c.PAN:
  3923. i();
  3924. break;
  3925. case c.ROTATE_DOLLY:
  3926. r();
  3927. break;
  3928. case c.DOLLY:
  3929. t();
  3930. break;
  3931. case c.ROTATE:
  3932. n();
  3933. break;
  3934. default:
  3935. this.state = c.NONE
  3936. }
  3937. this.lastMoveTime = e.timeStamp,
  3938. this.emit(d.Move, "touch")
  3939. }
  3940. }
  3941. ,
  3942. n.prototype.onTouchEnd = function(e) {
  3943. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3944. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3945. this.state = c.NONE,
  3946. this.update(),
  3947. this.rotationAcceleration.set(0, 0),
  3948. this.rotateDelta.set(0, 0))
  3949. }
  3950. ,
  3951. n.prototype.onPointerDown = function(e) {
  3952. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3953. id: e.pointerId,
  3954. pageX: e.pageX,
  3955. pageY: e.pageY
  3956. }),
  3957. e.touches = this.pointers,
  3958. this.onTouchStart(e)),
  3959. this.emit(d.InputStart, "pointer"))
  3960. }
  3961. ,
  3962. n.prototype.onPointerMove = function(e) {
  3963. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3964. e.pointerId === t.id && (t.pageX = e.pageX,
  3965. t.pageY = e.pageY)
  3966. }),
  3967. e.touches = this.pointers,
  3968. this.onTouchMove(e))
  3969. }
  3970. ,
  3971. n.prototype.onPointerUp = function(e) {
  3972. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3973. e.pointerId === t.id && this.pointers.splice(i, 1)
  3974. }
  3975. .bind(this)),
  3976. e.touches = this.pointers,
  3977. this.onTouchEnd(e))
  3978. }
  3979. ,
  3980. n.prototype.reset = function() {
  3981. this.state = c.NONE,
  3982. this.stopAutoPanning(),
  3983. this.rotationSpeed.set(0, 0),
  3984. this.rotationAcceleration.set(0, 0),
  3985. this.panSpeed.set(0, 0),
  3986. this.panAcceleration.set(0, 0)
  3987. }
  3988. ,
  3989. n.prototype.toJSON = function() {
  3990. var e = {
  3991. camera_position: {
  3992. x: s.toPrecision(this.camera.position.x, 4),
  3993. y: s.toPrecision(this.camera.position.y, 4),
  3994. z: s.toPrecision(this.camera.position.z, 4)
  3995. },
  3996. camera_quaternion: {
  3997. x: s.toPrecision(this.camera.quaternion.x, 4),
  3998. y: s.toPrecision(this.camera.quaternion.y, 4),
  3999. z: s.toPrecision(this.camera.quaternion.z, 4),
  4000. w: s.toPrecision(this.camera.quaternion.w, 4)
  4001. }
  4002. };
  4003. return e
  4004. }
  4005. ,
  4006. t.exports = n
  4007. }
  4008. , {
  4009. "../enum/ControlActions": 20,
  4010. "../enum/ControlEvents": 21,
  4011. "../enum/Keys": 30,
  4012. "../enum/MouseButton": 34,
  4013. "../enum/Vectors": 50,
  4014. "../settings": 166,
  4015. "../util/common": 185,
  4016. "../util/math": 190,
  4017. events: 202,
  4018. three: 217
  4019. }],
  4020. 13: [function(e, t, i) {
  4021. (function(i) {
  4022. "use strict";
  4023. function n(e) {
  4024. this.camera = e,
  4025. this.camera.controls = this,
  4026. this.target = new r.Vector3(0,0,0),
  4027. this.lookVector = new r.Vector3,
  4028. this.lookSpeed = .05,
  4029. this.rotationAcc = new r.Vector2,
  4030. this.rotationSpeed = new r.Vector2,
  4031. this.lat = 0,
  4032. this.lon = 0,
  4033. this.phi = 0,
  4034. this.theta = 0,
  4035. this.enabled = !1,
  4036. this.locked = !1,
  4037. this.pointer = new r.Vector2(0,0),
  4038. this.rotationHistory = [],
  4039. this.rotationDifference = new r.Vector2,
  4040. this.pointerDragOn = !1,
  4041. this.pointerDragStart = new r.Vector2(0,0),
  4042. this.pinchDistance = 0,
  4043. this.moveStart = new r.Vector2,
  4044. this.moveTolerance = .01,
  4045. this.pointersLimit = 2,
  4046. this.pointers = []
  4047. }
  4048. var r = e("three")
  4049. , o = e("../util/logger")
  4050. , a = e("../settings")
  4051. , s = e("../util/common")
  4052. , l = e("../util/math")
  4053. , c = (e("../enum/Vectors"),
  4054. e("../enum/MouseButton"))
  4055. , h = e("../enum/Keys")
  4056. , u = e("../enum/ControlEvents")
  4057. , d = e("events").EventEmitter;
  4058. new o(i);
  4059. n.prototype = Object.create(d.prototype),
  4060. n.prototype.usable = function() {
  4061. return this.enabled && !this.locked
  4062. }
  4063. ,
  4064. /* n.prototype.lookAt = function(e) {
  4065. var t = this.camera.position.clone().sub(e)
  4066. , i = Math.atan(t.z / t.x);
  4067. i += t.x < 0 ? Math.PI : 0,
  4068. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4069. this.lon = r.Math.radToDeg(i) + 180;
  4070. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4071. , o = Math.atan(t.y / n);
  4072. this.lat = -r.Math.radToDeg(o)
  4073. }
  4074. */
  4075. n.prototype.lookAt = function(aim, dir) {
  4076. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4077. var i = Math.atan(t.z / t.x);
  4078. i += t.x < 0 ? Math.PI : 0;
  4079. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4080. this.lon = r.Math.radToDeg(i) + 180;
  4081. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4082. o = Math.atan(t.y / n);
  4083. this.lat = -r.Math.radToDeg(o);
  4084. }
  4085. ,
  4086. n.prototype.startRotationFrom = function(e, t) {
  4087. l.convertScreenPositionToNDC(e, t, this.pointer),
  4088. this.pointerDragOn = !0,
  4089. this.pointerDragStart.copy(this.pointer),
  4090. this.moveStart.copy(this.pointer),
  4091. this.rotationHistory = [],
  4092. this.rotationSpeed.set(0, 0)
  4093. }
  4094. ,
  4095. n.prototype.onMouseOver = function(e) {
  4096. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4097. }
  4098. ,
  4099. n.prototype.onTouchStart = function(e) {
  4100. if (this.usable()) {
  4101. switch (e.preventDefault(),
  4102. e.stopPropagation(),
  4103. e.touches.length) {
  4104. case 1:
  4105. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4106. break;
  4107. case 2:
  4108. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4109. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4110. this.pinchDistance = Math.sqrt(t * t + i * i)
  4111. }
  4112. //settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
  4113. this.emit(u.InputStart, "touch")
  4114. }
  4115. }
  4116. ,
  4117. n.prototype.onPointerDown = function(e) {
  4118. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4119. id: e.pointerId,
  4120. clientX: e.clientX,
  4121. clientY: e.clientY
  4122. }),
  4123. e.touches = this.pointers,
  4124. this.onTouchStart(e),
  4125. this.emit(u.InputStart, "pointer"))
  4126. }
  4127. ,
  4128. n.prototype.onMouseDown = function(e) {
  4129. if (this.usable()) {
  4130. switch (e.preventDefault(),
  4131. e.stopPropagation(),
  4132. e.button) {
  4133. case c.LEFT:
  4134. this.startRotationFrom(e.clientX, e.clientY)
  4135. }
  4136. //settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
  4137. this.emit(u.InputStart, "mouse")
  4138. }
  4139. }
  4140. ,
  4141. n.prototype.updateRotation = function() {
  4142. if (this.usable() && this.pointerDragOn) {
  4143. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4144. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4145. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4146. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4147. , o = Math.atan2(e.y, i)
  4148. , a = Math.atan2(t.y, n);
  4149. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4150. e.y = 0,
  4151. t.y = 0;
  4152. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4153. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4154. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4155. this.pointerDragStart.copy(this.pointer)
  4156. }
  4157. }
  4158. ,
  4159. n.prototype.onMouseMove = function(e) {
  4160. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4161. 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"))
  4162. }
  4163. ,
  4164. n.prototype.onTouchMove = function(e) {
  4165. if (this.usable())
  4166. switch (this.emit(u.Move, "touch"),
  4167. e.touches.length) {
  4168. case 1:
  4169. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4170. break;
  4171. case 2:
  4172. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4173. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4174. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4175. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4176. this.emit(u.Pinch, n),
  4177. this.pinchDistance -= n)
  4178. }
  4179. }
  4180. ,
  4181. n.prototype.onPointerMove = function(e) {
  4182. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4183. e.pointerId === t.id && (t.clientX = e.clientX,
  4184. t.clientY = e.clientY)
  4185. }),
  4186. e.touches = this.pointers,
  4187. this.onTouchMove(e))
  4188. }
  4189. ,
  4190. n.prototype.endRotation = function() {
  4191. this.pointerDragOn = !1;
  4192. var e = s.averageVectors(this.rotationHistory);
  4193. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4194. }
  4195. ,
  4196. n.prototype.onTouchEnd = function(e) {
  4197. this.usable() && (e.preventDefault(),
  4198. e.stopPropagation(),
  4199. this.endRotation())
  4200. }
  4201. ,
  4202. n.prototype.onMouseUp = function(e) {
  4203. this.usable() && (e.preventDefault(),
  4204. e.stopPropagation(),
  4205. this.endRotation())
  4206. }
  4207. ,
  4208. n.prototype.onPointerUp = function(e) {
  4209. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4210. e.pointerId === t.id && this.pointers.splice(i, 1)
  4211. }
  4212. .bind(this)),
  4213. e.touches = this.pointers,
  4214. this.onTouchEnd(e))
  4215. }
  4216. ,
  4217. n.prototype.update = function(e) {
  4218. this.lon,
  4219. this.lat;
  4220. for (this.updateRotation(),
  4221. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4222. this.rotationHistory.shift();
  4223. this.lon += this.rotationDifference.x,
  4224. this.lat += this.rotationDifference.y,
  4225. this.rotationDifference.set(0, 0)
  4226. //改
  4227. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4228. this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4229. this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4230. this.lon += this.rotationSpeed.x * e,
  4231. this.lat += this.rotationSpeed.y * e
  4232. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4233. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4234. insideLookLimitDown = insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4235. insideLookLimitUp = insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4236. 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 );
  4237. this.phi = r.Math.degToRad(90 - this.lat),
  4238. this.theta = r.Math.degToRad(this.lon),
  4239. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4240. this.lookVector.y = Math.cos(this.phi),
  4241. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4242. this.target.copy(this.lookVector).add(this.camera.position),
  4243. this.camera.lookAt(this.target)
  4244. }
  4245. ,
  4246. n.prototype.onMouseWheel = function(e) {
  4247. if (this.usable()) {
  4248. var t = e.wheelDelta || -e.detail;
  4249. this.emit(u.InteractionDirect),
  4250. this.emit(u.Scroll, t)
  4251. }
  4252. }
  4253. ,
  4254. n.prototype.onKeyDown = function(e) {
  4255. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4256. this.handleKeyDown(e.which)))
  4257. }
  4258. ,
  4259. n.prototype.handleKeyDown = function(e) {
  4260. var t = function(e, t) {
  4261. this.rotationAcc[e] = t
  4262. }
  4263. .bind(this);
  4264. this.emit(u.InteractionKey);
  4265. var i = !0;
  4266. switch (e) {
  4267. case h.LEFTARROW:
  4268. case h.J:
  4269. t("x", -1);
  4270. break;
  4271. case h.RIGHTARROW:
  4272. case h.L:
  4273. t("x", 1);
  4274. break;
  4275. case h.I:
  4276. t("y", 1);
  4277. break;
  4278. case h.K:
  4279. t("y", -1);
  4280. break;
  4281. default:
  4282. i = !1
  4283. }
  4284. i && this.emit(u.Move, "key")
  4285. }
  4286. ,
  4287. n.prototype.onKeyUp = function(e) {
  4288. this.usable() && (e.preventDefault(),
  4289. e.stopPropagation(),
  4290. this.handleKeyUp(e.which))
  4291. }
  4292. ,
  4293. n.prototype.handleKeyUp = function(e) {
  4294. switch (e) {
  4295. case h.LEFTARROW:
  4296. case h.J:
  4297. case h.RIGHTARROW:
  4298. case h.L:
  4299. this.rotationAcc.x = 0;
  4300. break;
  4301. case h.I:
  4302. case h.K:
  4303. this.rotationAcc.y = 0
  4304. }
  4305. }
  4306. ,
  4307. n.prototype.startRotating = function(e, t) {
  4308. e && (this.rotationAcc.x = e),
  4309. t && (this.rotationAcc.y = t)
  4310. }
  4311. ,
  4312. n.prototype.stopRotating = function(e) {
  4313. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4314. this.rotationAcc.set(0, 0)
  4315. }
  4316. ,
  4317. n.prototype.reset = function() {
  4318. this.pointerDragOn = !1,
  4319. this.rotationAcc.set(0, 0),
  4320. this.rotationSpeed.set(0, 0),
  4321. this.pointers = []
  4322. }
  4323. ,
  4324. n.prototype.toJSON = function() {
  4325. var e = {
  4326. camera_position: {
  4327. x: l.toPrecision(this.camera.position.x, 4),
  4328. y: l.toPrecision(this.camera.position.y, 4),
  4329. z: l.toPrecision(this.camera.position.z, 4)
  4330. },
  4331. camera_quaternion: {
  4332. x: l.toPrecision(this.camera.quaternion.x, 4),
  4333. y: l.toPrecision(this.camera.quaternion.y, 4),
  4334. z: l.toPrecision(this.camera.quaternion.z, 4),
  4335. w: l.toPrecision(this.camera.quaternion.w, 4)
  4336. }
  4337. };
  4338. return e
  4339. }
  4340. ,
  4341. n.prototype.setStateFromJSON = function(e) {
  4342. this.camera.position.copy(e.camera_position),
  4343. this.camera.quaternion.copy(e.camera_quaternion)
  4344. }
  4345. ,
  4346. t.exports = n
  4347. }
  4348. ).call(this, "/js/controls/PanoramaControls.js")
  4349. }
  4350. , {
  4351. "../enum/ControlEvents": 21,
  4352. "../enum/Keys": 30,
  4353. "../enum/MouseButton": 34,
  4354. "../enum/Vectors": 50,
  4355. "../settings": 166,
  4356. "../util/common": 185,
  4357. "../util/logger": 189,
  4358. "../util/math": 190,
  4359. events: 202,
  4360. three: 217
  4361. }],
  4362. 14: [function(e, t, i) {
  4363. (function(i) {
  4364. "use strict";
  4365. var n = e("three")
  4366. , r = e("../enum/Viewmode")
  4367. , o = e("../util/logger")
  4368. , a = new o(i);
  4369. t.exports = {
  4370. serialize: function(e) {
  4371. return encodeURI(JSON.stringify(e))
  4372. },
  4373. deserialize: function(e) {
  4374. function t(e) {
  4375. function t(e, t) {
  4376. return e && "number" == typeof t && !isNaN(t)
  4377. }
  4378. return e.reduce(t, !0)
  4379. }
  4380. try {
  4381. var i = JSON.parse(decodeURI(e))
  4382. , o = {
  4383. mode: r.fromInt(i.camera_mode),
  4384. panoId: i.scan_id,
  4385. position: (new n.Vector3).copy(i.camera_position),
  4386. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4387. zoom: i.ortho_zoom,
  4388. floorVisibility: i.floor_visibility
  4389. }
  4390. , s = o.position;
  4391. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4392. var l = o.quaternion;
  4393. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4394. o
  4395. } catch (i) {
  4396. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4397. try {
  4398. var c = e.split(",")
  4399. , h = {
  4400. x: parseFloat(c[2]),
  4401. y: parseFloat(c[3]),
  4402. z: parseFloat(c[4])
  4403. }
  4404. , u = {
  4405. x: parseFloat(c[5]),
  4406. y: parseFloat(c[6]),
  4407. z: parseFloat(c[7]),
  4408. w: parseFloat(c[8])
  4409. };
  4410. return t([h.x, h.y, h.z]) || (h.x = 0,
  4411. h.y = 0,
  4412. h.z = 0),
  4413. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4414. u.y = 0,
  4415. u.z = 0,
  4416. u.w = 1),
  4417. {
  4418. mode: r.fromInt(c[0]),
  4419. panoId: c[1],
  4420. position: (new n.Vector3).copy(h),
  4421. quaternion: (new n.Quaternion).copy(u)
  4422. }
  4423. } catch (t) {
  4424. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4425. }
  4426. }
  4427. return null
  4428. }
  4429. }
  4430. }
  4431. ).call(this, "/js/controls/serializer.js")
  4432. }
  4433. , {
  4434. "../enum/Viewmode": 51,
  4435. "../util/logger": 189,
  4436. three: 217
  4437. }],
  4438. 15: [function(e, t, i) {
  4439. (function(i) {
  4440. "use strict";
  4441. function n() {
  4442. this.endlessLoop = a.warp.loop,
  4443. this.clock = new r.Clock(!0),
  4444. this.model = null,
  4445. this.player = null,
  4446. this.currentItem = null,
  4447. this.destinationItem = null,
  4448. this.tourIsPlaying = !1,
  4449. this.transitionStage = y.None,
  4450. this.nextFunc = null,
  4451. this.onTheBus = !1,
  4452. this.tourInProgress = !1,
  4453. this.reachSource = null,
  4454. this.interrupted = !1,
  4455. this.nItems = 0,
  4456. this.walkingSectionPaused = !1
  4457. }
  4458. var r = e("three")
  4459. , o = e("./util/logger")
  4460. , a = e("./settings")
  4461. , s = e("./util/transitions")
  4462. , l = e("events").EventEmitter
  4463. , c = e("./enum/Viewmode")
  4464. , h = e("./analytics")
  4465. , u = e("./enum/WarpStyle")
  4466. , s = e("./util/transitions")
  4467. , d = (e("./model/ModelManager"),
  4468. e("./enum/ModelManagerEvents"))
  4469. , p = e("./enum/DirectorEvents")
  4470. , f = e("./enum/PlayerEvents")
  4471. , g = (e("./enum/ControlEvents"),
  4472. e("./enum/BlackoutStyle"))
  4473. , m = e("./enum/PathDiscardMode")
  4474. , v = e("./enum/PathDisplayMode")
  4475. , A = (e("./player"),
  4476. new o(i))
  4477. , y = Object.freeze({
  4478. None: 0,
  4479. Moving: 1,
  4480. Aiming: 2,
  4481. Interlude: 3
  4482. })
  4483. , C = Object.freeze({
  4484. Forward: 1,
  4485. NoChange: 0,
  4486. Backwards: -1
  4487. })
  4488. , I = s.getUniqueId();
  4489. n.prototype = Object.create(l.prototype),
  4490. n.prototype.init = function(e, t) {
  4491. this.player = e,
  4492. this.modelManager = t,
  4493. this.updateModel(),
  4494. this.resetAll(),
  4495. this.bindEvents()
  4496. }
  4497. ,
  4498. n.prototype.resetAll = function() {
  4499. if (this.currentItem = null,
  4500. this.destinationItem = null,
  4501. this.tourIsPlaying = !1,
  4502. //this.bgmReplay(),//xzw
  4503. this.transitionStage = y.None,
  4504. this.nextFunc = null,
  4505. this.onTheBus = !1,
  4506. this.reachSource = null,
  4507. this.interrupted = !1,
  4508. this.model) {
  4509. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4510. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4511. } else
  4512. this.defaultWarpStyle = u.BLACK,
  4513. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4514. this.resetSpecialTransition()
  4515. }
  4516. ,
  4517. n.prototype.updateModel = function() {
  4518. this.model = this.modelManager.getActiveModel(),
  4519. this.nItems = this.model.heroLocations.length
  4520. }
  4521. ,
  4522. n.prototype.bindEvents = function() {
  4523. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4524. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4525. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4526. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4527. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4528. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4529. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4530. this.player.once(f.Move, function() {
  4531. s.cancelById(I)
  4532. })
  4533. }
  4534. ,
  4535. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4536. return //xzw add 拖拽不停止
  4537. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4538. this.pauseWalkingSection(),
  4539. this.player.fastForwardActivePanoFlight(),
  4540. !0/* ) */
  4541. }
  4542. ,
  4543. n.prototype.handlePlayerMove = function(e) {
  4544. return //xzw add 拖拽不停止
  4545. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4546. this.emit("update.controls")
  4547. }
  4548. ,
  4549. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4550. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4551. this.emit("update.controls"))
  4552. }
  4553. ,
  4554. n.prototype.handlePlayerModeChanged = function(e, t) {
  4555. this.intermediateState() || e === t || (this.onTheBus = !1,
  4556. this.emit("update.controls"))
  4557. }
  4558. ,
  4559. n.prototype.handlePlayerInputStart = function(e) {
  4560. return //xzw add 拖拽不停止
  4561. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4562. }
  4563. ,
  4564. n.prototype.handlePlayerFlyingStarted = function() {
  4565. this.clearWalkingSectionPaused()
  4566. }
  4567. ,
  4568. n.prototype.describe = function() {
  4569. return {
  4570. nItems: this.nItems,
  4571. currentItem: this.currentItem,
  4572. destinationItem: this.destinationItem,
  4573. tourIsPlaying: this.tourIsPlaying,
  4574. onTheBus: this.onTheBus,
  4575. endlessLoop: this.endlessLoop,
  4576. viewMode: this.player.mode,
  4577. inTransition: this._inTransition(),
  4578. transitionStage: this.transitionStage,
  4579. tourInProgress: this.tourInProgress
  4580. }
  4581. }
  4582. ,
  4583. n.prototype._inTransition = function() {
  4584. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4585. }
  4586. ,
  4587. n.prototype.bounceable = function() {
  4588. var e = this.clock.getDelta();
  4589. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4590. }
  4591. ,
  4592. n.prototype.itemCompare = function(item1, item2, type){//add
  4593. if(type == 'equal'){//==
  4594. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4595. }else if(type == 'less'){//<
  4596. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4597. }
  4598. }
  4599. n.prototype.currentMoveDirection = function() {
  4600. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4601. 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
  4602. }
  4603. ,
  4604. n.prototype.clearPath = function() {
  4605. this._inTransition() || this.player.path.discardPathObject()
  4606. }
  4607. ,
  4608. n.prototype.allFloors = function() {
  4609. this.model.toggleAllFloors()
  4610. }
  4611. ,
  4612. n.prototype.actionComplete = function(e) {
  4613. if (this.interrupted = !1,
  4614. this.transitionStage = y.None,
  4615. this.resetSpecialTransition(),
  4616. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4617. this.tourIsPlaying || (this.player.disablePreRendering(),
  4618. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4619. this.emit("update.controls"),
  4620. this.nextFunc) {
  4621. var t = this.nextFunc;
  4622. this.nextFunc = null,
  4623. t()
  4624. }
  4625. }
  4626. ,
  4627. n.prototype.awaitCompletion = function(e, t) {
  4628. this.nextFunc = t,
  4629. e()
  4630. }
  4631. ,
  4632. n.prototype.updateSuccessFunction = function(e) {
  4633. this.nextFunc = e
  4634. }
  4635. ,
  4636. n.prototype.interrupt = function(e, t) {
  4637. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4638. this.tourIsPlaying = !1,
  4639. //this.bgmReplay(),//xzw
  4640. this.interrupted = !0,
  4641. this.nextFunc = null,
  4642. this.emit(p.ActionInterrupted),
  4643. null !== e && void 0 !== e || (e = g.BEGINNING),
  4644. this.player.interruptAndFastForward(e, t),
  4645. !0)
  4646. }
  4647. ,
  4648. n.prototype.wouldInterrupt = function() {
  4649. return this.transitionStage !== y.None
  4650. }
  4651. ,
  4652. n.prototype.intermediateState = function() {
  4653. return this.transitionStage !== y.None
  4654. }
  4655. ,
  4656. n.prototype.isInterrupted = function() {
  4657. return this.interrupted
  4658. }
  4659. ,
  4660. n.prototype.pauseWalkingSection = function() {
  4661. this.walkingSectionPaused = !0
  4662. }
  4663. ,
  4664. n.prototype.clearWalkingSectionPaused = function() {
  4665. this.walkingSectionPaused = !1
  4666. }
  4667. ,
  4668. n.prototype.autoTour = function() {
  4669. var e = Date.now();
  4670. this.model.auxDataPromise.then(function() {
  4671. e = Date.now() - e;
  4672. var t = a.warp.auto
  4673. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4674. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4675. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4676. done: function() {
  4677. this.playTour()
  4678. }
  4679. .bind(this),
  4680. name: "_atr",
  4681. id: I
  4682. })
  4683. }
  4684. .bind(this))
  4685. }
  4686. ,
  4687. /* n.prototype.atDestinationPano = function() {
  4688. if (!this.player.currentPano || null === this.destinationItem)
  4689. return !1;
  4690. var e = this.player.currentPano.id;
  4691. if (void 0 === e)
  4692. return !1;
  4693. var t = this.model.heroLocations;
  4694. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4695. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4696. return destination && destination.panoId == e
  4697. } */
  4698. n.prototype.atDestinationPano = function(pano) {
  4699. if(null === this.destinationItem)return !1;
  4700. pano = pano || this.player.currentPano
  4701. if(!pano){
  4702. return !1;
  4703. }
  4704. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4705. return destination && destination.panoId == pano.id
  4706. }
  4707. ,
  4708. n.prototype.redirectToItem = function(e, t) {
  4709. if (null === e || void 0 === e)
  4710. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4711. if (!this.wouldInterrupt())
  4712. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4713. if (this.player.mode === c.TRANSITIONING)
  4714. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4715. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4716. var i = function() {
  4717. s.setTimeout(function() {
  4718. this.setDestinationItem(e),
  4719. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4720. }
  4721. .bind(this), 0)
  4722. }
  4723. .bind(this);
  4724. this.interrupt(g.END, 0),
  4725. this.updateSuccessFunction(i)
  4726. }
  4727. ,
  4728. n.prototype.useSpecialTransition = function(e) {
  4729. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4730. this.nextWarpStyle = u.BLACK
  4731. }
  4732. ,
  4733. n.prototype.resetSpecialTransition = function() {
  4734. this.nextWarpStyle = this.defaultWarpStyle
  4735. }
  4736. ,
  4737. n.prototype.arrivedAtDestination = function(e) {
  4738. if (this.player.flying || this.player.isWarping())
  4739. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4740. else {
  4741. this.transitionStage = y.Aiming;
  4742. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4743. this.player.model.fadePanoMarkers(0),
  4744. this.awaitCompletion(function() {
  4745. this.resetSpecialTransition(),
  4746. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4747. }
  4748. .bind(this), t)
  4749. }
  4750. }
  4751. ,
  4752. n.prototype.goToDestination = function(e, t, i, n) {
  4753. //音频
  4754. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4755. // zeg 手动导览不播放音频
  4756. if(!settings.tourSoundUnable && musicInfo && musicInfo.music && !e){
  4757. let musicType = localStorage.getItem('xunirole') || 'male'
  4758. let isMale = musicType.indexOf('female') < 0
  4759. let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
  4760. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4761. let src = fixMusic
  4762. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4763. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4764. let audioSrc2 = common.getFileNameFromUrl(src)
  4765. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4766. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4767. SoundManager.play('tour',null,0) // currentTime = 0;
  4768. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4769. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4770. }
  4771. }else{//很可能是该folder的起始
  4772. SoundManager.play('tour', manage.dealURL(src))
  4773. }
  4774. }
  4775. let oldPos = this.player.position.clone();
  4776. let oldPano = this.player.currentPano
  4777. if (this.onTheBus = !0,
  4778. this.emit("update.controls"),
  4779. this.player.updateLastView(),
  4780. !n && this.atDestinationPano()){
  4781. /*
  4782. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4783. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4784. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4785. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4786. } */
  4787. return void this.arrivedAtDestination(!0);
  4788. }
  4789. if (this.player.flying || this.player.isWarping())
  4790. A.warn("Cannot go to new destination while player is flying or warping.");
  4791. else {
  4792. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4793. , o = null
  4794. , a1 = null;
  4795. if (r.isPano()) {
  4796. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4797. //var walk = window.DATA.black ? 'black' : 'walk';
  4798. //若是点击item,直接瞬间过渡。
  4799. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4800. if(this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4801. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4802. o = this.arrivedAtDestination.bind(this, !0)
  4803. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4804. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4805. }
  4806. } else{
  4807. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4808. o = this.arrivedAtDestination.bind(this, !1);
  4809. }
  4810. this.transitionStage = y.Moving,
  4811. this.model.fadePanoMarkers(0),
  4812. this.awaitCompletion(function() {
  4813. a1();
  4814. }
  4815. .bind(this), o),
  4816. this.emit("update.controls")
  4817. }
  4818. }
  4819. ,
  4820. n.prototype.tourInterlude = function() {
  4821. if (h.trackAlways("reach_highlight", {
  4822. reach_source: this.reachSource
  4823. }),
  4824. this.model.fadePanoMarkers(0),
  4825. this.emit("update.controls"),
  4826. this.tourIsPlaying)
  4827. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4828. // 周恩光 播完最后一段语音
  4829. void this.awaitCompletion(function() {
  4830. this.transitionStage = y.Interlude,
  4831. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4832. }
  4833. .bind(this), function(){
  4834. this.currentItem = [0,0],
  4835. this.stopTour(true),
  4836. this.emit(p.TourEnd)
  4837. }.bind(this)),
  4838. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4839. this.transitionStage = y.Interlude,
  4840. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4841. }
  4842. .bind(this), this.goNext.bind(this))
  4843. }
  4844. ,
  4845. n.prototype.findNearestItem = function(endToStart=true, searchEvery){//找到离currentPano最近的导览
  4846. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4847. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4848. } */
  4849. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4850. var result = {item:[0,0], dis:Infinity};
  4851. var compare = (location, item)=>{
  4852. if(location.panoId != void 0 && location.panoId!= "outside"){
  4853. var pano = this.model.panos.index[location.panoId];
  4854. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4855. if(dis<result.dis){
  4856. result.item = item, result.dis = dis, result.location = location, result.angle = null
  4857. }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4858. if(this.currentItem){
  4859. //if(this.itemCompare(item, this.currentItem, 'equal')){
  4860. if(result.angle == void 0){
  4861. result.angle = result.location.quaternion.angleTo(player.quaternion)
  4862. }
  4863. let angle = location.quaternion.angleTo(player.quaternion)
  4864. if(angle < result.angle){
  4865. result.item = item, result.dis = dis, result.location = location, result.angle = angle
  4866. }
  4867. /* }else{
  4868. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4869. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4870. if( this.itemCompare(dis1, dis2, 'less')){
  4871. result.item = item, result.dis = dis, result.location = location
  4872. }
  4873. } */
  4874. }
  4875. }
  4876. }
  4877. }
  4878. this.model.heroLocations.forEach((e,i)=>{
  4879. if(e.heroLocations){
  4880. if(searchEvery){
  4881. e.heroLocations.forEach((a,j)=>{
  4882. compare(a, [i,j])
  4883. })
  4884. }else{
  4885. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4886. location && compare(location, [i,0]) //跳到此区域开头
  4887. }
  4888. }else{
  4889. compare(e, [i,0])
  4890. }
  4891. })
  4892. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4893. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4894. }
  4895. return result.item
  4896. }
  4897. /* n.prototype.findNearestItem2 = function(endToStart=true, every){//找到离currentPano最近的最小片段
  4898. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4899. var result = {item:[0,0], dis:Infinity};
  4900. var compare = (location, item)=>{
  4901. if(location.panoId != void 0 && location.panoId!= "outside"){
  4902. var pano = this.model.panos.index[location.panoId];
  4903. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4904. if(dis<result.dis){
  4905. result.item = item, result.dis = dis
  4906. }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4907. if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
  4908. result.item = item, result.dis = dis
  4909. }
  4910. }
  4911. }
  4912. }
  4913. this.model.heroLocations.forEach((e,i)=>{
  4914. if(e.heroLocations){
  4915. e.heroLocations.forEach((a,j)=>{
  4916. compare(a, [i,j])
  4917. })
  4918. }else{
  4919. compare(e, [i,0])
  4920. }
  4921. })
  4922. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4923. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4924. }
  4925. return result.item
  4926. } */
  4927. n.prototype.playTour = function() {
  4928. if (!this.bounceable() && this.model.heroLocations.length) {
  4929. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4930. // if(!this.currentItem) this.currentItem = []
  4931. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4932. // // zeg 从当前pano进行自动导览
  4933. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4934. // // this.model.heroLocations.forEach( (value, index) => {
  4935. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4936. // // currentPanoDestinations.push(index)
  4937. // // }
  4938. // // })
  4939. // if(!currentPanoDestinations) {
  4940. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4941. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4942. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4943. // for(var i = 0; i < neighbourIndex.length; i++) {
  4944. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4945. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4946. // }
  4947. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4948. // }
  4949. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4950. // this.currentItem[0] = currentPanoDestinations[0]
  4951. // }
  4952. // }
  4953. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4954. this.tourInProgress = !0,
  4955. this.reachSource = "play",
  4956. this.tourIsPlaying = !0,
  4957. this.wasZoomEnabled = this.player.zoomEnabled,
  4958. this.player.zoomEnabled = !1,
  4959. this.resetSpecialTransition(),
  4960. this.emit("update.controls"),
  4961. this.emit(p.TourStart),
  4962. this.player.enablePreRendering(),
  4963. // this.currentItem[1] = null,
  4964. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4965. this.goToDestination()) : /* this.goNext() */(this.tourAdvance(0) ,this.goToDestination()))) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4966. }
  4967. }
  4968. n.prototype.playTourNearBy = function() {//就近导览
  4969. if (!this.bounceable()){
  4970. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4971. this.tourInProgress = !0,
  4972. this.reachSource = "play",
  4973. this.tourIsPlaying = !0,
  4974. this.wasZoomEnabled = this.player.zoomEnabled,
  4975. this.player.zoomEnabled = !1,
  4976. this.resetSpecialTransition(),
  4977. this.emit("update.controls"),
  4978. this.emit(p.TourStart),
  4979. this.player.enablePreRendering(),
  4980. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4981. this.goToDestination()) : this.goNext())) */
  4982. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4983. }
  4984. }
  4985. ,
  4986. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4987. } */
  4988. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4989. settings.tourSoundUnable || SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
  4990. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4991. this.tourIsPlaying = !1,
  4992. this.interrupt(),
  4993. this.clearWalkingSectionPaused(),
  4994. this.resetSpecialTransition(),
  4995. this.emit("update.controls"))
  4996. }
  4997. ,
  4998. n.prototype.endTourProgress = function() {
  4999. this.tourInProgress = !1,
  5000. this.emit("update.controls"),
  5001. this.emit(p.TourEnd)
  5002. }
  5003. ,
  5004. n.prototype.goToHighlight = function(e) {
  5005. //if(player.isWarping() )return //add
  5006. //this.highlightItem = e //add
  5007. if(this.waitHighlight)return this.waitHighlight = e //继续等待
  5008. if(player.flying){
  5009. this.waitHighlight = e
  5010. return player.once("flying.ended",()=>{
  5011. let e = this.waitHighlight
  5012. this.waitHighlight = null
  5013. this.goToHighlight(e)
  5014. })
  5015. }else if(player.isWarping()){
  5016. this.waitHighlight = e
  5017. return this.once("warp.end",()=>{
  5018. setTimeout(()=>{
  5019. let e = this.waitHighlight
  5020. this.waitHighlight = null
  5021. this.goToHighlight(e)
  5022. },200)
  5023. })
  5024. /* return setTimeout(()=>{
  5025. this.once("warp.end",()=>{
  5026. this.goToHighlight(e)
  5027. })
  5028. },100) */
  5029. }
  5030. /* if (this.wouldInterrupt()){
  5031. let soon
  5032. if(this.itemCompare(this.destinationItem,e,'equal') ){
  5033. this.interrupt()
  5034. soon = true
  5035. }else{
  5036. this.redirectToItem(e, "goToHighlight")
  5037. }
  5038. setTimeout(()=>{
  5039. this.once(soon ? "tour.end" : "warp.end",()=>{
  5040. console.log(this.currentItem)
  5041. setTimeout(()=>{
  5042. this.highlightItem = null
  5043. this.playTour() // 切换导览时(点击列表item),不要停止导览
  5044. },700)
  5045. })
  5046. },10)
  5047. }else { */
  5048. if (A.debug("<tour.goto " + e + ">"),
  5049. this.isInterrupted())
  5050. return;
  5051. this.clearWalkingSectionPaused(),
  5052. this.setDestinationItem(e),
  5053. this.useSpecialTransition("Hilight")
  5054. this.goToDestination(true),//add true
  5055. h.trackAlways("reach_highlight", {
  5056. reach_source: "thumb"
  5057. })
  5058. this.once('warp.end',()=>{
  5059. this.highlightItem = null //add
  5060. })
  5061. //}
  5062. }
  5063. ,
  5064. n.prototype.prevHighlight = function() {
  5065. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5066. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5067. this.reachSource = "prev",
  5068. this.goPrev()))
  5069. }
  5070. ,
  5071. n.prototype.nextHighlight = function() {
  5072. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5073. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5074. this.reachSource = "next",
  5075. this.goNext()))
  5076. }
  5077. ,
  5078. n.prototype.changeMode = function(e) {
  5079. var t = $.Deferred()
  5080. , i = t.resolve.bind(t)
  5081. , n = t.reject.bind(t);
  5082. this.emit(p.StartModeChange);
  5083. var r = function() {
  5084. return this.clearWalkingSectionPaused(),
  5085. !!this.wouldInterrupt() && (this.interrupt(),
  5086. !0)
  5087. }
  5088. .bind(this);
  5089. if (!r()) {
  5090. switch (e) {
  5091. case c.PANORAMA:
  5092. 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);
  5093. break;
  5094. case c.DOLLHOUSE:
  5095. case c.FLOORPLAN:
  5096. this.player.flyToNewMode({
  5097. mode: e
  5098. }).done(i).fail(n);
  5099. break;
  5100. case c.OUTDOOR:
  5101. 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)
  5102. }
  5103. return t.promise()
  5104. }
  5105. }
  5106. ,
  5107. n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
  5108. var end = this.model.heroLocations.length > 0 && currentItem && currentItem[0] >= this.nItems - 1;
  5109. if(end){
  5110. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5111. if(heroLocations){
  5112. end = currentItem[1] >= heroLocations.length - 1
  5113. }
  5114. }
  5115. return end;
  5116. }
  5117. ,
  5118. n.prototype.firstDestination = function() {
  5119. //return 0 < this.nItems ? 0 : null
  5120. return 0 < this.nItems ? [0,0]: null
  5121. }
  5122. ,
  5123. n.prototype.finalDestination = function() {
  5124. //return 0 < this.nItems ? this.nItems - 1 : null
  5125. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5126. }
  5127. ,
  5128. n.prototype.goPrev = function() {
  5129. this.tourAdvance(-1)
  5130. }
  5131. ,
  5132. n.prototype.goNext = function() {
  5133. this.tourAdvance(1)
  5134. }
  5135. ,
  5136. n.prototype.setDestinationItem = function(e) {
  5137. this.destinationItem = e,
  5138. this.emit("update.controls")
  5139. }
  5140. ,
  5141. n.prototype.setCurrentItem = function(e) {
  5142. this.currentItem = e,
  5143. this.emit("update.controls")
  5144. }
  5145. ,
  5146. n.prototype.nextItem = function(currentItem) {
  5147. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5148. if(currentItem == void 0)return this.firstDestination()
  5149. var currentLocation = this.model.heroLocations[currentItem[0]];
  5150. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5151. var item;
  5152. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5153. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5154. }else{
  5155. item = [currentItem[0] , currentItem[1]+1]
  5156. }
  5157. if(item[0] >= this.nItems ){
  5158. item = this.firstDestination()
  5159. }
  5160. return item;
  5161. //暂时不理会endlessLoop,默认为false
  5162. }
  5163. ,
  5164. n.prototype.prevItem = function(currentItem) {
  5165. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5166. if(currentItem == void 0)return this.firstDestination()
  5167. var item;
  5168. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5169. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5170. else{
  5171. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5172. if(this.currentItem[1] == 0){//子目录中第一个
  5173. return [currentItem[0] - 1, lastChildNum-1]
  5174. }else{
  5175. return [currentItem[0], currentItem[1]-1]
  5176. }
  5177. }
  5178. }
  5179. ,
  5180. n.prototype.tourAdvance = function(e) {//e是1或-1 或 0
  5181. A.debug("tourAdvance(" + e + ")")
  5182. if(null === this.currentItem || void 0 === this.currentItem){
  5183. this.setDestinationItem(this.firstDestination())
  5184. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5185. }else{
  5186. var item = this.currentItem
  5187. if(e == 1){
  5188. item = this.nextItem(this.currentItem)
  5189. }else if(e == -1){
  5190. item = this.prevItem(this.currentItem)
  5191. }
  5192. this.setDestinationItem(item)
  5193. }
  5194. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')/* [0] < 0 */){
  5195. this.useSpecialTransition("reverse-looping to end")
  5196. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5197. this.useSpecialTransition("looping back to start")
  5198. }
  5199. /* var momentTour = this.getMomentTour(this.destinationItem);
  5200. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5201. var zoomLevel = this.player.zoomLevel;
  5202. this.player.zoomEnabled = true;
  5203. var zoom = function(e, d) {
  5204. this.player.zoomTo((1-e)*zoomLevel, true)
  5205. }.bind(this)
  5206. s.start(zoom, 1500, function(){
  5207. }, 0, d.easeOutQuad, "zoom")
  5208. } */
  5209. this.goToDestination()
  5210. }
  5211. ,
  5212. n.prototype.getMomentTour = function(destinationItem) {//add
  5213. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  5214. if(!destinationItem) return wholeMomentTour
  5215. else{
  5216. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5217. if(currentLocation.momentTour)return currentLocation.momentTour;
  5218. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5219. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5220. }
  5221. }
  5222. ,
  5223. t.exports = n
  5224. }
  5225. ).call(this, "/js/director.js")
  5226. }
  5227. , {
  5228. "./analytics": 4,
  5229. "./enum/BlackoutStyle": 18,
  5230. "./enum/ControlEvents": 21,
  5231. "./enum/DirectorEvents": 23,
  5232. "./enum/ModelManagerEvents": 33,
  5233. "./enum/PathDiscardMode": 38,
  5234. "./enum/PathDisplayMode": 39,
  5235. "./enum/PlayerEvents": 40,
  5236. "./enum/Viewmode": 51,
  5237. "./enum/WarpStyle": 52,
  5238. "./model/ModelManager": 140,
  5239. "./player": 155,
  5240. "./settings": 166,
  5241. "./util/logger": 189,
  5242. "./util/transitions": 195,
  5243. events: 202,
  5244. three: 217
  5245. }],
  5246. 16: [function(e, t, i) {
  5247. "use strict";
  5248. var n = e("three")
  5249. , r = e("./enum/Viewmode")
  5250. , o = (e("./settings"),
  5251. e("./util/transitions"))
  5252. , a = e("./enum/PlayerEvents")
  5253. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5254. , l = new n.ShaderPass(n.VerticalBlurShader);
  5255. l.renderToScreen = !0;
  5256. var c = $("#player").width() / $("#player").height();
  5257. isNaN(c) && (c = 1);
  5258. //initTransitionPass(n)
  5259. var h = {
  5260. currentBlur: 0,
  5261. aspect: c,
  5262. blurStrength: 1,
  5263. hblurPass: s,
  5264. vblurPass: l,
  5265. transitionMaskPass : new n.TransitionPass()
  5266. ,
  5267. bindEvents: function(e) {
  5268. e.on(a.ModeChanged, function(e, t) {
  5269. e === r.PANORAMA && (o.cancel(h.blur),
  5270. o.cancel(h.addBlur),
  5271. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5272. })
  5273. },
  5274. blur: function(e) {
  5275. h.currentBlur = e;
  5276. var t = e * h.blurStrength;
  5277. l.uniforms.v.value = t / 512 * h.aspect,
  5278. s.uniforms.h.value = t / 512
  5279. },
  5280. addBlur: function(e) {
  5281. e = Math.max(e, h.currentBlur),
  5282. h.blur(e)
  5283. },
  5284. removeBlur: function(e) {
  5285. e = Math.min(1 - e, h.currentBlur),
  5286. h.blur(e)
  5287. }
  5288. };
  5289. h.blur(0),
  5290. t.exports = h
  5291. }
  5292. , {
  5293. "./enum/PlayerEvents": 40,
  5294. "./enum/Viewmode": 51,
  5295. "./settings": 166,
  5296. "./util/transitions": 195,
  5297. three: 217
  5298. }],
  5299. 17: [function(e, t, i) {
  5300. "use strict";
  5301. t.exports = {
  5302. UNKNOWN: 0,
  5303. ALIGNED: 1,
  5304. UNALIGNED: 2,
  5305. PLACED: 3
  5306. }
  5307. }
  5308. , {}],
  5309. 18: [function(e, t, i) {
  5310. "use strict";
  5311. t.exports = {
  5312. NONE: 0,
  5313. MIDDLE: 1,
  5314. END: 2,
  5315. BEGINNING: 3,
  5316. FADEIN: 4
  5317. }
  5318. }
  5319. , {}],
  5320. 19: [function(e, t, i) {
  5321. "use strict";
  5322. var n = e("three");
  5323. t.exports = {
  5324. newBlue: new n.Color(4967932),
  5325. altBlue: new n.Color(47355),
  5326. tagDefault: new n.Color(223357),
  5327. classicBlue: new n.Color(53759),
  5328. mpYellow: new n.Color(16502016),
  5329. mpOrange: new n.Color(16428055),
  5330. mpBlue: new n.Color(12096),
  5331. mpLtGrey: new n.Color(13751252),
  5332. mpDkGrey: new n.Color(10000019),
  5333. mpRed: new n.Color(12525854),
  5334. mpOrangeDesat: new n.Color(16764529),
  5335. mpBlueDesat: new n.Color(4034734),
  5336. mpRedDesat: new n.Color(14705505),
  5337. white: new n.Color(16777215),
  5338. black: new n.Color(0),
  5339. _desat: function(e, t) {
  5340. var i = t || .3
  5341. , r = (new n.Color).copy(e).getHSL();
  5342. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5343. },
  5344. _darken: function(e, t) {
  5345. var i = t || .2
  5346. , r = e.getHSL();
  5347. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5348. }
  5349. }
  5350. }
  5351. , {
  5352. three: 217
  5353. }],
  5354. 20: [function(e, t, i) {
  5355. "use strict";
  5356. t.exports = {
  5357. NONE: -1,
  5358. ROTATE: 0,
  5359. DOLLY: 1,
  5360. PAN: 2,
  5361. ROTATE_DOLLY: 3,
  5362. PAN_DOLLY: 4
  5363. }
  5364. }
  5365. , {}],
  5366. 21: [function(e, t, i) {
  5367. "use strict";
  5368. t.exports = {
  5369. Move: "move",
  5370. InteractionDirect: "interaction.direct",
  5371. InteractionKey: "interaction.key",
  5372. InteractionGui: "interaction.gui",
  5373. FlyInDirection: "fly.direction",
  5374. InputStart: "input.start",
  5375. Pinch: "input.pinch",
  5376. Scroll: "input.scroll",
  5377. AutoPanInterrupt: "autopan.interrupt",
  5378. AutoPanComplete: "autopan.complete",
  5379. AutoPanClamped: "autopan.clamped",
  5380. LongTap: "longtap"
  5381. }
  5382. }
  5383. , {}],
  5384. 22: [function(e, t, i) {
  5385. "use strict";
  5386. t.exports = Object.freeze({
  5387. FORWARD: "FORWARD",
  5388. LEFT: "LEFT",
  5389. RIGHT: "RIGHT",
  5390. BACK: "BACK",
  5391. UP: "UP",
  5392. DOWN: "DOWN"
  5393. })
  5394. }
  5395. , {}],
  5396. 23: [function(e, t, i) {
  5397. "use strict";
  5398. t.exports = {
  5399. ActionInterrupted: "action.interrupted",
  5400. TourStart: "tour.start",
  5401. TourEnd: "tour.end",
  5402. StartModeChange: "mode.startChange"
  5403. }
  5404. }
  5405. , {}],
  5406. 24: [function(e, t, i) {
  5407. "use strict";
  5408. t.exports = Object.freeze({
  5409. None: 0,
  5410. Queued: 1,
  5411. ForceQueued: 2,
  5412. Downloading: 3,
  5413. Downloaded: 4,
  5414. DownloadFailed: 5
  5415. })
  5416. }
  5417. , {}],
  5418. 25: [function(e, t, i) {
  5419. "use strict";
  5420. t.exports = {
  5421. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5422. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5423. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5424. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5425. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5426. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5427. }
  5428. }
  5429. , {}],
  5430. 26: [function(e, t, i) {
  5431. "use strict";
  5432. t.exports = {
  5433. Texture2D: 0,
  5434. TextureCube: 1
  5435. }
  5436. }
  5437. , {}],
  5438. 27: [function(e, t, i) {
  5439. "use strict";
  5440. t.exports = {
  5441. SMALL: "small",
  5442. LARGE: "large"
  5443. }
  5444. }
  5445. , {}],
  5446. 28: [function(e, t, i) {
  5447. "use strict";
  5448. var n = e("./Viewmode")
  5449. , r = {
  5450. LANDING: {},
  5451. NAVIGATION: "navigation",
  5452. MORE_HELP: "moreHelp",
  5453. TOUR_INTERACTION: {}
  5454. };
  5455. r.LANDING[n.PANORAMA] = "panorama.landing",
  5456. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5457. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5458. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5459. r.TOUR_INTERACTION.standard = "standard.tour",
  5460. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5461. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5462. t.exports = r
  5463. }
  5464. , {
  5465. "./Viewmode": 51
  5466. }],
  5467. 29: [function(e, t, i) {
  5468. "use strict";
  5469. var n = {
  5470. UP: 1,
  5471. DOWN: -1,
  5472. LEFT: "L",
  5473. RIGHT: "R",
  5474. FORWARD: "F",
  5475. BACK: "B",
  5476. reverse: {},
  5477. opposite: function(e) {
  5478. return this.reverse[e.toString()]
  5479. }
  5480. };
  5481. !function() {
  5482. n.reverse[n.UP] = n.DOWN,
  5483. n.reverse[n.DOWN] = n.UP,
  5484. n.reverse[n.LEFT] = n.RIGHT,
  5485. n.reverse[n.RIGHT] = n.LEFT,
  5486. n.reverse[n.FORWARD] = n.BACK,
  5487. n.reverse[n.BACK] = n.FORWARD
  5488. }(),
  5489. t.exports = n
  5490. }
  5491. , {}],
  5492. 30: [function(e, t, i) {
  5493. "use strict";
  5494. var n = e("../util/browser")
  5495. , r = {
  5496. ZERO: 48,
  5497. ONE: 49,
  5498. TWO: 50,
  5499. THREE: 51,
  5500. FOUR: 52,
  5501. FIVE: 53,
  5502. SIX: 54,
  5503. SEVEN: 55,
  5504. EIGHT: 56,
  5505. NINE: 57,
  5506. LEFTARROW: 37,
  5507. UPARROW: 38,
  5508. RIGHTARROW: 39,
  5509. DOWNARROW: 40,
  5510. A: 65,
  5511. B: 66,
  5512. C: 67,
  5513. D: 68,
  5514. E: 69,
  5515. F: 70,
  5516. G: 71,
  5517. H: 72,
  5518. I: 73,
  5519. J: 74,
  5520. K: 75,
  5521. L: 76,
  5522. M: 77,
  5523. N: 78,
  5524. O: 79,
  5525. P: 80,
  5526. Q: 81,
  5527. R: 82,
  5528. S: 83,
  5529. T: 84,
  5530. U: 85,
  5531. V: 86,
  5532. W: 87,
  5533. X: 88,
  5534. Y: 89,
  5535. Z: 90,
  5536. SPACE: 32,
  5537. RETURN: 13,
  5538. SEMICOLON: 186,
  5539. PLUSEQUALS: 187,
  5540. DASHUNDERSCORE: 189,
  5541. OPENBRACKET: 219
  5542. };
  5543. n.detectFirefox() && (r.SEMICOLON = 59,
  5544. r.PLUSEQUALS = 61,
  5545. r.DASHUNDERSCORE = 173),
  5546. t.exports = r
  5547. }
  5548. , {
  5549. "../util/browser": 182
  5550. }],
  5551. 31: [function(e, t, i) {
  5552. "use strict";
  5553. t.exports = {
  5554. EN_US: "en-US",
  5555. ES_MX: "es-MX",
  5556. FR_FR: "fr-FR",
  5557. DE_DE: "de-DE",
  5558. RU_RU: "ru-RU",
  5559. CN_CN: "cn-CN",
  5560. JP_JP: "jp-JP"
  5561. }
  5562. }
  5563. , {}],
  5564. 32: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. TagActivated: "tag.activated",
  5568. TagDismissed: "tag.dismissed",
  5569. TagNavigation: "tag.navigation"
  5570. }
  5571. }
  5572. , {}],
  5573. 33: [function(e, t, i) {
  5574. "use strict";
  5575. t.exports = {
  5576. ModelAdded: "model-added",
  5577. ActiveModelChanged: "active-model-changed"
  5578. }
  5579. }
  5580. , {}],
  5581. 34: [function(e, t, i) {
  5582. "use strict";
  5583. t.exports = {
  5584. LEFT: 0,
  5585. MIDDLE: 1,
  5586. RIGHT: 2
  5587. }
  5588. }
  5589. , {}],
  5590. 35: [function(e, t, i) {
  5591. "use strict";
  5592. t.exports = {
  5593. PanoRenderComplete: "panorama.render.complete",
  5594. TileRenderFailure: "panorama.tile.render.failed",
  5595. TileRenderSuccess: "panorama.tile.render.success",
  5596. TileUploadAttempted: "panorama.tile.upload.attempted",
  5597. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5598. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5599. }
  5600. }
  5601. , {}],
  5602. 36: [function(e, t, i) {
  5603. "use strict";
  5604. t.exports = {
  5605. BASE: 1,
  5606. STANDARD: 2,
  5607. HIGH: 3,
  5608. ULTRAHIGH: 4
  5609. }
  5610. }
  5611. , {}],
  5612. 37: [function(e, t, i) {
  5613. "use strict";
  5614. t.exports = {
  5615. LoadComplete: "panorama.load.complete",
  5616. LoadFailed: "panorama.load.failed",
  5617. TileLoaded: "panorama.tile.loaded"
  5618. }
  5619. }
  5620. , {}],
  5621. 38: [function(e, t, i) {
  5622. "use strict";
  5623. t.exports = Object.freeze({
  5624. Standard: 0,
  5625. Slow: 1,
  5626. Retain: 2
  5627. })
  5628. }
  5629. , {}],
  5630. 39: [function(e, t, i) {
  5631. "use strict";
  5632. t.exports = Object.freeze({
  5633. Show: 0,
  5634. Hide: 1,
  5635. Retain: 2
  5636. })
  5637. }
  5638. , {}],
  5639. 40: [function(e, t, i) {
  5640. "use strict";
  5641. t.exports = {
  5642. Move: "move",
  5643. MoveComplete: "move.complete",
  5644. ModeChanged: "mode.changed",
  5645. ModeChanging: "mode.changing",
  5646. PanoChosen: "pano.chosen",
  5647. ClosestPanoChanging: "closest.pano.changing",
  5648. WarpStarted: "warp.started",
  5649. WarpInterrupted: "warp.interrupted",
  5650. WarpEnded: "warp.ended",
  5651. FlyinFinished: "flyin.finished",
  5652. FlyingStarted: "flying.started",
  5653. FlyingInterrupted: "flying.interrupted",
  5654. FlyingEnded: "flying.ended",
  5655. Ready: "ready",
  5656. StartInside: "start.inside",
  5657. StartOutside: "start.outside",
  5658. ViewChanged: "view.changed",
  5659. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5660. InputStart: "input.start"
  5661. }
  5662. }
  5663. , {}],
  5664. 41: [function(e, t, i) {
  5665. "use strict";
  5666. t.exports = Object.freeze({
  5667. DEFAULT: 0,
  5668. PANOMARKERS: 1,
  5669. RETICULE: 2,
  5670. TAG: 3
  5671. })
  5672. }
  5673. , {}],
  5674. 42: [function(e, t, i) {
  5675. "use strict";
  5676. t.exports = {
  5677. visibleFloor: 1,
  5678. ghostFloor: 3,
  5679. boundingSkybox: 1,
  5680. panoMarker: 2,
  5681. reticule: 3,
  5682. tagStem: 4,
  5683. tagDisc: 5,
  5684. ribbon: 100
  5685. }
  5686. }
  5687. , {}],
  5688. 43: [function(e, t, i) {
  5689. "use strict";
  5690. t.exports = {
  5691. ContextCreated: "scene-renderer-context-created",
  5692. AfterRender: "after-render",
  5693. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5694. }
  5695. }
  5696. , {}],
  5697. 44: [function(e, t, i) {
  5698. "use strict";
  5699. t.exports = {
  5700. IDLE: "idle",
  5701. BROWSE: "browse",
  5702. EXAMINE: "examine"
  5703. }
  5704. }
  5705. , {}],
  5706. 45: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. TileDownloadSuccess: "tiledownloader.download.success",
  5710. TileDownloadFailure: "tiledownloader.download.failure",
  5711. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5712. }
  5713. }
  5714. , {}],
  5715. 46: [function(e, t, i) {
  5716. "use strict";
  5717. t.exports = {
  5718. CardboardAndroid: "googlevr",
  5719. GearVR: "gearvr",
  5720. CardboardIOS: "googlevrios",
  5721. Cardboard: "googlevr"
  5722. }
  5723. }
  5724. , {}],
  5725. 47: [function(e, t, i) {
  5726. "use strict";
  5727. t.exports = {
  5728. NONE: 0,
  5729. CONTEXTUAL: 1,
  5730. ANDROID: 2
  5731. }
  5732. }
  5733. , {}],
  5734. 48: [function(e, t, i) {
  5735. "use strict";
  5736. var n = {
  5737. Title: 0,
  5738. Cardboard: 1
  5739. }
  5740. , r = {
  5741. Title: 0,
  5742. Cardboard: 1,
  5743. Gear: 2
  5744. };
  5745. !function() {
  5746. [n, r].forEach(function(e) {
  5747. e.pageCount = Object.keys(e).length
  5748. })
  5749. }(),
  5750. t.exports.ios = n,
  5751. t.exports.standard = r
  5752. }
  5753. , {}],
  5754. 49: [function(e, t, i) {
  5755. "use strict";
  5756. t.exports = {
  5757. Android: "android",
  5758. IOS: "ios",
  5759. Desktop: "desktop",
  5760. UnsupportedAndroid: "android-unsupported"
  5761. }
  5762. }
  5763. , {}],
  5764. 50: [function(e, t, i) {
  5765. "use strict";
  5766. var n = e("three");
  5767. t.exports = {
  5768. UP: new n.Vector3(0,1,0),
  5769. DOWN: new n.Vector3(0,-1,0),
  5770. LEFT: new n.Vector3(-1,0,0),
  5771. RIGHT: new n.Vector3(1,0,0),
  5772. FORWARD: new n.Vector3(0,0,-1),
  5773. BACK: new n.Vector3(0,0,1)
  5774. }
  5775. }
  5776. , {
  5777. three: 217
  5778. }],
  5779. 51: [function(e, t, i) {
  5780. "use strict";
  5781. var n = e("../exception/ViewmodeConvertException")
  5782. , r = e("./coreViewmodes")
  5783. , o = e("../util/common")
  5784. , a = {
  5785. MESH: "mesh",
  5786. OUTDOOR: "outdoor",
  5787. TRANSITIONING: "transitioning",
  5788. toInt: function(e) {
  5789. switch (e) {
  5790. case this.PANORAMA:
  5791. return 1;
  5792. case this.DOLLHOUSE:
  5793. return 2;
  5794. case this.FLOORPLAN:
  5795. return 3;
  5796. case this.OUTDOOR:
  5797. return 4;
  5798. case this.TRANSITIONING:
  5799. return -1
  5800. }
  5801. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5802. },
  5803. fromInt: function(e) {
  5804. switch (e) {
  5805. case "1":
  5806. case 1:
  5807. return this.PANORAMA;
  5808. case "2":
  5809. case 2:
  5810. return this.DOLLHOUSE;
  5811. case "3":
  5812. case 3:
  5813. return this.FLOORPLAN;
  5814. case "4":
  5815. case 4:
  5816. return this.OUTDOOR
  5817. }
  5818. throw new n("No known conversion for int to viewmode for int: " + e)
  5819. },
  5820. convertWorkshopModeInt: function(e) {
  5821. switch (e) {
  5822. case "0":
  5823. case 0:
  5824. case undefined: //xzw add
  5825. return this.PANORAMA;
  5826. case "1":
  5827. case 1:
  5828. return this.FLOORPLAN;
  5829. case "2":
  5830. case 2:
  5831. return this.DOLLHOUSE;
  5832. case "3":
  5833. case 3:
  5834. return this.MESH
  5835. }
  5836. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5837. }
  5838. };
  5839. o.extendObject(a, r),
  5840. t.exports = a
  5841. }
  5842. , {
  5843. "../exception/ViewmodeConvertException": 58,
  5844. "../util/common": 185,
  5845. "./coreViewmodes": 54
  5846. }],
  5847. 52: [function(e, t, i) {
  5848. "use strict";
  5849. t.exports = {
  5850. BLACK: "black",
  5851. STD: "std",
  5852. WALK: "walk"
  5853. }
  5854. }
  5855. , {}],
  5856. 53: [function(e, t, i) {
  5857. "use strict";
  5858. t.exports = {
  5859. ZoomIn: "zoom.in",
  5860. ZoomOut: "zoom.out",
  5861. ZoomMax: "zoom.max",
  5862. ZoomMin: "zoom.min"
  5863. }
  5864. }
  5865. , {}],
  5866. 54: [function(e, t, i) {
  5867. "use strict";
  5868. t.exports = {
  5869. PANORAMA: "panorama",
  5870. DOLLHOUSE: "dollhouse",
  5871. FLOORPLAN: "floorplan"
  5872. }
  5873. }
  5874. , {}],
  5875. 55: [function(e, t, i) {
  5876. "use strict";
  5877. function n(e) {
  5878. this.message = e
  5879. }
  5880. t.exports = n
  5881. }
  5882. , {}],
  5883. 56: [function(e, t, i) {
  5884. "use strict";
  5885. function n(e) {
  5886. r.call(this, e)
  5887. }
  5888. var r = e("./BasicException");
  5889. n.prototype = Object.create(r.prototype),
  5890. t.exports = n
  5891. }
  5892. , {
  5893. "./BasicException": 55
  5894. }],
  5895. 57: [function(e, t, i) {
  5896. "use strict";
  5897. function n(e) {
  5898. r.call(this, e)
  5899. }
  5900. var r = e("./BasicException");
  5901. n.prototype = Object.create(r.prototype),
  5902. t.exports = n
  5903. }
  5904. , {
  5905. "./BasicException": 55
  5906. }],
  5907. 58: [function(e, t, i) {
  5908. "use strict";
  5909. function n(e) {
  5910. r.call(this, e)
  5911. }
  5912. var r = e("./BasicException");
  5913. n.prototype = Object.create(r.prototype),
  5914. t.exports = n
  5915. }
  5916. , {
  5917. "./BasicException": 55
  5918. }],
  5919. 59: [function(e, t, i) {
  5920. (function(i) {
  5921. "use strict";
  5922. function n(e) {
  5923. var t = {};
  5924. if (e) {
  5925. var i = e.flags;
  5926. if (i)
  5927. for (var n in i)
  5928. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5929. return t
  5930. }
  5931. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5932. null
  5933. }
  5934. var r = e("./util/ajax")
  5935. , o = e("./util/showcase")
  5936. , a = e("./util/logger")
  5937. , s = ""
  5938. , l = new a(i)
  5939. , c = {};
  5940. t.exports = {
  5941. loadFeatureFlags: function(e) {
  5942. var t = $.Deferred();
  5943. return r.get(e.urlBase + s, {
  5944. responseType: "json",
  5945. prefetchFrom: "user",
  5946. auth: o.getAuthorizationHeader()
  5947. }).done(function(e) {
  5948. c = n(e),
  5949. c ? t.resolve(c) : t.reject("loading-failed")
  5950. }).fail(function() {
  5951. l.debug("Retrieval of feature flags failed."),
  5952. t.reject("loading-failed")
  5953. }),
  5954. t.promise()
  5955. },
  5956. getFlags: function() {
  5957. return c
  5958. },
  5959. updateDependentSettings: function(e, t) {
  5960. e = e || c,
  5961. e.labels && (t.labels.enabled = !0),
  5962. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5963. e.showcase_sdk && (t.sdkInit = !0),
  5964. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5965. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5966. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5967. e.hide_sc_sharing && (t.share.enabled = !1)
  5968. }
  5969. }
  5970. }
  5971. ).call(this, "/js/featureflags.js")
  5972. }
  5973. , {
  5974. "./util/ajax": 181,
  5975. "./util/logger": 189,
  5976. "./util/showcase": 193
  5977. }],
  5978. 60: [function(e, t, i) {
  5979. "use strict";
  5980. var n = (e("../util/common"),
  5981. {
  5982. status: 0,
  5983. set: function(e) {
  5984. if (isNaN(e))
  5985. return !1;
  5986. var t = $('.progressbar');
  5987. 0 > e && (e = 0);
  5988. e > 100 && (e = 100);
  5989. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5990. var barperc = e*width;
  5991. var perc = Math.round(e);
  5992. var labelpos = (parseInt(barperc)-15);
  5993. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5994. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5995. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5996. this.status = e
  5997. },
  5998. done: function(e) {
  5999. return e || this.status ? (this.status = null,
  6000. this.set(100)) : this
  6001. }
  6002. });
  6003. t.exports.circleLoader = n
  6004. }
  6005. , {
  6006. "../util/common": 185
  6007. }],
  6008. 61: [function(e, t, i) {
  6009. "use strict";
  6010. t.exports = Object.freeze({
  6011. CLOSE: "modal.closer.close"
  6012. })
  6013. }
  6014. , {}],
  6015. 62: [function(e, t, i) {
  6016. "use strict";
  6017. function n(e, t) {
  6018. t && (t.stopPropagation(),
  6019. t.preventDefault()),
  6020. e && this.emit(l.CLOSE, e),
  6021. g.reset()
  6022. }
  6023. function r(e, t) {
  6024. function i() {
  6025. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  6026. t !== f && (f = t,
  6027. t ? (e.classList.add("closeByFooter"),
  6028. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  6029. h.classList.remove("closeByFooter")))
  6030. }
  6031. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6032. }
  6033. var o = e("../../settings")
  6034. , a = (e("../../tag/Media/MediaEvent"),
  6035. e("../../util/browser"))
  6036. , s = e("../../util/common")
  6037. , l = e("./ModalCloserEvent")
  6038. , c = e("events").EventEmitter
  6039. , h = document.getElementsByClassName("footer")[0]
  6040. , u = h.querySelectorAll(".close")[0]
  6041. , d = null
  6042. , p = null
  6043. , f = null
  6044. , g = (a.isMobile(),
  6045. {
  6046. open: function(e) {
  6047. e && (r(e),
  6048. d && u.removeEventListener("click", d, !0),
  6049. d = n.bind(this, e.id),
  6050. u.addEventListener("click", d, !0),
  6051. p && window.removeEventListener("resize", p, !0),
  6052. p = r.bind(this, e),
  6053. window.addEventListener("resize", p, !0))
  6054. },
  6055. reset: function() {
  6056. h.classList.remove("closeByFooter"),
  6057. u.removeEventListener("click", d, !0),
  6058. window.removeEventListener("resize", p, !0),
  6059. d = p = f = null
  6060. }
  6061. });
  6062. s.extendObject(g, c.prototype),
  6063. t.exports = g
  6064. }
  6065. , {
  6066. "../../tag/Media/MediaEvent": 131,
  6067. "../../settings": 166,
  6068. "../../util/browser": 182,
  6069. "../../util/common": 185,
  6070. "./ModalCloserEvent": 61,
  6071. events: 202
  6072. }],
  6073. 63: [function(e, t, i) {
  6074. "use strict";
  6075. function n(e, t, i) {
  6076. var n = new r.GUI({
  6077. width: 400
  6078. })
  6079. , u = n.addFolder("Flydown from Dollhouse");
  6080. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6081. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6082. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6083. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6084. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6085. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6086. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6087. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6088. var d = n.addFolder("Transition between panos");
  6089. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6090. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6091. h.transition.flyTime = 0,
  6092. d.__controllers.forEach(function(e) {
  6093. e.updateDisplay()
  6094. })
  6095. }),
  6096. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6097. h.transition.flySpeed = 0,
  6098. d.__controllers.forEach(function(e) {
  6099. e.updateDisplay()
  6100. })
  6101. }),
  6102. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6103. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6104. d.add(h.transition, "movementEasing", Object.keys(a));
  6105. var p = n.addFolder("Path Display");
  6106. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6107. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6108. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6109. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6110. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6111. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6112. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6113. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6114. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6115. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6116. h.path.color = l[h.path.color],
  6117. h.path.colorUp = l._desat(h.path.color),
  6118. h.path.colorDown = l.darken(h.path.color)
  6119. }),
  6120. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6121. h.reticuleColor = l[h.reticuleColor]
  6122. });
  6123. var f = n.addFolder("Warping")
  6124. , g = f.addFolder("Warp/Teleport");
  6125. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6126. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6127. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6128. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6129. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6130. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6131. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6132. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6133. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6134. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6135. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6136. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6137. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6138. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6139. h.path.typ = c[h.path.typ]
  6140. }),
  6141. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6142. t.endlessLoop = h.warp.loop
  6143. }),
  6144. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6145. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6146. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6147. var m = f.addFolder("Long Warp Only");
  6148. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6149. h.warp.flySpeed = 0,
  6150. m.__controllers.forEach(function(e) {
  6151. e.updateDisplay()
  6152. })
  6153. }),
  6154. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6155. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6156. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6157. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6158. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6159. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6160. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6161. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6162. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6163. var v = n.addFolder("Warp Esoterica");
  6164. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6165. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6166. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6167. h.warp.minWarpTime = 0,
  6168. v.__controllers.forEach(function(e) {
  6169. e.updateDisplay()
  6170. })
  6171. }),
  6172. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6173. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6174. v.add(h.warp, "movementEasing", Object.keys(a));
  6175. var A = n.addFolder("Misc");
  6176. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6177. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6178. }),
  6179. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6180. i.cameras[s.PANORAMA].fov = h.insideFOV
  6181. }),
  6182. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6183. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6184. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6185. var y = n.addFolder("Navigation");
  6186. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6187. h.navigation.panoScores || e.panos.forEach(function(e) {
  6188. e.floor.remove(e.text3d),
  6189. e.text3d = null
  6190. })
  6191. }),
  6192. y.add(h.navigation, "mouseDirection"),
  6193. y.add(h.navigation, "filterStrictness", 0, 1),
  6194. y.add(h.navigation, "angleFactor", -60, 0),
  6195. y.add(h.navigation, "directionFactor", 1, 20),
  6196. y.add(h.navigation, "distanceFactor", -5, 5),
  6197. y.add(h.navigation, "optionalityFactor", .1, 10);
  6198. var C = n.addFolder("tags")
  6199. , I = C.addFolder("Tag Creation");
  6200. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6201. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6202. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6203. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6204. var E = C.addFolder("Visibility");
  6205. E.add(h.tags.visibility, "anyDistance"),
  6206. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6207. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6208. E.add(h.tags.visibility, "hideViaFloor"),
  6209. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6210. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6211. var b = C.addFolder("Disc Parameters");
  6212. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6213. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6214. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6215. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6216. }),
  6217. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6218. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6219. }),
  6220. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6221. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6222. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6223. var w = C.addFolder("Navigate");
  6224. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6225. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6226. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6227. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6228. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6229. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6230. var _ = n.addFolder("Debug");
  6231. _.add(h, "wireframe").onFinishChange(function() {
  6232. e.chunks.forEach(function(t) {
  6233. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6234. t.wireframeTwin.material.depthWrite = !1,
  6235. t.wireframeTwin.material.depthTest = !1,
  6236. t.wireframeTwin.material.opacity = .5,
  6237. t.wireframeTwin.material.transparent = !0),
  6238. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6239. })
  6240. }),
  6241. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6242. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6243. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6244. e.skybox.wireframe = null)
  6245. }),
  6246. _.add(h, "showSweeps").onFinishChange(function() {
  6247. e.setSweepVisibility(h.showSweeps)
  6248. }),
  6249. _.add(h, "showMesh").onFinishChange(function() {
  6250. e.chunks.forEach(function(e) {
  6251. e.visible = h.showMesh
  6252. })
  6253. }),
  6254. _.add(h, "showFloors").onFinishChange(function() {
  6255. e.floors.forEach(function(e) {
  6256. e.collider.children.forEach(function(e) {
  6257. e.material.visible = h.showFloors
  6258. })
  6259. })
  6260. }),
  6261. _.add(h, "showSkyboxes").onFinishChange(function() {
  6262. e.panos.forEach(function(e) {
  6263. e.skyboxMesh.visible = h.showSkyboxes
  6264. })
  6265. }),
  6266. _.add(h, "showNeighbors").onChange(function() {}),
  6267. _.add(e, "alpha", 0, 1)
  6268. }
  6269. var r = e("../lib/dat.gui")
  6270. , o = e("three")
  6271. , a = e("../util/easing")
  6272. , s = e("../enum/Viewmode")
  6273. , l = e("../enum/Colors")
  6274. , c = e("../enum/WarpStyle")
  6275. , h = e("../settings");
  6276. e("../tag/tag");
  6277. r.GUI.prototype.removeFolder = function(e) {
  6278. var t = this.__folders[e];
  6279. t && (t.close(),
  6280. this.__ul.removeChild(t.domElement.parentNode),
  6281. delete this.__folders[e],
  6282. this.onResize())
  6283. }
  6284. ,
  6285. t.exports.toggle = n
  6286. }
  6287. , {
  6288. "../enum/Colors": 19,
  6289. "../enum/Viewmode": 51,
  6290. "../enum/WarpStyle": 52,
  6291. "../lib/dat.gui": 93,
  6292. "../tag/tag": 123,
  6293. "../settings": 166,
  6294. "../util/easing": 186,
  6295. three: 217
  6296. }],
  6297. 64: [function(e, t, i) {
  6298. (function(i) {
  6299. "use strict";
  6300. function n(e, t, i, n) {
  6301. $(".gui-error .error-problem-text").text(e),
  6302. $(".gui-error .error-solution-text").text(t),
  6303. $(".gui-error .error-explanation").text(i),
  6304. $(".gui-error .error-actions").html(n),
  6305. $(window).resize(),
  6306. $(".gui-error").fadeIn(),
  6307. $("#bottom-logo").fadeIn()
  6308. }
  6309. function r(e) {
  6310. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="static/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="static/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="static/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="static/images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  6311. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6312. s.isMobile() || $("[rel=tiletip]").tooltip({
  6313. placement: "bottom",
  6314. delay: {
  6315. show: 50,
  6316. hide: 0
  6317. },
  6318. trigger: "hover",
  6319. viewport: {
  6320. selector: "body",
  6321. padding: 10
  6322. }
  6323. })
  6324. }
  6325. function o() {
  6326. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6327. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6328. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6329. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6330. e.preventDefault(),
  6331. e.stopPropagation(),
  6332. r(" ")
  6333. })
  6334. }
  6335. function a(e) {
  6336. if ($("head title").text(c.pageTitle),
  6337. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6338. $("#gui-loading").fadeOut(250),
  6339. $("#quick-blackout").hide(),
  6340. l.track("showcase_error", {
  6341. error_key: e
  6342. }),
  6343. h.locale || h.init(),
  6344. "webgl-unsupported" === e)
  6345. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6346. else if ("webgl-ios" === e)
  6347. 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>.");
  6348. else if ("webgl-safari" === e)
  6349. 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>.");
  6350. else if ("webgl-generic" === e)
  6351. o();
  6352. else if ("missing-urls" === e)
  6353. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6354. else if ("loading-failed" === e)
  6355. 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>.");
  6356. else {
  6357. if ("loading-failed-maintenance" !== e)
  6358. return void d.error("Unhandled error: " + e);
  6359. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6360. }
  6361. }
  6362. var s = e("./../util/browser")
  6363. , l = e("./../analytics")
  6364. , c = e("./../settings")
  6365. , h = e("../localization/localize")
  6366. , u = e("./../util/logger")
  6367. , d = new u(i)
  6368. , p = '"https://support.port.com/hc/articles/208220058"';
  6369. t.exports.error = a
  6370. }
  6371. ).call(this, "/js/gui/error.js")
  6372. }
  6373. , {
  6374. "../localization/localize": 108,
  6375. "./../analytics": 4,
  6376. "./../settings": 166,
  6377. "./../util/browser": 182,
  6378. "./../util/logger": 189
  6379. }],
  6380. 65: [function(e, t, i) {
  6381. (function(i) {
  6382. "use strict";
  6383. function n() {
  6384. Ue = [],
  6385. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6386. Ue.push(".hideTarget", ".pinTop.right")
  6387. }
  6388. function r() {
  6389. for (var e in je)
  6390. if (je.hasOwnProperty(e)) {
  6391. var t = je[e];
  6392. if (!t.visible)
  6393. for (var i = 0; i < t.elements.length; i++)
  6394. $(t.elements[i]).hide()
  6395. }
  6396. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6397. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6398. n()
  6399. }
  6400. function o(e, t) {
  6401. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6402. $("#gui-zoomin").toggle(i),
  6403. $("#gui-zoomout").toggle(i)
  6404. }
  6405. function a() {
  6406. return
  6407. //导览抽屉在刚加载时先出来一下 又收回去
  6408. c(),
  6409. $(".pinBottom").toggleClass("open"),
  6410. $("#drawer").toggleClass("open"),
  6411. $(".footer").toggleClass("open"),
  6412. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6413. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6414. ie.resetDrawer()),
  6415. setTimeout(function() {
  6416. $("#pullTab").toggleClass("opened");
  6417. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6418. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6419. }
  6420. function s(e) {
  6421. var t;
  6422. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6423. t = e.position().top + e.outerHeight(),
  6424. e.attr("style", "display: none"));
  6425. var i = $("#player").outerHeight()
  6426. , n = i - 130;
  6427. return n < t + 25
  6428. }
  6429. function l(e) {
  6430. "touchstart" === e.type && e.preventDefault(),
  6431. e.stopPropagation()
  6432. }
  6433. function c() {
  6434. W && (W.reload(),
  6435. W.init())
  6436. }
  6437. function h(e) {
  6438. ne.show(e),
  6439. r()
  6440. }
  6441. function u(e) {
  6442. ne.progress(e)
  6443. }
  6444. function d(e, t, i) {
  6445. var n = t.player;
  6446. $("#gui-thumb").fadeOut(2500),
  6447. ne.hide(function() {
  6448. Ge = !1
  6449. }),
  6450. me.init(e, i),
  6451. de.finishSetup(Object.keys(e.tags).length),
  6452. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6453. var s = function() {
  6454. i.dismissExaminedTag(),
  6455. i.disableHovering()
  6456. };
  6457. Ae.on(ye.OPENED, s),
  6458. Ce.on(Me.OPENED, s),
  6459. he.on(ue.OPENED, s),
  6460. fe.on(ge.OPENED, s);
  6461. var l = i.enableHovering.bind(i);
  6462. if (Ae.on(ye.CLOSED, l),
  6463. Ce.on(Me.CLOSED, l),
  6464. he.on(ue.CLOSED, l),
  6465. fe.on(ge.CLOSED, l),
  6466. Q.labels.enabled && Object.keys(e.labels).length,
  6467. (!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6468. C(e.currentFloor, n.mode)),
  6469. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6470. r(),
  6471. o(t, t.player),
  6472. $("#gui").fadeIn(1500),
  6473. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6474. a(),
  6475. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6476. }, 2e3),
  6477. !K.isMobile())
  6478. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6479. $(c[h]).addClass("hasHover");
  6480. O(e),
  6481. de.setupToggling();
  6482. //xzw:
  6483. window.editHotPanel && editHotPanel();
  6484. //czj
  6485. navBorderRadius(e);
  6486. //czj 编辑界面
  6487. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6488. window.EditTools && new EditTools(n.sceneRenderer);
  6489. }
  6490. function navBorderRadius(e){
  6491. var pullTab = $("#pullTab"),
  6492. mobileRadius = {
  6493. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6494. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6495. },
  6496. topRadius = {
  6497. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6498. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6499. };
  6500. function BorderRadius(bottom,top){
  6501. $("#gui-modes-map > div:visible:last").css(bottom);
  6502. if(pullTab.is(':visible')){
  6503. $(".viewContainer > div:visible:first").css(top);
  6504. }else{
  6505. $("#gui-modes-map > div:visible:first").css(top);
  6506. }
  6507. }
  6508. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6509. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6510. }else{
  6511. BorderRadius(topRadius.bottom,topRadius.top);
  6512. }
  6513. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6514. if(window.DATA.model.special || window.DATA.special){
  6515. window.specialScene && specialScene.special().afterImplement();
  6516. }
  6517. }
  6518. function p(e) {
  6519. e || (e = 0),
  6520. We = !1,
  6521. window.setTimeout(function() {
  6522. We || (ze = !0,
  6523. $("#gui-spinner").stop(!0, !0).show())
  6524. }
  6525. .bind(this), e)
  6526. }
  6527. function f() {
  6528. $("#gui-spinner").stop(!0, !0),
  6529. $("#gui-spinner").fadeOut(1e3),
  6530. We = !0,
  6531. ze = !1
  6532. }
  6533. function g(e, t) {
  6534. var i = e.mode
  6535. , n = t || e.currentPano;
  6536. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6537. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6538. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6539. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6540. Q.show360Views.enabled && !n.isAligned() ? (
  6541. $(".gui-floor").addClass("hidden"),
  6542. $("#gui-modes-outside").addClass("desktop-only")) : (
  6543. $(".gui-floor").removeClass("hidden"),
  6544. $("#gui-modes-outside").removeClass("desktop-only")),
  6545. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6546. Be = i,
  6547. $("#gui-modes-outside").addClass("hidden"),
  6548. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6549. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6550. }
  6551. function m(e, t) {
  6552. var i = t.player;
  6553. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6554. l(e),
  6555. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6556. J.track("USER", {
  6557. event_type: "showcase_gui",
  6558. gui_action: "click_inside_mode_button"
  6559. }),
  6560. t.changeMode(_e.PANORAMA);
  6561. }),
  6562. $("#gui-modes-outside").find("a").on("click", function(e) {
  6563. l(e),
  6564. J.track("showcase_gui", {
  6565. gui_action: "click_outside_mode_button"
  6566. }),
  6567. t.changeMode(Be)
  6568. }),
  6569. $("#gui-modes-floorplan").on("click", function(e) {
  6570. settings.tourSoundUnable || SoundManager.pause('tour')
  6571. l(e),
  6572. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6573. gui_action: "click_floorplan_mode_button"
  6574. }),
  6575. t.changeMode(_e.FLOORPLAN));
  6576. }),
  6577. $("#gui-modes-dollhouse").on("click", function(e) {
  6578. settings.tourSoundUnable || SoundManager.pause('tour')
  6579. l(e),
  6580. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6581. gui_action: "click_dollhouse_mode_button"
  6582. }),
  6583. t.changeMode(_e.DOLLHOUSE));
  6584. })
  6585. $("#gui-modes-inside").on("click", function() {
  6586. settings.tourSoundUnable || SoundManager.pause('tour')
  6587. })
  6588. }
  6589. function v(e, t) {
  6590. function i() {
  6591. document.getElementById("vr").classList.remove("hidden"),
  6592. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6593. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6594. $(".improper-embed").toggleClass("hidden", !1),
  6595. r())
  6596. }, function(e) {
  6597. r()
  6598. }) : r()
  6599. }
  6600. function n(i) {
  6601. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6602. Ie.init(e.data, t, i, q),
  6603. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6604. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6605. }
  6606. function r() {
  6607. De.info("WebVR support not found, VR button activates native app VR modal"),
  6608. Ae.init(e.data, q),
  6609. Ae.on(ye.OPENED, function() {
  6610. var e = document.getElementById("vr-modal");
  6611. return function() {
  6612. Ze("vr"),
  6613. le.open(e)
  6614. }
  6615. }()),
  6616. Ae.on(ye.CLOSED, le.reset)
  6617. }
  6618. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6619. /*********************** 方奕卓 VR功能事件监听 ********************/
  6620. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6621. switch (Q.vr.option) {
  6622. case Pe.CONTEXTUAL:
  6623. i();
  6624. break;
  6625. case Pe.ANDROID:
  6626. K.detectAndroid() && i();
  6627. break;
  6628. case Pe.NONE:
  6629. }
  6630. }
  6631. }
  6632. function A(e, t) {
  6633. $("#play").on("mousedown touchstart", function(e) {
  6634. l(e);
  6635. Ze("tour");
  6636. ve.play();
  6637. J.trackAlways("showcase_gui", {
  6638. gui_action: "play_highlights"
  6639. })
  6640. }),
  6641. window.startAndPlay = function(e) {
  6642. // l(e);
  6643. Ze("tour");
  6644. ve.play();
  6645. J.trackAlways("showcase_gui", {
  6646. gui_action: "play_highlights"
  6647. })
  6648. };
  6649. $("#pause").on("mousedown touchstart", function(e) {
  6650. l(e),
  6651. ve.pause(),
  6652. J.trackAlways("showcase_gui", {
  6653. gui_action: "pause_highlights"
  6654. })
  6655. }),
  6656. $("#gui-zoomin").find("a").on("click", function(e) {
  6657. l(e),
  6658. t.player.zoomInIncrementally()
  6659. }),
  6660. $("#gui-zoomout").find("a").on("click", function(e) {
  6661. l(e),
  6662. t.player.zoomOutIncrementally()
  6663. })
  6664. }
  6665. function y(e, t) {
  6666. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6667. if(getQueryVariable('m') === '372') continue;
  6668. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6669. $(".gui-floor").find(".container").prepend(r)
  6670. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6671. }
  6672. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6673. i.on("click", function(e) {
  6674. l(e),
  6675. Ze("floor"),
  6676. i.toggleClass("open")
  6677. }),
  6678. $(".floorChoice").on("click", function(e) {
  6679. l(e);
  6680. var n = $(this).data("index");
  6681. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6682. t.player.gotoFloor(n),
  6683. J.track("showcase_gui", {
  6684. gui_action: "click_floor_select_button",
  6685. interaction_source: "gui"
  6686. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6687. Ze("move"),
  6688. t.allFloors(),
  6689. J.track("showcase_gui", {
  6690. gui_action: "click_toggle_all_floors_button",
  6691. interaction_source: "gui"
  6692. })),
  6693. i.removeClass("open")
  6694. })
  6695. }
  6696. function C(e, t) {
  6697. 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()),
  6698. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6699. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6700. $(".floorChoice").removeClass("active"),
  6701. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6702. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6703. $(".floorChoice").removeClass("active"),
  6704. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6705. }
  6706. function I(e) {
  6707. return e.describe().inTransition
  6708. }
  6709. function b(e, t, i) {
  6710. Fe = e.heroLocations.length;
  6711. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6712. , r = 100 / Fe + "%"
  6713. , o = $("#thumb-container")
  6714. , a = $("#progressBar");
  6715. $("#status").find(".totalSteps").text(Fe);
  6716. for (var s = 0; s < Fe; s++) {
  6717. var c = e.heroLocations[s]
  6718. , h = $(n);
  6719. var thumbUrl
  6720. if(c.heroLocations){//有子项,选第一张截图
  6721. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6722. }else{
  6723. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6724. }
  6725. h.attr("data-index", s)
  6726. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6727. if (c.name) {
  6728. var u = $('<div class="overlay"></div>').text(c.name);
  6729. h.prepend(u)
  6730. }
  6731. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6732. var d = e.panos.get(c.panoId)
  6733. , p = d && !d.isAligned()
  6734. , f = p ? '<div><img class="mark360View" src="static/images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="static/images/mark-inside-white.png"></div>';
  6735. h.prepend(f)
  6736. }
  6737. o.append(h),
  6738. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6739. }
  6740. j = 144 * Fe,
  6741. Y = 111 * Fe,
  6742. $(".thumbImg").on("mouseover", function() {
  6743. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6744. }),
  6745. $(".thumbImg").on("mouseout", function() {
  6746. t.clearPath()
  6747. }),
  6748. $(".thumbImg").on("click", function(e) {
  6749. l(e);
  6750. var i = $(this);
  6751. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6752. J.trackAlways("showcase_gui", {
  6753. gui_action: "click_highlight"
  6754. }),
  6755. t.goToHighlight([i.data("index"),0])
  6756. //改
  6757. }),
  6758. // 手动触发 导览列表点击
  6759. $("#myClickBox #go").on('click',function(){
  6760. const imgActIndex = $(".thumbImg.active").data('index')
  6761. const curIndex = typeof imgActIndex === 'number' ? imgActIndex : -1;
  6762. const nextIndex = Number(curIndex) + 1;
  6763. if (nextIndex >= Fe) return
  6764. t.goToHighlight([nextIndex,0])
  6765. })
  6766. $("#myClickBox #back").on('click',function(){
  6767. const imgActIndex = $(".thumbImg.active").data('index')
  6768. const curIndex = typeof imgActIndex === 'number' ? imgActIndex : -1;
  6769. const nextIndex = Number(curIndex) - 1;
  6770. if (nextIndex < 0) return
  6771. t.goToHighlight([nextIndex,0])
  6772. })
  6773. $(".previous").find("a").on("click", function(e) {
  6774. l(e),
  6775. J.trackAlways("showcase_gui", {
  6776. gui_action: "prev_highlight"
  6777. }),
  6778. t.prevHighlight()
  6779. }),
  6780. $(".next").find("a").on("click", function(e) {
  6781. l(e),
  6782. J.trackAlways("showcase_gui", {
  6783. gui_action: "next_highlight"
  6784. }),
  6785. t.nextHighlight()
  6786. }),
  6787. $("#drawer").on("mouseleave", function(e) {
  6788. l(e);
  6789. var t;
  6790. try {
  6791. t = new MouseEvent("mouseup",{
  6792. clientX: e.clientX,
  6793. clientY: e.clientY,
  6794. screenX: e.screenX,
  6795. screenY: e.screenY
  6796. })
  6797. } catch (i) {
  6798. t = document.createEvent("MouseEvents"),
  6799. 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)
  6800. }
  6801. document.dispatchEvent(t)
  6802. }),
  6803. W = new Sly($("#scrollFrame"),{
  6804. horizontal: !0,
  6805. itemNav: "centered",
  6806. smart: !0,
  6807. scrollTrap: !0,
  6808. scrollBy: 1,
  6809. mouseDragging: !0,
  6810. touchDragging: !0,
  6811. speed: 300,
  6812. dragHandle: !0,
  6813. dynamicHandle: !0,
  6814. clickBar: !0,
  6815. scrollBar: $("#scroller"),
  6816. activateOn: null
  6817. }).init(),
  6818. W.on("active", function(e, t) {
  6819. Ve = t,
  6820. Ze("tour"),
  6821. $(".step").removeClass("active"),
  6822. $("#status").find(".curIdx").text(t + 1);
  6823. for (var i = 0; i <= t; i++)
  6824. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6825. }),
  6826. w()
  6827. }
  6828. function w() {
  6829. var e = $("#player").width() - 20
  6830. , t = $("#scroller")
  6831. , i = $("#drawer")
  6832. , n = $(".pinBottom");
  6833. if ($("#player").width() < 488 || $("#player").height() < 488)
  6834. t.addClass("hidden"),
  6835. i.addClass("noScroll"),
  6836. n.addClass("noScroll");
  6837. else {
  6838. var r = j > e
  6839. , o = !i.hasClass("noScroll")
  6840. , a = r !== o;
  6841. a && (t.toggleClass("hidden"),
  6842. i.toggleClass("noScroll"),
  6843. n.toggleClass("noScroll"))
  6844. }
  6845. }
  6846. function _(e) {
  6847. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6848. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6849. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6850. }
  6851. function T(e) {
  6852. function t(t, i) {
  6853. return !!e.player_options[t] && e[i || t]
  6854. }
  6855. $(".model-title").text(e.name);
  6856. var i = Q.pageTitle;
  6857. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6858. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6859. // document.title = i ,
  6860. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6861. delay: {
  6862. show: 50,
  6863. hide: 0
  6864. },
  6865. trigger: "hover",
  6866. html: !1,
  6867. viewport: {
  6868. selector: "body",
  6869. padding: 10
  6870. }
  6871. }),
  6872. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6873. // 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"),
  6874. de.populate({
  6875. name: t("model_name", "name"),
  6876. coBrand: t("presented_by"),
  6877. description: t("model_summary", "summary") || "暂无内容",
  6878. contactName: t("contact_name"),
  6879. address: t("address"),
  6880. phone: t("contact_phone"),
  6881. formattedPhone: e.formatted_contact_phone,
  6882. email: t("contact_email"),
  6883. url: t("external_url"),
  6884. socialSharing: e.enable_social_sharing && e.is_public
  6885. })
  6886. }
  6887. function x(e, t, i, n, r, o) {
  6888. function a() {
  6889. o.setLoadingStartTime(),
  6890. H(),
  6891. r ? (re.showMessage(t, i, je.coBrand.visible),
  6892. l()) : h(l)
  6893. }
  6894. var s = $.Deferred()
  6895. , l = s.resolve.bind(s);
  6896. return Ge = !0,
  6897. O(e),
  6898. e.data.player_options && _(e.data.player_options),
  6899. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6900. Re.localizeGUI(),
  6901. T(e.data),
  6902. r || $(".quick").addClass("hidden"),
  6903. //e.data.image && !r && E(e.data.image),
  6904. n ? (J.impression(),
  6905. a()) : (o.setWaitingStartTime(),
  6906. oe.show(r, a)),
  6907. s
  6908. }
  6909. function S(e, t, i, n, r, a, s) {
  6910. q = s,
  6911. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6912. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6913. ae.init(),
  6914. re.init(e, a),
  6915. Oe.init(e, t, n),
  6916. $(".icon").on("mouseover", function() {
  6917. t.player && t.player.reticule.hide()
  6918. }),
  6919. m(e, t),
  6920. A(e, t),
  6921. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6922. Ce.on(Me.OPENED, function() {
  6923. var e = document.getElementById("share-modal");
  6924. return function() {
  6925. Ze("share"),
  6926. le.open(e)
  6927. }
  6928. }()),
  6929. Ce.on(Me.CLOSED, le.reset)),
  6930. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6931. je.tourControls.visible = !1),
  6932. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6933. z(),
  6934. g(i),
  6935. v(e, r),
  6936. e.on("floor.changed", C),
  6937. e.on("waiting", R.bind(this, e)),
  6938. e.on("waiting-done", P.bind(this, e)),
  6939. i.on(xe.ModeChanged, function(e, n) {
  6940. g(i),
  6941. o(t, i),
  6942. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6943. he.updateMode(n)
  6944. }),
  6945. n.on(Se.Move, Ze.bind(this, "move")),
  6946. i.on(xe.Ready, function() {
  6947. ie.init(n, i, i.tagManager, t),
  6948. i.on(xe.ModeChanged, function(e, t) {
  6949. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6950. })
  6951. }),
  6952. i.on(xe.PanoChosen, function(e, t) {
  6953. g(i, t),
  6954. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6955. }),
  6956. le.on(ce.CLOSE, function(e) {
  6957. switch (e) {
  6958. case "vr-modal":
  6959. Ae.dismiss();
  6960. break;
  6961. case "share-modal":
  6962. Ce.hide();
  6963. break;
  6964. case "terms-modal":
  6965. fe.hide()
  6966. }
  6967. });
  6968. var l = $("#play").eq(0)
  6969. , c = $("#pause").eq(0)
  6970. , h = $(".pinBottom").toArray()
  6971. , u = $("#drawer").eq(0)
  6972. , d = $("#playHead").eq(0)
  6973. , p = $("#progressBar").eq(0)
  6974. , f = $("#thumb-container").eq(0)
  6975. , y = f.children()
  6976. , I = p.children();
  6977. t.on("update.controls", function() {//导览高亮item
  6978. return
  6979. var n = t.describe();
  6980. if(n.tourIsPlaying || i.isWarping()){
  6981. if(je.tourControls.visible){
  6982. l.hide() //play button
  6983. c.show() //pause button
  6984. //console.log('隐藏play')
  6985. }
  6986. if(n.tourInProgress){
  6987. h.forEach(function(e) {
  6988. e.classList.add("playing")
  6989. }),
  6990. u.addClass("playing"),
  6991. d.addClass("playing")
  6992. }
  6993. }else{
  6994. if(je.tourControls.visible){
  6995. l.show(),
  6996. c.hide()
  6997. //console.log('隐藏pause')
  6998. }
  6999. if(!n.tourInProgress){
  7000. ve.stopTour(),
  7001. h.forEach(function(e) {
  7002. e.classList.remove("playing")
  7003. }),
  7004. u.removeClass("playing"),
  7005. d.removeClass("playing")
  7006. }
  7007. }
  7008. var r, a, s;
  7009. if (null !== n.currentItem) {
  7010. var p, f;
  7011. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  7012. n.onTheBus ? (p = "active",
  7013. f = "recent") : (f = "active",
  7014. p = "recent");
  7015. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  7016. for (r = 0; r < e.heroLocations.length; r += 1)
  7017. s = y.eq(r),
  7018. a = I.eq(r),
  7019. s.removeClass(f),
  7020. a.removeClass(f),
  7021. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7022. a.addClass(p),
  7023. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7024. a.addClass(p)) : (s.removeClass(p),
  7025. a.removeClass(p))
  7026. } else
  7027. for (r = 0; r < e.heroLocations.length; r += 1)
  7028. s = y.eq(r),
  7029. a = I.eq(r),
  7030. s.removeClass("active recent"),
  7031. a.removeClass("active recent");
  7032. o(t, i)
  7033. }),
  7034. document.addEventListener("keydown", function(n) {
  7035. switch (J.updateInteraction(Se.InteractionKey),
  7036. n.which) {
  7037. case we.ZERO:
  7038. Q.debug && e.toggleAlpha();
  7039. break;
  7040. case we.NINE:
  7041. Q.debug && se.toggle();
  7042. break;
  7043. case we.ONE:
  7044. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7045. break;
  7046. case we.TWO:
  7047. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7048. break;
  7049. case we.THREE:
  7050. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7051. break;
  7052. case we.FOUR:
  7053. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7054. break;
  7055. case we.SPACE:
  7056. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7057. break;
  7058. case we.RETURN:
  7059. Q.debug && e.toggleExplodeUp();
  7060. break;
  7061. case we.P:
  7062. k();
  7063. break;
  7064. case we.U:
  7065. B();
  7066. break;
  7067. case we.X:
  7068. Q.debug && e.toggleExplode();
  7069. break;
  7070. case we.PLUSEQUALS:
  7071. t.player.activatePersistentZooming(!0),
  7072. ie.hideUi();
  7073. break;
  7074. case we.DASHUNDERSCORE:
  7075. t.player.activatePersistentZooming(!1),
  7076. ie.hideUi();
  7077. break;
  7078. case we.SEVEN:
  7079. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7080. break;
  7081. case we.EIGHT:
  7082. t.player.decreaseZoomSpeed();
  7083. break;
  7084. case we.NINE:
  7085. t.player.increaseZoomSpeed()
  7086. }
  7087. return i && i.reticule.hide(),
  7088. !0
  7089. }
  7090. .bind(this)),
  7091. document.addEventListener("keyup", function(e) {
  7092. switch (e.which) {
  7093. case we.PLUSEQUALS:
  7094. t.player.deactivatePersistentZooming();
  7095. break;
  7096. case we.DASHUNDERSCORE:
  7097. t.player.deactivatePersistentZooming()
  7098. }
  7099. }
  7100. .bind(this)),
  7101. F(e),
  7102. L(e, t.player),
  7103. M(i),
  7104. te.setAutoPlay(e.heroCount()),
  7105. he.init(i, a.mode),
  7106. he.on(ue.OPENED, Ze.bind(this, "help")),
  7107. fe.init(),
  7108. fe.on(ge.OPENED, function() {
  7109. var e = document.getElementById("terms-modal");
  7110. return function() {
  7111. Ze("terms"),
  7112. le.open(e)
  7113. }
  7114. }()),
  7115. fe.on(ge.CLOSED, le.reset),
  7116. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7117. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7118. Q.profiling.enabled && se.show(),
  7119. ve.init(t)
  7120. }
  7121. function M(e) {
  7122. var t = function(e, t) {
  7123. $(e).find("a").each(function(e, i) {
  7124. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7125. i.style.pointerEvents = t ? "auto" : "none"
  7126. })
  7127. }
  7128. , i = function() {
  7129. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7130. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7131. };
  7132. e.on(Ne.ZoomMax, function() {
  7133. t("#gui-zoomin", !1),
  7134. t("#gui-zoomout", !0)
  7135. }),
  7136. e.on(Ne.ZoomMin, function() {
  7137. t("#gui-zoomin", !0),
  7138. t("#gui-zoomout", !1)
  7139. }),
  7140. e.on(Ne.ZoomIn, function() {
  7141. t("#gui-zoomout", !0)
  7142. }),
  7143. e.on(Ne.ZoomOut, function() {
  7144. t("#gui-zoomin", !0)
  7145. }),
  7146. i()
  7147. }
  7148. function R(e) {
  7149. O(e)
  7150. }
  7151. function P(e) {
  7152. O(e)
  7153. }
  7154. function O(e) {
  7155. var t = e.waitQueue.length;
  7156. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7157. }
  7158. function L(e, t) {
  7159. He = {
  7160. gui: null,
  7161. visible: !1,
  7162. model: e,
  7163. player: t
  7164. }
  7165. }
  7166. function D(e, t) {
  7167. function i() {
  7168. var i = t.toJSON();
  7169. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7170. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7171. }
  7172. var n = {}
  7173. , r = new Le.GUI({
  7174. autoPlace: !0,
  7175. width: "60%"
  7176. });
  7177. i(),
  7178. t.on(xe.ViewChanged, i),
  7179. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7180. r.domElement.id = "datLinks";
  7181. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7182. return o.forEach(function(e) {
  7183. if (!K.detectSafari()) {
  7184. var t = document.createElement("button");
  7185. t.classList.add("btn-deep-link"),
  7186. t.innerText = Re.MENU_COPY,
  7187. e.nextSibling.appendChild(t);
  7188. var i = function() {
  7189. alert(Re.LINK_ALERT_COPY),
  7190. t.hide()
  7191. };
  7192. t.addEventListener("click", function(e) {
  7193. try {
  7194. var t = e.target.parentNode.childNodes[0];
  7195. t.select();
  7196. var n = document.execCommand("copy");
  7197. t.blur(),
  7198. n || i()
  7199. } catch (e) {
  7200. i()
  7201. }
  7202. })
  7203. }
  7204. }),
  7205. $(r.__closeButton).hide(),
  7206. r
  7207. }
  7208. function N(e) {
  7209. He.gui || (He.gui = D(He.model, He.player)),
  7210. He.visible = e,
  7211. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7212. }
  7213. function B() {
  7214. N(!He.visible)
  7215. }
  7216. function F(e) {
  7217. ke = {
  7218. gui: null,
  7219. visible: !1,
  7220. model: e
  7221. }
  7222. }
  7223. function V(e) {
  7224. var t = new Le.GUI;
  7225. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7226. e.setSweepVisibility(Q.showSweeps)
  7227. }),
  7228. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7229. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7230. Q.transition.flySpeed = 0,
  7231. t.__controllers.forEach(function(e) {
  7232. e.updateDisplay()
  7233. })
  7234. }),
  7235. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7236. $(t.__closeButton).hide(),
  7237. t
  7238. }
  7239. function U(e) {
  7240. ke.gui || (ke.gui = V(ke.model)),
  7241. ke.visible = e,
  7242. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7243. }
  7244. function k() {
  7245. U(!ke.visible)
  7246. }
  7247. function H() {
  7248. function e(e) {
  7249. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7250. }
  7251. $("body").css("touch-action", "none"),
  7252. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7253. // e.preventDefault()
  7254. });
  7255. var t = document.getElementById("terms-text")
  7256. , i = document.getElementById("more-help-wrapper")
  7257. , n = (document.getElementById("navigation-help-wrapper"),
  7258. document.getElementById("help-dialog"),
  7259. document.getElementById("tag-billboards"));
  7260. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7261. document.body.addEventListener("DOMMouseScroll", e)),
  7262. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7263. e.stopPropagation()
  7264. })
  7265. }
  7266. function G(e, t) {
  7267. for (var i = []; e; )
  7268. i.push(e),
  7269. e = e.parentNode;
  7270. for (; t && i.indexOf(t) === -1; )
  7271. t = t.parentNode;
  7272. return t
  7273. }
  7274. function z() {
  7275. var e, t = function(t) {
  7276. e = 0 === t.button || 1 === t.which ? t.target : null
  7277. }, i = function(t) {
  7278. e !== t.target && (e = G(e, t.target));
  7279. var i = document.getElementById("gui-parent");
  7280. if (G(i, e) !== i && (e = null),
  7281. e) {
  7282. var n;
  7283. try {
  7284. n = new MouseEvent("click",t)
  7285. } catch (e) {
  7286. n = document.createEvent("MouseEvents"),
  7287. 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)
  7288. }
  7289. n.syntheticClick = !0,
  7290. e.dispatchEvent(n),
  7291. e = null
  7292. }
  7293. };
  7294. document.body.addEventListener("mousedown", t, !0),
  7295. document.body.addEventListener("mouseup", i, !0),
  7296. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7297. e.syntheticClick || (e.stopPropagation(),
  7298. "A" === e.target.nodeName && e.preventDefault())
  7299. }, !0)
  7300. }
  7301. var W, j, Y, X, Z, q, K = (e("three"),
  7302. e("../util/ajax"),
  7303. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7304. e("../util/camera"),
  7305. e("../util/logger")), te = (e("../objects/Snapshot"),
  7306. 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"),
  7307. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7308. e("../enum/PathDisplayMode"),
  7309. e("../enum/DirectorEvents"),
  7310. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7311. e("../enum/WarpStyle"),
  7312. e("../enum/AlignmentType"),
  7313. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7314. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7315. coBrand: {
  7316. visible: !0,
  7317. elements: [".co-brand", "#loaderCoBrand"]
  7318. },
  7319. help: {
  7320. visible: !0,
  7321. elements: [".nav-help", "#nav-help"]
  7322. },
  7323. tourControls: {
  7324. visible: !0,
  7325. elements: [".next", ".previous", "#play"]
  7326. },
  7327. highlight: {
  7328. visible: !0,
  7329. elements: ["#drawer", "#pullTab"]
  7330. },
  7331. share: {
  7332. visible: !0,
  7333. elements: [".socialButton", "#share"]
  7334. },
  7335. fullScreen: {
  7336. visible: !0,
  7337. elements: ["#gui-fullscreen"]
  7338. },
  7339. floors: {
  7340. visible: !0,
  7341. elements: [".gui-floor"]
  7342. }
  7343. }, Ye = function() {
  7344. var e = document.getElementById("drawer");
  7345. return function() {
  7346. $("#player").height() < 400 && e.classList.contains("open") && a()
  7347. }
  7348. }(), Xe = function() {
  7349. var e = document.getElementById("meta-info");
  7350. return function() {
  7351. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7352. }
  7353. }(), Ze = function(e) {
  7354. function t() {
  7355. u.classList.contains("expand") && de.toggleMeta(!0)
  7356. }
  7357. function i() {
  7358. fe.hide()
  7359. }
  7360. function n() {
  7361. he.close()
  7362. }
  7363. function r() {
  7364. Ae.dismiss()
  7365. }
  7366. function o() {
  7367. p.hasClass("open") && a(!0)
  7368. }
  7369. function l() {
  7370. Ce.hide()
  7371. }
  7372. function c() {
  7373. f.hasClass("open") && f.removeClass("open")
  7374. }
  7375. function h() {
  7376. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7377. }
  7378. var u = document.getElementById("meta-info")
  7379. , d = document.getElementById("interaction-modal")
  7380. , p = $("#drawer").eq(0)
  7381. , f = $(".gui-floor").eq(0)
  7382. , g = $(".vr-popup").eq(0);
  7383. return function(e) {
  7384. switch (e) {
  7385. case "info":
  7386. i(),
  7387. n(),
  7388. Ye(),
  7389. l(),
  7390. c(),
  7391. r(),
  7392. h();
  7393. break;
  7394. case "terms":
  7395. t(),
  7396. n(),
  7397. o(),
  7398. l(),
  7399. c(),
  7400. r(),
  7401. h();
  7402. break;
  7403. case "help":
  7404. t(),
  7405. i(),
  7406. l(),
  7407. c(),
  7408. r(),
  7409. h();
  7410. break;
  7411. case "vr":
  7412. t(),
  7413. i(),
  7414. l(),
  7415. c(),
  7416. n(),
  7417. h(),
  7418. s(g) && o();
  7419. break;
  7420. case "highlights":
  7421. Xe(),
  7422. i(),
  7423. l(),
  7424. c();
  7425. break;
  7426. case "share":
  7427. t(),
  7428. i(),
  7429. n(),
  7430. c(),
  7431. r(),
  7432. h();
  7433. break;
  7434. case "floor":
  7435. i(),
  7436. l(),
  7437. r();
  7438. break;
  7439. case "view":
  7440. c(),
  7441. l(),
  7442. i(),
  7443. r();
  7444. break;
  7445. case "tour":
  7446. i(),
  7447. l(),
  7448. c(),
  7449. r();
  7450. break;
  7451. case "move":
  7452. i(),
  7453. l(),
  7454. c(),
  7455. r();
  7456. break;
  7457. case "resize":
  7458. t(),
  7459. Ye(),
  7460. c();
  7461. break;
  7462. case "tag":
  7463. i(),
  7464. n(),
  7465. l(),
  7466. c(),
  7467. r()
  7468. }
  7469. }
  7470. }();
  7471. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7472. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7473. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7474. setTimeout(function() {
  7475. $(".icon:visible").hide().show(0)
  7476. }, 100)
  7477. }),
  7478. $("#gui-fullscreen").find("a").on("click", function(e) {
  7479. l(e),
  7480. K.requestFullscreen($("body")[0]),
  7481. J.track("showcase_gui", {
  7482. gui_action: "click_enter_fullscreen",
  7483. interaction_source: "gui"
  7484. })
  7485. //czj
  7486. //W.reload()
  7487. }),
  7488. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7489. l(e),
  7490. K.exitFullscreen(),
  7491. J.track("showcase_gui", {
  7492. gui_action: "click_exit_fullscreen",
  7493. interaction_source: "gui"
  7494. })
  7495. })
  7496. $(window).on("resize", function(e) {
  7497. var t = e.target.innerHeight
  7498. , i = e.target.innerWidth;
  7499. t === X && i === Z || (je.highlight.visible && w(),
  7500. Ze("resize"),
  7501. $(".pinTop.right").removeClass("hideUnderMeta"),
  7502. c(),
  7503. X = t,
  7504. Z = i)
  7505. }).resize(),
  7506. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7507. $("#pullTab").on("click", function(e) {
  7508. l(e),
  7509. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7510. gui_action: "hide_highlight_reel"
  7511. }),
  7512. $(this).addClass("open").children("img").attr("src","static/images/auto.png")) : (J.trackAlways("showcase_gui", {
  7513. gui_action: "show_highlight_reel"
  7514. }),
  7515. $(this).removeClass("open").children("img").attr("src","static/images/auto-suspend.png"));
  7516. a()
  7517. });
  7518. /***********************方奕卓 热点列表事件监听 ************************/
  7519. if(window.DATA.showHotListSta) {
  7520. $('#hotList').css('display', '');
  7521. $('#hotList').on('click',function(e){
  7522. l(e);
  7523. var hotList = $('#hotListWrap')[0];
  7524. var isActive = hotList.classList.contains('hotListActive');
  7525. if(isActive){
  7526. hotList.classList.remove('hotListActive');
  7527. this.classList.remove('active')
  7528. }else{
  7529. hotList.classList.add('hotListActive');
  7530. this.classList.add('active')
  7531. }
  7532. }),
  7533. $('#hotListContent ul').on('mouseover', function(e){
  7534. if(browser.isMobile()) return
  7535. l(e);
  7536. var target = e.target;
  7537. var hotList = document.getElementById('hotListWrap');
  7538. if(target.tagName === 'SPAN'){
  7539. var targetParent = target.parentElement.parentElement;
  7540. if(target.offsetWidth + 150 >= targetParent.clientWidth){
  7541. hotList.style.width = target.offsetWidth + 150 + 'px';
  7542. }else{
  7543. hotList.style.width = '';
  7544. }
  7545. }else if(target.tagName === 'LI'){
  7546. var targetParent = target.parentElement;
  7547. if(target.children[0].offsetWidth + 150 >= targetParent.clientWidth){
  7548. hotList.style.width = target.children[0].offsetWidth + 150 + 'px';
  7549. }else{
  7550. hotList.style.width = ''
  7551. }
  7552. }else {
  7553. hotList.style.width = '';
  7554. }
  7555. });
  7556. $('#hotListContent ul').on('click', function(e){
  7557. l(e);
  7558. this.preElem && this.preElem.classList.remove('active');
  7559. if(e.target.tagName === 'SPAN'){
  7560. e.stopPropagation();//阻止事件冒泡即可
  7561. e.target.parentElement.classList.add('active');
  7562. e.target.parentElement.hot && e.target.parentElement.hot.examine({dontOpen:true, fastTran:true }); // 打开热点
  7563. this.preElem = e.target.parentElement;
  7564. }else{
  7565. e.target.classList.add('active');
  7566. e.target.hot && e.target.hot.examine({dontOpen:true, fastTran:true }); // 打开热点
  7567. this.preElem = e.target;
  7568. }
  7569. })
  7570. $('#hotListClose').on('click', function(e){
  7571. l(e);
  7572. var hotList = $('#hotListWrap')[0];
  7573. hotList.classList.remove('hotListActive');
  7574. $('#hotListContent ul .active').removeClass('active');
  7575. if($('#hotList')&&$('#hotList')[0]) $('#hotList')[0].classList.remove('active')
  7576. })
  7577. }
  7578. /*****************************************************************/
  7579. $("#more-menu-button").on("click", function(e) {
  7580. l(e);
  7581. var t = $("#more-menu");
  7582. t.toggleClass("open")
  7583. }),
  7584. t.exports.init = S,
  7585. t.exports.startLoading = x,
  7586. t.exports.endLoading = d,
  7587. t.exports.onProgress = u
  7588. }
  7589. ).call(this, "/js/gui/gui.js")
  7590. }
  7591. , {
  7592. "../analytics": 4,
  7593. "../controls/serializer": 14,
  7594. "../enum/AlignmentType": 17,
  7595. "../enum/BlackoutStyle": 18,
  7596. "../enum/ControlEvents": 21,
  7597. "../enum/DirectorEvents": 23,
  7598. "../enum/Keys": 30,
  7599. "../enum/PathDiscardMode": 38,
  7600. "../enum/PathDisplayMode": 39,
  7601. "../enum/PlayerEvents": 40,
  7602. "../enum/VROption": 47,
  7603. "../enum/Vectors": 50,
  7604. "../enum/Viewmode": 51,
  7605. "../enum/WarpStyle": 52,
  7606. "../enum/ZoomEvents": 53,
  7607. "../lib/dat.gui": 93,
  7608. "../localization/localize": 108,
  7609. "../tag/Media/MediaEvent": 131,
  7610. "../objects/Snapshot": 153,
  7611. "../settings": 166,
  7612. "../util/ajax": 181,
  7613. "../util/browser": 182,
  7614. "../util/camera": 183,
  7615. "../util/logger": 189,
  7616. "../util/showcase": 193,
  7617. "../util/transitions": 195,
  7618. "./closer/ModalCloserEvent": 61,
  7619. "./closer/modalCloser": 62,
  7620. "./help/HelpEvent": 66,
  7621. "./help/help": 67,
  7622. "./helpManager": 68,
  7623. "./immersiveMode": 69,
  7624. "./konami": 70,
  7625. "./landingScreen": 71,
  7626. "./loadingScreen": 72,
  7627. "./memoryUsage": 73,
  7628. "./playButton": 74,
  7629. "./populateModal": 75,
  7630. "./sharing/ShareEvents": 76,
  7631. "./sharing/modal": 77,
  7632. "./terms/TermsEvent": 78,
  7633. "./terms/terms": 79,
  7634. "./title/TitleEvents": 80,
  7635. "./title/tagToggle": 81,
  7636. "./title/titleBar": 82,
  7637. "./tourInteraction": 84,
  7638. "./vr/vrEvent": 85,
  7639. "./vr/vrModal": 87,
  7640. "./webvr/WebVrEvent": 88,
  7641. "./webvr/webVRgui": 89,
  7642. three: 217
  7643. }],
  7644. 66: [function(e, t, i) {
  7645. "use strict";
  7646. t.exports = Object.freeze({
  7647. OPENED: "help.opened",
  7648. CLOSED: "help.closed"
  7649. })
  7650. }
  7651. , {}],
  7652. 67: [function(e, t, i) {
  7653. "use strict";
  7654. function n() {
  7655. g.on("click", function(e) {
  7656. if (S && S !== l.TRANSITIONING) {
  7657. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7658. t && !M ? R.close() : r()
  7659. }
  7660. }),
  7661. w.on("click", function(e) {
  7662. R.close()
  7663. }),
  7664. E.on("click", function(e) {
  7665. S && S !== l.TRANSITIONING && (s(),
  7666. o())
  7667. }),
  7668. b.on("click", function(e) {
  7669. s(),
  7670. a()
  7671. })
  7672. }
  7673. function r() {
  7674. S && S !== l.TRANSITIONING && (M = !0,
  7675. setTimeout(function() {
  7676. M = !1
  7677. }, d.help.modalStayDuration),
  7678. R.emit(h.OPENED),
  7679. m.addClass("open " + S),
  7680. g.addClass("open"),
  7681. s(),
  7682. o(),
  7683. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7684. y.classList.add("fadeIn"))
  7685. }
  7686. function o() {
  7687. E.addClass("underline-tab"),
  7688. u.fill(_, c.NAVIGATION, S),
  7689. m.addClass(S)
  7690. }
  7691. function a() {
  7692. b.addClass("underline-tab"),
  7693. u.fill(T, c.MORE_HELP),
  7694. m.addClass("more-help")
  7695. }
  7696. function s(e, t) {
  7697. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7698. I.forEach(function(e) {
  7699. e.classList.remove("underline-tab")
  7700. })
  7701. }
  7702. var l = e("../../enum/Viewmode")
  7703. , c = e("../../enum/HelpModalType")
  7704. , h = e("./HelpEvent")
  7705. , u = (e("../helpManager"),
  7706. e("./../populateModal"))
  7707. , d = e("../../settings")
  7708. , p = e("../../util/common")
  7709. , f = e("events").EventEmitter
  7710. , g = $(".footer-help").eq(0)
  7711. , m = $("#help-dialog").eq(0)
  7712. , v = document.querySelector("#quick-logo")
  7713. , A = document.querySelector("#loaderCoBrand")
  7714. , y = document.querySelector("#help-dialog")
  7715. , C = document.querySelector(".footer")
  7716. , I = $(".help-tabs").children().toArray()
  7717. , E = $(".navigation-tab").eq(0)
  7718. , b = $(".more-help-tab").eq(0)
  7719. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7720. m.find(".close").eq(0))
  7721. , _ = m.find(".interactions").toArray()
  7722. , T = m.find(".ui-instructions").toArray()
  7723. , x = l.PANORAMA
  7724. , S = l.PANORAMA
  7725. , M = !1
  7726. , R = {
  7727. init: function(e, t) {
  7728. S = t,
  7729. x = t,
  7730. [y, A, v, C].forEach(function(e) {
  7731. e.classList.add(u.deviceType)
  7732. }),
  7733. n()
  7734. },
  7735. close: function() {
  7736. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7737. g.removeClass("open"),
  7738. m.removeClass("open"),
  7739. y.classList.contains("fadeIn"))) {
  7740. y.classList.remove("fadeIn");
  7741. var e = S === l.TRANSITIONING ? x : S;
  7742. u.clear(_, c.NAVIGATION, e)
  7743. }
  7744. },
  7745. updateMode: function(e) {
  7746. x = S,
  7747. S = e
  7748. }
  7749. };
  7750. p.extendObject(R, f.prototype),
  7751. t.exports = R
  7752. }
  7753. , {
  7754. "../../enum/HelpModalType": 28,
  7755. "../../enum/Viewmode": 51,
  7756. "../../settings": 166,
  7757. "../../util/common": 185,
  7758. "../helpManager": 68,
  7759. "./../populateModal": 75,
  7760. "./HelpEvent": 66,
  7761. events: 202
  7762. }],
  7763. 68: [function(e, t, i) {
  7764. (function(i) {
  7765. "use strict";
  7766. var n = e("../util/browser")
  7767. , r = e("./../util/logger")
  7768. , o = e("./../settings")
  7769. , a = new r(i)
  7770. , s = function() {
  7771. var e;
  7772. try {
  7773. return e = window.localStorage.getItem("visitCount") || "0",
  7774. e = (parseFloat(e) + 1).toString(),
  7775. window.localStorage.setItem("visitCount", e),
  7776. a.debug("visitCount = " + e),
  7777. e
  7778. } catch (t) {
  7779. e = "1",
  7780. a.debug("couldn't set local storage")
  7781. }
  7782. }()
  7783. , l = !1;
  7784. t.exports = {
  7785. isHelpDisabled: function() {
  7786. return "0" === n.valueFromHash("help", null) || l
  7787. },
  7788. isLargeHelpEnabled: function() {
  7789. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7790. },
  7791. isSmallHelpEnabled: function() {
  7792. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7793. },
  7794. isHelpEnabled: function() {
  7795. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7796. },
  7797. setAutoPlay: function(e) {
  7798. l = o.warp.auto >= 0 && e > 1
  7799. }
  7800. }
  7801. }
  7802. ).call(this, "/js/gui/helpManager.js")
  7803. }
  7804. , {
  7805. "../util/browser": 182,
  7806. "./../settings": 166,
  7807. "./../util/logger": 189
  7808. }],
  7809. 69: [function(e, t, i) {
  7810. "use strict";
  7811. function n(e, t, i, n) {
  7812. F = n,
  7813. r(e, t, i, F),
  7814. o(),
  7815. N = t.mode
  7816. }
  7817. function r(e, t, i, n) {
  7818. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7819. e.controls[t].on(v.Move, a),
  7820. e.controls[t].on(v.LongTap, c)
  7821. }),
  7822. M.on("mousewheel DOMMouseScroll", a),
  7823. i.on(m.TagActivated, a),
  7824. i.on(m.TagNavigation, a),
  7825. t.on(A.FlyingEnded, s),
  7826. t.on(A.ModeChanging, function(e, t) {
  7827. B = t !== C.PANORAMA && e !== C.PANORAMA
  7828. }),
  7829. t.on(A.ModeChanged, function(e, i) {
  7830. N = t.mode,
  7831. i !== C.TRANSITIONING ? l() : a("modeChange")
  7832. }),
  7833. n.on(y.TourStart, function() {
  7834. L = !0,
  7835. a()
  7836. }),
  7837. n.on(y.TourEnd, function() {
  7838. L = !1,
  7839. l()
  7840. }),
  7841. n.on(y.ActionInterrupted, function() {
  7842. L = !1
  7843. }),
  7844. R.addEventListener("touchend", function() {
  7845. $("#pullTab").hasClass("opened") && !L && l()
  7846. }, !0)
  7847. }
  7848. function o() {
  7849. p.isMobile() ? (b.forEach(function(e) {
  7850. e.classList.add("mobile")
  7851. }),
  7852. w.click(l)) : (b.forEach(function(e) {
  7853. e.addEventListener("mouseleave", function() {
  7854. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7855. }, !0)
  7856. }),
  7857. M.mouseleave(function() {
  7858. b[0].classList.contains("detectHover") && l()
  7859. }))
  7860. }
  7861. function a(e) {
  7862. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7863. P = !0,
  7864. g.close(),
  7865. h(e),
  7866. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7867. _.hasClass("playing") || (b.forEach(function(e) {
  7868. e.classList.add("detectHover")
  7869. }),
  7870. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7871. }
  7872. function s() {
  7873. _.hasClass("playing") || (clearTimeout(O),
  7874. O = setTimeout(l, f.immersive.timeToShowAgain))
  7875. }
  7876. function l() {
  7877. clearTimeout(O),
  7878. P = !1,
  7879. I.forEach(function(e) {
  7880. e.classList.remove("drawerOpen")
  7881. }),
  7882. L || E.forEach(function(e) {
  7883. e.classList.remove("duringTour")
  7884. }),
  7885. b.forEach(function(e) {
  7886. e.classList.remove("detectHover")
  7887. })
  7888. }
  7889. function c() {
  7890. P ? l() : a(),
  7891. D = !0,
  7892. setTimeout(function() {
  7893. D = !1
  7894. }, f.immersive.uiStayDuration)
  7895. }
  7896. function h(e) {
  7897. !d(e) && L ? E.forEach(function(e) {
  7898. e.classList.remove("drawerOpen"),
  7899. e.classList.add("duringTour")
  7900. }) : _.hasClass("open") ? E.forEach(function(e) {
  7901. e.classList.remove("duringTour"),
  7902. e.classList.add("drawerOpen")
  7903. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7904. e.classList.add("fadeOut")
  7905. })
  7906. }
  7907. function u() {
  7908. T.hasClass("duringTour") || (L = !1,
  7909. a("gui"),
  7910. l())
  7911. }
  7912. function d(e) {
  7913. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7914. }
  7915. var p = e("../util/browser")
  7916. , f = e("../settings")
  7917. , g = e("./help/help")
  7918. , m = e("../enum/tagEvents")
  7919. , v = e("../enum/ControlEvents")
  7920. , A = e("../enum/PlayerEvents")
  7921. , y = e("../enum/DirectorEvents")
  7922. , A = e("../enum/PlayerEvents")
  7923. , C = e("../enum/Viewmode")
  7924. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7925. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7926. , b = $("#hover-bottom, #hover-top").toArray()
  7927. , w = ($("#pullTab").eq(0),
  7928. $("#playHead").eq(0),
  7929. $(".pinBottom-container").eq(0))
  7930. , _ = $("#drawer").eq(0)
  7931. , T = $("#drawer-container").eq(0)
  7932. , x = $("#meta-info").eq(0)
  7933. , S = $(".pinTop.left").eq(0)
  7934. , M = $("#player").eq(0)
  7935. , R = document.getElementById("pullTab")
  7936. , P = !1
  7937. , O = null
  7938. , L = !1
  7939. , D = !1
  7940. , N = null
  7941. , B = !1
  7942. , F = null;
  7943. t.exports.init = n,
  7944. t.exports.hideUi = a,
  7945. t.exports.resetDrawer = u
  7946. }
  7947. , {
  7948. "../enum/ControlEvents": 21,
  7949. "../enum/DirectorEvents": 23,
  7950. "../enum/tagEvents": 32,
  7951. "../enum/PlayerEvents": 40,
  7952. "../enum/Viewmode": 51,
  7953. "../settings": 166,
  7954. "../util/browser": 182,
  7955. "./help/help": 67
  7956. }],
  7957. 70: [function(e, t, i) {
  7958. (function(i) {
  7959. "use strict";
  7960. function n(e, t, i) {
  7961. l.debug("konami has the modelInstance");
  7962. var n = [];
  7963. $(window).on("keydown", function(e) {
  7964. n.push(e.which),
  7965. n.length > o.secretPanelWord.length && n.shift(),
  7966. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7967. o.debug = !0)
  7968. }),
  7969. $(window).on("keydown", function n(r) {
  7970. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7971. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7972. })
  7973. }
  7974. var r = e("./../util/logger")
  7975. , o = e("./../settings")
  7976. , a = e("./debug")
  7977. , s = e("./../util/common")
  7978. , l = (e("./gui"),
  7979. new r(i));
  7980. o.console && $("body").append('<div id="debug-console"></div>'),
  7981. t.exports.init = n
  7982. }
  7983. ).call(this, "/js/gui/konami.js")
  7984. }
  7985. , {
  7986. "./../settings": 166,
  7987. "./../util/common": 185,
  7988. "./../util/logger": 189,
  7989. "./debug": 63,
  7990. "./gui": 65
  7991. }],
  7992. 71: [function(e, t, i) {
  7993. "use strict";
  7994. function n(e, t) {
  7995. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7996. }
  7997. function r(e) {
  7998. var t = $.Deferred();
  7999. e || t.resolve();
  8000. var i = c.startupFlyinDelay;
  8001. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  8002. setTimeout(t.resolve.bind(t), i),
  8003. t
  8004. }
  8005. function o(e, t, i) {
  8006. var n = 0;
  8007. c.quickstart.enabled && (a(i),
  8008. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  8009. var r = function() {
  8010. e.once(g.Move, l),
  8011. t.once(f.TourStart, l)
  8012. };
  8013. s(n, r)
  8014. }
  8015. function a(e) {
  8016. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8017. v.before(y),
  8018. A = $(".quick-brand").toArray()),*/
  8019. m.addClass("fadeOut"),
  8020. setTimeout(function() {
  8021. A.forEach(function(e) {
  8022. e.classList.add("fadeIn")
  8023. })
  8024. }, c.quickstart.showTextDelay),
  8025. setTimeout(function() {
  8026. A.forEach(function(e) {
  8027. e.classList.add("fadeOut")
  8028. })
  8029. }, c.quickstart.fadeOutDelay),
  8030. !0
  8031. }
  8032. function s(e, t) {
  8033. setTimeout(function() {
  8034. if (h.isHelpEnabled()) {
  8035. if (t(),
  8036. u.init(),
  8037. C.addClass("fadeIn landing " + u.deviceType),
  8038. h.isSmallHelpEnabled())
  8039. return void C.addClass("small");
  8040. u.fill(I, d.LANDING[E]),
  8041. C.addClass(E)
  8042. }
  8043. }, e)
  8044. //csz 用户引导界面
  8045. var helpData = {
  8046. "pc":["static/images/pc_step1.png","static/images/pc_step2.png","static/images/pc_step3.png"],
  8047. "mobile":["static/images/phone_step1.png","static/images/phone_step2.png","static/images/phone_step3.png"]
  8048. }
  8049. var navIcon = $(".nav-icon .icon");
  8050. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8051. function paging(id){
  8052. id.on("click",function(){
  8053. var navPage = null;
  8054. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8055. if(navPage > 3 || navPage < 1) return false
  8056. console.log('123-',navPage);
  8057. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8058. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8059. }else{
  8060. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8061. }
  8062. })
  8063. };
  8064. paging($(".next-button"));
  8065. paging($(".prev-button"));
  8066. }
  8067. function l() {
  8068. u.clear(I, d.LANDING[E]),
  8069. C.removeClass("fadeIn")
  8070. }
  8071. var c = e("../settings")
  8072. , h = (e("./help/help"),
  8073. e("./helpManager"))
  8074. , u = e("./populateModal")
  8075. , d = e("../enum/HelpModalType")
  8076. , p = e("../enum/Viewmode")
  8077. , f = e("../enum/DirectorEvents")
  8078. , g = e("../enum/PlayerEvents")
  8079. , m = $("#quick-blackout").eq(0)
  8080. , v = $("#quick-logo").eq(0)
  8081. , A = $(".quick-brand").toArray()
  8082. , y = $("#loaderCoBrand").eq(0)
  8083. , C = $("#interaction-modal").eq(0)
  8084. , I = C.find(".interaction").toArray()
  8085. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8086. "");
  8087. t.exports.delayLanding = r,
  8088. t.exports.showMessage = o,
  8089. t.exports.init = n,
  8090. t.exports.dismissModal = l
  8091. }
  8092. , {
  8093. "../enum/DirectorEvents": 23,
  8094. "../enum/HelpModalType": 28,
  8095. "../enum/PlayerEvents": 40,
  8096. "../enum/Viewmode": 51,
  8097. "../settings": 166,
  8098. "./help/help": 67,
  8099. "./helpManager": 68,
  8100. "./populateModal": 75
  8101. }],
  8102. 72: [function(e, t, i) {
  8103. "use strict";
  8104. var n = e("./circleLoader").circleLoader;
  8105. t.exports = {
  8106. element: $("#gui-loading"),
  8107. hide: function(e) {
  8108. n.done(),
  8109. this.element.fadeOut(1500, e)
  8110. },
  8111. show: function(e) {
  8112. this.element.fadeIn(500, function() {
  8113. this.element.css("display", "table"),
  8114. e && e()
  8115. }
  8116. .bind(this))
  8117. },
  8118. progress: function(e) {
  8119. n.set(e)
  8120. }
  8121. }
  8122. }
  8123. , {
  8124. "./circleLoader": 60
  8125. }],
  8126. 73: [function(e, t, i) {
  8127. "use strict";
  8128. var n = e("../settings")
  8129. , r = $("#memory-info")
  8130. , o = r.find("#memory-gpu")
  8131. , a = !1;
  8132. t.exports = {
  8133. show: function() {
  8134. n.profiling.enabled && (r.show(),
  8135. a = !0)
  8136. },
  8137. hide: function() {
  8138. r.hide(),
  8139. a = !1
  8140. },
  8141. toggle: function() {
  8142. a ? this.hide() : this.show()
  8143. },
  8144. update: function(e) {
  8145. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8146. }
  8147. }
  8148. }
  8149. , {
  8150. "../settings": 166
  8151. }],
  8152. 74: [function(e, t, i) {
  8153. "use strict";
  8154. var n = e("../util/browser")
  8155. , r = e("../analytics");
  8156. e("../settings");
  8157. t.exports = {
  8158. show: function(e, t) {
  8159. $("#gui-message").fadeOut(500, function() {
  8160. t()
  8161. })
  8162. }
  8163. }
  8164. }
  8165. , {
  8166. "../analytics": 4,
  8167. "../settings": 166,
  8168. "../util/browser": 182
  8169. }],
  8170. 75: [function(e, t, i) {
  8171. "use strict";
  8172. function n(e, t, i, n) {
  8173. function r(e) {
  8174. return e.classList.contains(a)
  8175. }
  8176. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8177. //for (var a in o) {
  8178. //var s = e.find(r);
  8179. //for (var l in o[a]) {
  8180. //var c = o[a][l];
  8181. //if ("top-info" === l || "bottom-info" === l) {
  8182. //var h = n ? c : "";
  8183. //czj 注释掉第一次打开的用户引导
  8184. //s.querySelector("." + l).textContent = h
  8185. //} else {
  8186. //var u = n ? c : "";
  8187. //, d = s.querySelector("." + l);
  8188. //d.src = u,
  8189. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8190. //}
  8191. //}
  8192. //}
  8193. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8194. // p.forEach(function(e) {
  8195. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8196. // })
  8197. }
  8198. var r = e("../util/browser")
  8199. , o = e("../localization/localize")
  8200. , a = e("../enum/HelpModalType")
  8201. , s = (e("../enum/HelpModalSize"),
  8202. e("../enum/Viewmode"));
  8203. t.exports = {
  8204. init: function() {
  8205. if (!this.hasInitialized) {
  8206. this.hasInitialized = !0,
  8207. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8208. this.assets = {},
  8209. this.assets[a.LANDING[s.PANORAMA]] = {
  8210. desktop: {
  8211. left: {
  8212. "top-info": o.ROTATE,
  8213. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8214. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8215. },
  8216. middle: {
  8217. "top-info": o.MOVE,
  8218. "big-image": "static/images/nav_help_mouse_click.png",
  8219. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8220. },
  8221. right: {
  8222. "top-info": o.ZOOM,
  8223. "big-image": "static/images/nav_help_mouse_zoom.png",
  8224. keyboard: "static/images/nav_help_zoom_keys.png"
  8225. }
  8226. },
  8227. mobile: {
  8228. left: {
  8229. "top-info": o.ROTATE,
  8230. "big-image": "static/images/nav_help_gesture_drag.png"
  8231. },
  8232. middle: {
  8233. "top-info": o.MOVE,
  8234. "big-image": "static/images/nav_help_gesture_tap.png"
  8235. },
  8236. right: {
  8237. "top-info": o.ZOOM,
  8238. "big-image": "static/images/nav_help_gesture_pinch.png"
  8239. }
  8240. }
  8241. },
  8242. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8243. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8244. desktop: {
  8245. left: {
  8246. "top-info": o.ROTATE,
  8247. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8248. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8249. },
  8250. middle: {
  8251. "top-info": o.MOVE,
  8252. "big-image": "static/images/nav_help_mouse_position_right.png"
  8253. }
  8254. },
  8255. mobile: {
  8256. left: {
  8257. "top-info": o.ROTATE,
  8258. "big-image": "static/images/nav_help_gesture_drag.png"
  8259. },
  8260. middle: {
  8261. "top-info": o.MOVE,
  8262. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8263. }
  8264. }
  8265. },
  8266. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8267. desktop: {
  8268. left: {
  8269. "top-info": o.MOVE,
  8270. "big-image": "static/images/nav_help_mouse_position_left.png"
  8271. },
  8272. middle: {
  8273. "top-info": o.ROTATE,
  8274. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8275. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8276. }
  8277. },
  8278. mobile: {
  8279. left: {
  8280. "top-info": o.MOVE,
  8281. "big-image": "static/images/nav_help_gesture_position.png"
  8282. },
  8283. middle: {
  8284. "top-info": o.ROTATE,
  8285. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8286. }
  8287. }
  8288. };
  8289. var e = {
  8290. "top-info": o.INSIDE,
  8291. "big-image": "static/images/nav_help_click_inside.png",
  8292. keyboard: "static/images/nav_help_inside_key.png"
  8293. };
  8294. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8295. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8296. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8297. var t = {
  8298. "top-info": o.INSIDE,
  8299. "big-image": "static/images/nav_help_tap_inside.png"
  8300. };
  8301. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8302. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8303. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8304. this.assets[a.NAVIGATION] = {},
  8305. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8306. desktop: {
  8307. left: {
  8308. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8309. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8310. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8311. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8312. },
  8313. middle: {
  8314. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8315. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8316. "big-image": "static/images/nav_help_mouse_click.png",
  8317. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8318. },
  8319. right: {
  8320. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8321. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8322. "big-image": "static/images/nav_help_mouse_zoom.png",
  8323. keyboard: "static/images/nav_help_zoom_keys.png"
  8324. }
  8325. },
  8326. mobile: {
  8327. left: {
  8328. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8329. "big-image": "static/images/nav_help_gesture_drag.png"
  8330. },
  8331. middle: {
  8332. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8333. "big-image": "static/images/nav_help_gesture_tap.png"
  8334. },
  8335. right: {
  8336. "top-info": o.HELP_MOBILE_3,
  8337. "big-image": "static/images/nav_help_gesture_pinch.png"
  8338. }
  8339. }
  8340. },
  8341. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8342. desktop: {
  8343. left: {
  8344. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8345. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8346. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8347. keyboard: "static/images/nav_help_keyboard_all.png"
  8348. },
  8349. middle: {
  8350. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8351. "big-image": "static/images/nav_help_mouse_position_right.png"
  8352. },
  8353. right: {
  8354. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8355. "big-image": "static/images/nav_help_mouse_zoom.png"
  8356. }
  8357. },
  8358. mobile: {
  8359. left: {
  8360. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8361. "big-image": "static/images/nav_help_gesture_drag.png"
  8362. },
  8363. middle: {
  8364. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8365. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8366. },
  8367. right: {
  8368. "top-info": o.HELP_MOBILE_3,
  8369. "big-image": "static/images/nav_help_gesture_pinch.png"
  8370. }
  8371. }
  8372. },
  8373. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8374. desktop: {
  8375. left: {
  8376. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8377. "big-image": "static/images/nav_help_mouse_position_left.png"
  8378. },
  8379. middle: {
  8380. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8381. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8382. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8383. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8384. },
  8385. right: {
  8386. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8387. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8388. "big-image": "static/images/nav_help_mouse_zoom.png",
  8389. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8390. }
  8391. },
  8392. mobile: {
  8393. left: {
  8394. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8395. "big-image": "static/images/nav_help_gesture_position.png"
  8396. },
  8397. middle: {
  8398. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8399. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8400. },
  8401. right: {
  8402. "top-info": o.HELP_MOBILE_3,
  8403. "big-image": "static/images/nav_help_gesture_pinch.png"
  8404. }
  8405. }
  8406. },
  8407. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8408. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8409. "top-info": o.HELP_DESKTOP_360_2A,
  8410. "bottom-info": o.HELP_DESKTOP_360_2B,
  8411. "big-image": "static/images/nav_help_click_inside.png",
  8412. keyboard: "static/images/nav_help_inside_key.png"
  8413. },
  8414. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8415. "top-info": o.HELP_MOBILE_360_2,
  8416. "big-image": "static/images/nav_help_tap_inside.png"
  8417. },
  8418. this.assets[a.MORE_HELP] = {
  8419. desktop: {
  8420. "more-help-hlr": {
  8421. "top-info": o.HELP_MORE_HLR_A,
  8422. "big-image": "static/images/nav_help_expand.svg",
  8423. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8424. },
  8425. "more-help-dollhouse": {
  8426. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8427. "big-image": "static/images/nav_help_dollhouse.svg",
  8428. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8429. },
  8430. "more-help-floors": {
  8431. "top-info": o.HELP_MORE_FLOORS_A,
  8432. "big-image": "static/images/nav_help_floor picker.svg",
  8433. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8434. },
  8435. "more-help-tag": {
  8436. "top-info": o.HELP_MORE_TAG_A,
  8437. "big-image": "static/images/nav_help_tag.svg",
  8438. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8439. },
  8440. "more-help-zoom": {
  8441. "top-info": o.HELP_MORE_ZOOM_A,
  8442. "big-image": "static/images/nav_help_zoom.svg",
  8443. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8444. },
  8445. "more-help-tour": {
  8446. "top-info": o.HELP_MORE_TOUR_A,
  8447. "big-image": "static/images/nav_help_play.png",
  8448. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8449. },
  8450. "more-help-inside": {
  8451. "top-info": o.HELP_MORE_INSIDE_A,
  8452. "big-image": "static/images/nav_help_inside.svg",
  8453. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8454. },
  8455. "more-help-vr": {
  8456. "top-info": o.HELP_MORE_VR_A,
  8457. "big-image": "static/images/nav_help_vr.svg",
  8458. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8459. },
  8460. "more-help-360": {
  8461. "top-info": o.HELP_MORE_360_A,
  8462. "big-image": "static/images/nav_help_360.svg",
  8463. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8464. },
  8465. "more-help-fullscreen": {
  8466. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8467. "big-image": "static/images/nav_help_fullscreen.svg",
  8468. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8469. }
  8470. },
  8471. mobile: {
  8472. "more-help-hlr": {
  8473. "top-info": o.HELP_MORE_HLR_A,
  8474. "big-image": "static/images/nav_help_expand.svg",
  8475. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8476. },
  8477. "more-help-dollhouse": {
  8478. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8479. "big-image": "static/images/nav_help_dollhouse.svg",
  8480. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8481. },
  8482. "more-help-floors": {
  8483. "top-info": o.HELP_MORE_FLOORS_A,
  8484. "big-image": "static/images/nav_help_floor picker.svg",
  8485. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8486. },
  8487. "more-help-tag": {
  8488. "top-info": o.HELP_MORE_TAG_A,
  8489. "big-image": "static/images/nav_help_tag.svg",
  8490. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8491. },
  8492. "more-help-tour": {
  8493. "top-info": o.HELP_MORE_TOUR_A,
  8494. "big-image": "static/images/nav_help_play.png",
  8495. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8496. },
  8497. "more-help-inside": {
  8498. "top-info": o.HELP_MORE_INSIDE_A,
  8499. "big-image": "static/images/nav_help_inside.svg",
  8500. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8501. },
  8502. "more-help-vr": {
  8503. "top-info": o.HELP_MORE_VR_A,
  8504. "big-image": "static/images/webvr.svg",
  8505. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8506. },
  8507. "more-help-360": {
  8508. "top-info": o.HELP_MORE_360_A,
  8509. "big-image": "static/images/nav_help_360.svg",
  8510. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8511. }
  8512. }
  8513. },
  8514. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8515. desktop: {
  8516. left: {
  8517. "top-info": o.ROTATE,
  8518. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8519. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8520. },
  8521. middle: {
  8522. "top-info": o.MOVE,
  8523. "big-image": "static/images/nav_help_mouse_click.png",
  8524. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8525. },
  8526. right: {
  8527. "top-info": o.PLAY,
  8528. "big-image": "static/images/Desktop-help-play-button.svg",
  8529. keyboard: "static/images/Desktop-help-spacebar-2.svg"
  8530. }
  8531. },
  8532. mobile: {
  8533. left: {
  8534. "top-info": o.ROTATE,
  8535. "big-image": "static/images/nav_help_gesture_drag.png"
  8536. },
  8537. middle: {
  8538. "top-info": o.MOVE,
  8539. "big-image": "static/images/nav_help_gesture_tap.png"
  8540. },
  8541. right: {
  8542. "top-info": o.PLAY,
  8543. "big-image": "static/images/mobile-help-play-button.svg"
  8544. }
  8545. }
  8546. },
  8547. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8548. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8549. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8550. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8551. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8552. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8553. }
  8554. },
  8555. fill: function(e, t, i) {
  8556. n.call(this, e, t, i, !0)
  8557. },
  8558. clear: function(e, t, i) {
  8559. n.call(this, e, t, i, !1)
  8560. }
  8561. }
  8562. }
  8563. , {
  8564. "../enum/HelpModalSize": 27,
  8565. "../enum/HelpModalType": 28,
  8566. "../enum/Viewmode": 51,
  8567. "../localization/localize": 108,
  8568. "../util/browser": 182
  8569. }],
  8570. 76: [function(e, t, i) {
  8571. "use strict";
  8572. t.exports = Object.freeze({
  8573. OPENED: "share.open",
  8574. CLOSED: "share.closed",
  8575. LINK_CLICKED: "share.linked"
  8576. })
  8577. }
  8578. , {}],
  8579. 77: [function(e, t, i) {
  8580. "use strict";
  8581. function n(e) {
  8582. function t(t, i) {
  8583. var n = window.screenY + ($("#player").height() - i) / 2
  8584. , r = window.screenX + ($("#player").width() - t) / 2
  8585. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8586. I.emit(l.LINK_CLICKED, {
  8587. channel: e
  8588. }),
  8589. window.open(C[e], "shareWindow", o)
  8590. }
  8591. switch (e) {
  8592. case y.FACEBOOK:
  8593. t(580, 420);
  8594. break;
  8595. case y.TWITTER:
  8596. t(550, 440);
  8597. break;
  8598. case y.MAIL:
  8599. I.emit(l.LINK_CLICKED, {
  8600. channel: "email"
  8601. }),
  8602. window.open(C[e], "_blank");
  8603. break;
  8604. case y.LINKEDIN:
  8605. }
  8606. }
  8607. function r(e) {
  8608. I.emit(l.LINK_CLICKED, {
  8609. channel: "copylink"
  8610. });
  8611. var t = document.createRange();
  8612. t.selectNodeContents(v);
  8613. var i = window.getSelection();
  8614. i.removeAllRanges(),
  8615. i.addRange(t),
  8616. document.execCommand("copy"),
  8617. A.classList.remove("hidden"),
  8618. v.classList.add("highlighted")
  8619. }
  8620. function o(e) {
  8621. e && (e.stopPropagation(),
  8622. e.target === v) || (window.getSelection().removeAllRanges(),
  8623. v.classList.remove("highlighted"),
  8624. A.classList.add("hidden"))
  8625. }
  8626. var a = e("../../util/browser")
  8627. , s = e("../../localization/localize")
  8628. , l = e("./ShareEvents")
  8629. , c = e("../../util/common")
  8630. , h = e("events").EventEmitter
  8631. , u = document.getElementById("sharing")
  8632. , d = document.getElementById("share-modal")
  8633. , p = document.getElementById("share-close")
  8634. , f = document.getElementById("facebook-share")
  8635. , g = document.getElementById("twitter-share")
  8636. , m = document.getElementById("mail-share")
  8637. , v = document.getElementById("share-url-text")
  8638. , A = document.getElementById("copy-success")
  8639. , y = Object.freeze({
  8640. FACEBOOK: "facebook",
  8641. TWITTER: "twitter",
  8642. MAIL: "mail",
  8643. LINKEDIN: "linkedin"
  8644. })
  8645. , C = {};
  8646. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8647. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8648. C[y.MAIL] = "mailto:?subject=";
  8649. var I = {
  8650. init: function(e) {
  8651. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8652. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8653. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8654. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8655. u.addEventListener("click", this.toggle.bind(this)),
  8656. p.addEventListener("click", this.hide.bind(this)),
  8657. v.addEventListener("click", r),
  8658. d.addEventListener("click", o),
  8659. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8660. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8661. m.addEventListener("click", n.bind(this, y.MAIL)),
  8662. v.textContent = window.location.href + "&utm_source=4",
  8663. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8664. u.classList.remove("hidden")
  8665. },
  8666. show: function() {
  8667. this.emit(l.OPENED),
  8668. d.classList.add("fadeIn")
  8669. },
  8670. hide: function() {
  8671. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8672. document.selection && document.selection.empty(),
  8673. window.getSelection().removeAllRanges(),
  8674. o(),
  8675. d.classList.remove("fadeIn"))
  8676. },
  8677. toggle: function() {
  8678. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8679. }
  8680. };
  8681. c.extendObject(I, h.prototype),
  8682. t.exports = I
  8683. }
  8684. , {
  8685. "../../localization/localize": 108,
  8686. "../../util/browser": 182,
  8687. "../../util/common": 185,
  8688. "./ShareEvents": 76,
  8689. events: 202
  8690. }],
  8691. 78: [function(e, t, i) {
  8692. "use strict";
  8693. t.exports = Object.freeze({
  8694. OPENED: "terms.opened",
  8695. CLOSED: "terms.closed"
  8696. })
  8697. }
  8698. , {}],
  8699. 79: [function(e, t, i) {
  8700. "use strict";
  8701. var n = e("./TermsEvent")
  8702. , r = e("../../localization/localize")
  8703. , o = e("../../analytics")
  8704. , a = e("../../util/ajax")
  8705. , s = e("../../util/common")
  8706. , l = e("events").EventEmitter
  8707. , c = document.getElementById("terms-modal")
  8708. , h = {
  8709. init: function() {
  8710. $(".footer-terms").on("click", function(e) {
  8711. e.preventDefault(),
  8712. this.show()
  8713. }
  8714. .bind(this)),
  8715. $("#terms-modal .close").on("click", this.hide.bind(this))
  8716. },
  8717. show: function() {
  8718. this.emit(n.OPENED),
  8719. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8720. var t = $("#terms-text").html(e);
  8721. o.track("showcase_gui", {
  8722. gui_action: "click_terms_button",
  8723. interaction_source: "gui"
  8724. }),
  8725. t.find("a").attr("target", "_blank")
  8726. }).fail(function() {
  8727. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8728. }),
  8729. c.classList.add("fadeIn")
  8730. },
  8731. hide: function(e) {
  8732. e && e.preventDefault(),
  8733. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8734. c.classList.remove("fadeIn")
  8735. }
  8736. };
  8737. s.extendObject(h, l.prototype),
  8738. t.exports = h
  8739. }
  8740. , {
  8741. "../../analytics": 4,
  8742. "../../localization/localize": 108,
  8743. "../../util/ajax": 181,
  8744. "../../util/common": 185,
  8745. "./TermsEvent": 78,
  8746. events: 202
  8747. }],
  8748. 80: [function(e, t, i) {
  8749. "use strict";
  8750. t.exports = Object.freeze({
  8751. OPEN_INFO: "title.open.info",
  8752. CLOSE_INFO: "title.close.info",
  8753. SHOW_INFO: "title.show.info",
  8754. HIDE_INFO: "title.hide.info",
  8755. LINK_CLICKED: "title.link.click",
  8756. CONTACT_LINK_CLICKED: "title.contact.click",
  8757. ORIGIN_LINK_CLICKED: "title.origin.click"
  8758. })
  8759. }
  8760. , {}],
  8761. 81: [function(e, t, i) {
  8762. "use strict";
  8763. function n(e, t) {
  8764. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8765. }
  8766. function r(e, t) {
  8767. function i(i) {
  8768. e.shouldShowtags = "show" === this.value,
  8769. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8770. }
  8771. document.getElementById("tag-toggles").classList.remove("hidden"),
  8772. document.getElementById("radio-tag-show").checked = !0;
  8773. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8774. n[r].addEventListener("change", i)
  8775. }
  8776. var o = e("../../settings");
  8777. t.exports.init = n
  8778. }
  8779. , {
  8780. "../../settings": 166
  8781. }],
  8782. 82: [function(e, t, i) {
  8783. (function(i) {
  8784. "use strict";
  8785. function n(e, t) {
  8786. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8787. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8788. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8789. document.getElementById("gui-name").classList.add("noCoBrand"),
  8790. document.getElementById("cobrandTitle").classList.add("hidden")),
  8791. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8792. !1)
  8793. }
  8794. function r(e) {
  8795. return e ? (L = !0,
  8796. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8797. }
  8798. function o(e, t, i, n) {
  8799. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8800. return void T.classList.add("hidden");
  8801. L = !0;
  8802. var r = []
  8803. , o = c(r, "<br>");
  8804. if (e && o('<span id="contactName">' + e + "</span>"),
  8805. t) {
  8806. var a = n || t
  8807. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8808. o(s)
  8809. }
  8810. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8811. r[0] = "",
  8812. x.innerHTML = r.join("")
  8813. }
  8814. function a(e) {
  8815. if ("string" == typeof e)
  8816. try {
  8817. e = JSON.parse(e)
  8818. } catch (e) {
  8819. return y.warn("Unable to parse address data"),
  8820. void S.parentElement.classList.add("hidden")
  8821. }
  8822. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8823. return void S.parentElement.classList.add("hidden");
  8824. L = !0;
  8825. var t = []
  8826. , i = c(t, " ");
  8827. e.address_1 && i(e.address_1),
  8828. e.address_2 && i(e.address_2),
  8829. e.city && i(e.city, ", "),
  8830. e.state && i(e.state, ", "),
  8831. e.zip && i(e.zip, e.state ? " " : ", "),
  8832. t[0] = "",
  8833. S.innerText = t.join("")
  8834. }
  8835. function s(e) {
  8836. var t = document.createElement("a");
  8837. return t.id = "url",
  8838. t.target = "_blank",
  8839. t.href = e,
  8840. t.innerText = e,
  8841. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8842. t
  8843. }
  8844. function l(e) {
  8845. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8846. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8847. P.appendChild(s(e)),
  8848. O.forEach(function(e) {
  8849. e.classList.add("share-link")
  8850. }),
  8851. !0)
  8852. }
  8853. function c(e, t) {
  8854. var i = e
  8855. , n = t;
  8856. return function(e, t) {
  8857. i.push(t || n, e)
  8858. }
  8859. }
  8860. function h() {
  8861. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8862. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8863. var e = [].slice.call(_.querySelectorAll("a"));
  8864. e.forEach(function(e) {
  8865. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8866. });
  8867. var t = [].slice.call(T.querySelectorAll("a"));
  8868. t.forEach(function(e) {
  8869. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8870. contact_type: e.getAttribute("id")
  8871. }))
  8872. })
  8873. }
  8874. var u = e("../../util/browser")
  8875. , d = e("../../util/common")
  8876. , p = e("../../util/logger")
  8877. , f = e("../../localization/localize")
  8878. , g = e("./titleBarSettings")
  8879. , m = e("../../settings")
  8880. , v = e("./TitleEvents")
  8881. , A = e("events").EventEmitter
  8882. , y = new p(i)
  8883. , C = document.querySelector(".pinTop.left")
  8884. , I = document.getElementsByClassName("title-container")[0]
  8885. , E = document.getElementById("title-toggle").querySelector("i")
  8886. , b = document.getElementById("meta-info-wrapper")
  8887. , w = document.getElementById("meta-info")
  8888. , _ = document.getElementById("meta-description")
  8889. , T = document.getElementsByClassName("contact-info")[0]
  8890. , x = document.getElementById("contact-data")
  8891. , S = document.getElementById("addressTxt")
  8892. , M = document.getElementById("tag-toggles")
  8893. , R = document.getElementById("share-origin")
  8894. , P = document.getElementById("share-link-wrapper")
  8895. , O = [w, b, I]
  8896. , L = !1
  8897. , D = !1
  8898. , N = {
  8899. populate: function(e) {
  8900. if (n(window.DATA.name, e.coBrand)) {
  8901. if (r(e.description),
  8902. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8903. a(e.address),
  8904. L) {
  8905. var t = document.createElement("br");
  8906. M.insertBefore(t, M.firstElementChild)
  8907. }
  8908. e.socialSharing && m.share.enabled && (D = l(e.url))
  8909. }
  8910. },
  8911. finishSetup: function(e) {
  8912. L = L || !!e,
  8913. h(),
  8914. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8915. },
  8916. toggleMeta: function(e, t) {
  8917. var title = document.getElementById("model-title");
  8918. t && t.preventDefault();
  8919. var i = w.classList.contains("expand");
  8920. e && !i || (i ? (O.forEach(function(e) {
  8921. e.classList.remove("expand")
  8922. }),
  8923. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8924. e.classList.add("expand");
  8925. }),
  8926. title.classList.add("expand"),
  8927. this.emit(v.OPEN_INFO)))
  8928. },
  8929. setupToggling: function() {
  8930. b.style.height = w.offsetHeight + "px",
  8931. w.addEventListener("transitionend", function() {
  8932. b.style.height = w.offsetHeight + "px"
  8933. })
  8934. },
  8935. toggleTitle: function(e) {
  8936. e && e.preventDefault(),
  8937. C.classList.contains("closed") ? (C.classList.add("open"),
  8938. E.classList.remove("icon-dpad-right"),
  8939. E.classList.add("icon-dpad-left"),
  8940. this.emit(v.SHOW_INFO),
  8941. setTimeout(function() {
  8942. C.classList.remove("closed"),
  8943. C.classList.remove("open")
  8944. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8945. E.classList.remove("icon-dpad-left"),
  8946. E.classList.add("icon-dpad-right"),
  8947. this.emit(v.HIDE_INFO))
  8948. }
  8949. };
  8950. d.extendObject(N, A.prototype),
  8951. t.exports = N
  8952. }
  8953. ).call(this, "/js/gui/title/titleBar.js")
  8954. }
  8955. , {
  8956. "../../localization/localize": 108,
  8957. "../../settings": 166,
  8958. "../../util/browser": 182,
  8959. "../../util/common": 185,
  8960. "../../util/logger": 189,
  8961. "./TitleEvents": 80,
  8962. "./titleBarSettings": 83,
  8963. events: 202
  8964. }],
  8965. 83: [function(e, t, i) {
  8966. "use strict";
  8967. t.exports = Object.freeze({
  8968. minTooltipCharacters: 19,
  8969. removeAnimationClasses: 500
  8970. })
  8971. }
  8972. , {}],
  8973. 84: [function(e, t, i) {
  8974. "use strict";
  8975. function n(e) {
  8976. C = e,
  8977. P.forEach(function(e) {
  8978. b.addEventListener(e, u.bind(this, !1), !0),
  8979. w.addEventListener(e, u.bind(this, !0), !0),
  8980. E.addEventListener(e, o, !0)
  8981. /* S.forEach(function(t) {//会触发导览停止
  8982. t.addEventListener(e, a, !0)
  8983. }) */
  8984. $("#drawer img").on(e, a)
  8985. })
  8986. document.addEventListener("keydown", u.bind(this, !1), !0)
  8987. C.on(v.TourStart, function() {
  8988. E.classList.add("playing")
  8989. })
  8990. }
  8991. function r() {
  8992. C.playTour(),
  8993. I && clearTimeout(I),
  8994. d(),
  8995. _.removeClass("fadeIn")
  8996. }
  8997. function o() {
  8998. E.classList.contains("playing") && (C.stopTour(),
  8999. _.addClass("fadeIn"),
  9000. setTimeout(function() {
  9001. _.removeClass("fadeIn")
  9002. }, p.tourInteraction.showPauseButton),
  9003. O || (clearTimeout(I),
  9004. I = setTimeout(h, p.tourInteraction.showModal)),
  9005. setTimeout(function() {
  9006. E.classList.remove("playing")
  9007. }, p.tourInteraction.allowNextClick))
  9008. }
  9009. function a() {
  9010. // 周恩光 在自动导览时拖动导览片段触发,会暂停自动导览
  9011. C.tourInProgress && (
  9012. // C.stopTour(),
  9013. C.endTourProgress(),
  9014. E.classList.remove("playing"))
  9015. }
  9016. function s() {
  9017. T.is(":visible") ? r() : o()
  9018. }
  9019. function l() {
  9020. x.hasClass("playing") && (clearTimeout(I),
  9021. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  9022. }
  9023. function c() {
  9024. E.classList.remove("playing"),
  9025. h()
  9026. }
  9027. function h() {//去掉导览结束时的提示
  9028. /* if (!p.tourInteraction.disabled) {
  9029. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9030. M.addClass("fadeIn tour " + m.deviceType);
  9031. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9032. if (!p.tourInteraction.smallModal) {
  9033. var t;
  9034. 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,
  9035. m.fill(R, A.TOUR_INTERACTION[t]),
  9036. M.addClass(t)
  9037. }
  9038. M.addClass(e)
  9039. } */
  9040. }
  9041. function u(e, t) {
  9042. if(window.myKeyBlank) return
  9043. if (t) {
  9044. var i = "keydown" === t.type
  9045. , n = t.which === f.SPACE || C.tourIsPlaying;
  9046. i && n || e || (O = !0),
  9047. C.atEndOfTour() && d(),
  9048. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  9049. d(),
  9050. t.which !== f.SPACE && a()),
  9051. i && n && s()
  9052. }
  9053. }
  9054. function d() {
  9055. M.removeClass("fadeIn")
  9056. }
  9057. var p = (e("../util/browser"),
  9058. e("../settings"))
  9059. , f = e("../enum/Keys")
  9060. , g = e("../enum/Viewmode")
  9061. , m = (e("./helpManager"),
  9062. e("./populateModal"))
  9063. , v = e("../enum/DirectorEvents")
  9064. , A = e("../enum/HelpModalType")
  9065. , y = e("../enum/HelpModalSize")
  9066. , C = null
  9067. , I = null
  9068. , E = document.getElementById("pause-overlay")
  9069. , b = document.getElementById("player")
  9070. , w = document.getElementById("gui")
  9071. , _ = $("#pause-icon").eq(0)
  9072. , T = $("#play").eq(0)
  9073. , x = $("#playHead").eq(0)
  9074. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9075. , M = $("#interaction-modal").eq(0)
  9076. , R = $("#interaction-modal .interaction").toArray()
  9077. , P = ["touchstart", "mousedown", "pointerdown"]
  9078. , O = !1;
  9079. t.exports.init = n,
  9080. t.exports.play = r,
  9081. t.exports.pause = o,
  9082. t.exports.pauseWithoutCTA = a,
  9083. t.exports.togglePlay = s,
  9084. t.exports.stopTour = l,
  9085. t.exports.dismissModal = d
  9086. }
  9087. , {
  9088. "../enum/DirectorEvents": 23,
  9089. "../enum/HelpModalSize": 27,
  9090. "../enum/HelpModalType": 28,
  9091. "../enum/Keys": 30,
  9092. "../enum/Viewmode": 51,
  9093. "../settings": 166,
  9094. "../util/browser": 182,
  9095. "./helpManager": 68,
  9096. "./populateModal": 75
  9097. }],
  9098. 85: [function(e, t, i) {
  9099. "use strict";
  9100. t.exports = Object.freeze({
  9101. OPENED: "vr.modal.opened",
  9102. LAUNCH: "vr.modal.launch",
  9103. CLOSED: "vr.modal.closed",
  9104. NEXT: "vr.modal.next",
  9105. PREV: "vr.modal.prev",
  9106. STORE: "vr.modal.store",
  9107. falseICECHOSEN: "vr.modal.device"
  9108. })
  9109. }
  9110. , {}],
  9111. 86: [function(e, t, i) {
  9112. "use strict";
  9113. function n(e, t, i) {
  9114. function n(e, t, n, r) {
  9115. function o() {
  9116. return p + "&m=" + t + "&display=" + e
  9117. }
  9118. function s() {
  9119. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9120. , t = "&utm_source=" + u
  9121. , n = "&utm_showcase_session_id=" + i;
  9122. return e + t + n
  9123. }
  9124. function l() {
  9125. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9126. }
  9127. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9128. }
  9129. function r(e, t, i, r) {
  9130. var o = "https://api.branch.io/v1/url"
  9131. , a = n(e, t, i, r)
  9132. , s = {
  9133. responseType: "json",
  9134. data: {
  9135. branch_key: h.appConfig.branch_key,
  9136. data: {
  9137. m: t,
  9138. full_url: a,
  9139. $desktop_url: m,
  9140. $og_app_id: "331853976762864119",
  9141. $og_title: i,
  9142. $og_description: r,
  9143. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9144. $canonical_url: window.location.href
  9145. }
  9146. }
  9147. };
  9148. c.post(o, s).done(function(t) {
  9149. f[e] = t.url
  9150. }).fail(function(t) {
  9151. f[e] = t
  9152. }
  9153. .bind(this, a))
  9154. }
  9155. function o(e, t, i) {
  9156. for (var r in s) {
  9157. var o = s[r]
  9158. , a = n(o, e, t, i);
  9159. f[o] = a
  9160. }
  9161. }
  9162. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9163. , d = g + "/vr/dlist/?ret=" + u
  9164. , p = g + "/vr/show/?ret=" + u
  9165. , m = "";
  9166. switch (e) {
  9167. case l.IOS:
  9168. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9169. break;
  9170. default:
  9171. o(t.sid, t.name, t.summary)
  9172. }
  9173. }
  9174. function r(e) {
  9175. var t = f[e];
  9176. window.open(t, "_blank")
  9177. }
  9178. function o(e) {
  9179. var t = u[e];
  9180. window.open(t, "_blank")
  9181. }
  9182. var a = e("../../util/browser")
  9183. , s = e("../../enum/VRApps")
  9184. , l = e("../../enum/VRPlatforms")
  9185. , c = e("../../util/ajax")
  9186. , h = e("../../settings")
  9187. , u = {};
  9188. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9189. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9190. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9191. for (var d in s) {
  9192. var p = s[d];
  9193. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9194. }
  9195. var f = {}
  9196. , g = function() {
  9197. var e = window.location.host;
  9198. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9199. "https://" + e
  9200. }();
  9201. t.exports.init = n,
  9202. t.exports.launch = r,
  9203. t.exports.launchStore = o
  9204. }
  9205. , {
  9206. "../../enum/VRApps": 46,
  9207. "../../enum/VRPlatforms": 49,
  9208. "../../settings": 166,
  9209. "../../util/ajax": 181,
  9210. "../../util/browser": 182
  9211. }],
  9212. 87: [function(e, t, i) {
  9213. "use strict";
  9214. function n(e) {
  9215. var t;
  9216. switch (e) {
  9217. case m.IOS:
  9218. return t = p.iosVersion(),
  9219. t.major > 9 || 9 === t.major && t.minor >= 1;
  9220. case m.Android:
  9221. return t = p.androidVersion(),
  9222. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9223. }
  9224. return !1
  9225. }
  9226. function r(e, t) {
  9227. function i(e) {
  9228. K.emit(A.STORE, {
  9229. type: e
  9230. }),
  9231. f.launchStore(e)
  9232. }
  9233. function r(e) {
  9234. switch (e !== _.pageCount && (a(e),
  9235. N.text(e + 1 + " / " + _.pageCount)),
  9236. e) {
  9237. case _.Title:
  9238. O.css("display", "none"),
  9239. L.text(u[e]),
  9240. o(s);
  9241. break;
  9242. case _.Cardboard:
  9243. O.css("display", "block"),
  9244. L.text(u[e]),
  9245. M.filter(".cardboard").off(),
  9246. M.filter(".gearvr").off(),
  9247. c(e, s),
  9248. h(H, X, Z);
  9249. break;
  9250. case _.Gear:
  9251. L.text(u[e]),
  9252. c(e, s),
  9253. T.addClass("lastPage"),
  9254. h(G, X, Z);
  9255. break;
  9256. case _.pageCount:
  9257. T.removeClass("fadeIn"),
  9258. K.emit(A.CLOSED)
  9259. }
  9260. B.filter("[src='']").hide()
  9261. }
  9262. var s = function() {
  9263. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9264. w = ".show-supported",
  9265. m.Android) : (T.addClass("unsupported"),
  9266. w = ".show-unsupported",
  9267. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9268. w = ".show-ios",
  9269. _ = v.ios,
  9270. m.IOS) : (T.addClass("desktop"),
  9271. w = ".show-desktop",
  9272. m.Desktop)
  9273. }();
  9274. f.init(s, e, t),
  9275. s !== m.Desktop && T.addClass("mobile");
  9276. var l = function(e) {
  9277. K.emit(A.LAUNCH, {
  9278. vr_platform: s,
  9279. vr_app: e
  9280. }),
  9281. f.launch(e)
  9282. };
  9283. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9284. q.gear = l.bind(this, g.GearVR),
  9285. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9286. d(),
  9287. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9288. $(w).show();
  9289. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9290. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9291. s === m.IOS && (u.splice(1, 1),
  9292. y.splice(1, 1)),
  9293. $("#vr").on("click", function(e) {
  9294. e.preventDefault();
  9295. player.FlyToMode("panorama", ()=>{
  9296. if(!window.vrEnabled) { // 开启VR
  9297. window.vrEnabled = true;
  9298. this.classList.add('active');
  9299. $('#gui div').not('#vrOff').addClass('vrHide');
  9300. $('#vrOffImg').css({'display':'inline-block'});
  9301. }else{
  9302. }
  9303. })
  9304. });
  9305. $('#vrOff').on('click', function(){
  9306. window.vrEnabled = false;
  9307. $('#gui div').not('#vrOff').removeClass('vrHide');
  9308. $('#vrOffImg').css({'display':'none'});
  9309. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9310. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9311. })
  9312. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9313. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9314. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9315. $("span.modelLink").text(I),
  9316. O.on("click", function(e) {
  9317. K.emit(A.PREV),
  9318. b--,
  9319. r(b)
  9320. }),
  9321. L.on("click", function(e) {
  9322. L.text();
  9323. K.emit(A.NEXT, {
  9324. nextAction: y[b]
  9325. }),
  9326. b++,
  9327. r(b)
  9328. }),
  9329. T.find(".close").on("click", K.dismiss)
  9330. }
  9331. function o(e) {
  9332. switch (e) {
  9333. case m.Android:
  9334. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9335. M.filter(".gearvr").off().on("click", q.gear),
  9336. s(H, G, "logo-button", "same-line");
  9337. break;
  9338. case m.UnsupportedAndroid:
  9339. s("", z, "", "");
  9340. break;
  9341. case m.IOS:
  9342. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9343. s(H, "", "logo-button", "");
  9344. break;
  9345. case m.Desktop:
  9346. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9347. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9348. s(H, G, "logo-button", "same-line"),
  9349. Q.cardboard()
  9350. }
  9351. }
  9352. function a(e) {
  9353. $(".p1, .p2, .p3").hide(),
  9354. x.insertAfter(S),
  9355. T.removeClass("front-page"),
  9356. T.removeClass("details-page"),
  9357. T.removeClass("lastPage"),
  9358. M.removeClass("logo-button"),
  9359. M.removeClass("same-line"),
  9360. S.removeClass("headsetOptions"),
  9361. R.attr("src", ""),
  9362. R.filter(".second").removeClass("gear"),
  9363. R.css("display", "inline-block"),
  9364. R.off(),
  9365. P.filter(".second").css("display", ""),
  9366. D.css("display", "none"),
  9367. $(".p" + (e + 1) + w).show(),
  9368. R.filter(".third").insertBefore(P.filter(".third"))
  9369. }
  9370. function s(e, t, i, n) {
  9371. T.addClass("front-page"),
  9372. R.filter(".first").attr("src", e),
  9373. R.filter(".second").attr("src", t),
  9374. M.filter(".first").addClass(i),
  9375. M.filter(".second").addClass(i),
  9376. M.addClass(n),
  9377. ".show-desktop" === w && S.insertAfter(x)
  9378. }
  9379. function l(e, t, i) {
  9380. S.addClass("headsetOptions"),
  9381. M.off(),
  9382. R.filter(".second").attr("src", t),
  9383. D.css("display", "block"),
  9384. P.filter(".second").css("display", "none"),
  9385. D.on("click", function() {
  9386. a(_.Title),
  9387. o(m.Desktop)
  9388. }),
  9389. e && (K.emit(A.falseICECHOSEN, {
  9390. name: g.GearVR
  9391. }),
  9392. R.filter(".first").attr("src", e),
  9393. R.filter(".second").addClass("gear"),
  9394. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9395. Q.gearvr()),
  9396. i && (K.emit(A.falseICECHOSEN, {
  9397. name: g.Cardboard
  9398. }),
  9399. R.filter(".third").attr("src", i),
  9400. R.filter(".third").show(),
  9401. R.filter(".third").insertAfter(R.filter(".second")),
  9402. R.filter(".third").addClass("link"),
  9403. R.filter(".second").addClass("link"),
  9404. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9405. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9406. Q.cardboard())
  9407. }
  9408. function c(e, t) {
  9409. switch (t) {
  9410. case m.IOS:
  9411. X = Y,
  9412. Z = j;
  9413. break;
  9414. case m.Desktop:
  9415. e === _.Cardboard ? (X = F,
  9416. Z = U,
  9417. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9418. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9419. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9420. Z = "");
  9421. break;
  9422. default:
  9423. e === _.Cardboard ? (X = z,
  9424. Z = j) : (X = k,
  9425. Z = W)
  9426. }
  9427. }
  9428. function h(e, t, i) {
  9429. T.find(".inner").addClass("details-page"),
  9430. T.addClass("details-page"),
  9431. R.filter(".first").attr("src", e),
  9432. R.filter(".second").attr("src", t),
  9433. R.filter(".third").attr("src", i)
  9434. }
  9435. function u() {
  9436. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9437. K.emit(A.CLOSED))
  9438. }
  9439. function d() {
  9440. var e = p.aspectRatio() > 1 && p.isMobile();
  9441. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9442. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9443. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9444. }
  9445. var p = e("../../util/browser")
  9446. , f = e("./vrLink")
  9447. , g = e("../../enum/VRApps")
  9448. , m = e("../../enum/VRPlatforms")
  9449. , v = e("../../enum/VRPages")
  9450. , A = e("./vrEvent")
  9451. , y = (e("../../settings"),
  9452. e("../../constants"))
  9453. , C = e("../../localization/localize")
  9454. , I = e("../../util/common")
  9455. , E = e("events").EventEmitter
  9456. , b = 0
  9457. , w = null
  9458. , _ = v.standard
  9459. , T = $(".vr-popup")
  9460. , x = T.find(".vr-popup-body")
  9461. , S = T.find(".vr-images")
  9462. , M = T.find(".img-container")
  9463. , R = T.find(".vr-sm-image")
  9464. , P = M.find(".vr-img-caption")
  9465. , O = $(".vr-buttons").find(".prev-button")
  9466. , L = $(".vr-buttons").find(".next-button")
  9467. , D = S.find(".front-close")
  9468. , N = $(".vr-page")
  9469. , B = T.find("img")
  9470. , F = "static/images/apple-store.png"
  9471. , V = "static/images/badge-oculus.png"
  9472. , U = "static/images/badge-cardboard.png"
  9473. , k = "static/images/logo-samsung.png"
  9474. , H = "static/images/headset-cardboard.png"
  9475. , G = "static/images/headset-gearvr.png"
  9476. , z = "static/images/ico-android-robot.png"
  9477. , W = "static/images/ico-gearvr.png"
  9478. , j = "static/images/ico-vr.png"
  9479. , Y = "static/images/apple-logo-white.svg"
  9480. , X = null
  9481. , Z = null
  9482. , q = {}
  9483. , K = {
  9484. init: r,
  9485. dismiss: u,
  9486. isDeviceSupported: n
  9487. };
  9488. I.extendObject(K, E.prototype),
  9489. $(window).resize(d);
  9490. var Q = function() {
  9491. var e = P.filter(".first").find(".cardboard")
  9492. , t = P.filter(".first").find(".gearvr");
  9493. return {
  9494. cardboard: function() {
  9495. t.addClass("hidden"),
  9496. e.removeClass("hidden")
  9497. },
  9498. gearvr: function() {
  9499. e.addClass("hidden"),
  9500. t.removeClass("hidden")
  9501. }
  9502. }
  9503. }();
  9504. t.exports = K
  9505. }
  9506. , {
  9507. "../../constants": 8,
  9508. "../../enum/VRApps": 46,
  9509. "../../enum/VRPages": 48,
  9510. "../../enum/VRPlatforms": 49,
  9511. "../../localization/localize": 108,
  9512. "../../settings": 166,
  9513. "../../util/browser": 182,
  9514. "../../util/common": 185,
  9515. "./vrEvent": 85,
  9516. "./vrLink": 86,
  9517. events: 202
  9518. }],
  9519. 88: [function(e, t, i) {
  9520. "use strict";
  9521. t.exports = Object.freeze({
  9522. OPENED: "webvr.modal.opened",
  9523. SHOW_TERMS: "webvr.footer.show.terms"
  9524. })
  9525. }
  9526. , {}],
  9527. 89: [function(e, t, i) {
  9528. (function(i) {
  9529. "use strict";
  9530. function n(e, t, i, n) {
  9531. function r(e) {
  9532. e.preventDefault(),
  9533. a(e.currentTarget.id)
  9534. }
  9535. function a(e) {
  9536. ne[e](),
  9537. Object.keys(ne).map(function(t, i) {
  9538. $("#" + t).toggleClass("tabs-underlined", t === e)
  9539. })
  9540. }
  9541. y = i,
  9542. v = t,
  9543. w.init(E.Android, e, n),
  9544. m();
  9545. var l = new RegExp("daydream","i")
  9546. , c = l.test(y.displayName);
  9547. c ? (a("tabdaydream"),
  9548. B.filter(".device-headset-side").attr("src", H),
  9549. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9550. B.filter(".device-headset-side").attr("src", Y),
  9551. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9552. $("#vr").on("click", function(e) {
  9553. e.preventDefault(),
  9554. g("click_webvr_button"),
  9555. L.is(":hidden") && (ie.emit(_.OPENED),
  9556. o())
  9557. }),
  9558. $(".webvr-popup .close").on("click", function(e) {
  9559. e.preventDefault(),
  9560. D.hasClass("hidden") ? (g("webvr_help_close"),
  9561. p()) : s()
  9562. }),
  9563. $("#tabcardboard").on("click", r),
  9564. $("#tabdaydream").on("click", r),
  9565. $("#tabnative").on("click", r),
  9566. $(".webvr-popup .open-with-app").on("click", function(e) {
  9567. e.preventDefault(),
  9568. g("webvr_learn_more"),
  9569. a("tabnative"),
  9570. p()
  9571. }),
  9572. $(".webvr-popup .help").on("click", function(e) {
  9573. e.preventDefault(),
  9574. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9575. p()
  9576. }),
  9577. $(".webvr-popup .terms").on("click", function(e) {
  9578. e.preventDefault(),
  9579. g("webvr_click_terms"),
  9580. s(),
  9581. ie.emit(_.SHOW_TERMS)
  9582. }),
  9583. F.on("click", function(e) {
  9584. e.preventDefault(),
  9585. g(ee),
  9586. window.open(J, "_blank")
  9587. }),
  9588. V.on("click", function(e) {
  9589. e.preventDefault(),
  9590. g("webvr_phone_link"),
  9591. window.open(te, "_blank")
  9592. }),
  9593. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9594. e.preventDefault(),
  9595. g("webvr_cardboard_link"),
  9596. w.launch(b.CardboardAndroid)
  9597. }),
  9598. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9599. e.preventDefault(),
  9600. g("webvr_oculus_link"),
  9601. w.launch(b.GearVR)
  9602. })
  9603. }
  9604. function r() {
  9605. function e() {
  9606. y.isPresenting || (f(),
  9607. window.removeEventListener("vrdisplaypresentchange", e))
  9608. }
  9609. R.info("Headset mounted"),
  9610. v.suspend();
  9611. var t = document.createElement("canvas");
  9612. for (t.getContext("webgl"),
  9613. t.className = "webvr-canvas",
  9614. document.bgColor = "#000",
  9615. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9616. document.body.removeChild(document.body.firstChild);
  9617. document.body.appendChild(t),
  9618. g("webvr_enter_app"),
  9619. y.requestPresent([{
  9620. source: t,
  9621. predistorted: !0
  9622. }]).catch(function(t) {
  9623. R.error("Failed to present: " + t),
  9624. g("webvr_exit_calibrate"),
  9625. e()
  9626. }),
  9627. A.then(function() {
  9628. window.dispatchEvent(new Event("vrapp-start"))
  9629. }),
  9630. window.addEventListener("vrdisplaypresentchange", e)
  9631. }
  9632. function o() {
  9633. O.fadeOut(I.guiAnimationSpeed),
  9634. L.fadeIn(I.guiAnimationSpeed),
  9635. a()
  9636. }
  9637. function a() {
  9638. if (!A) {
  9639. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9640. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9641. A = new Promise(function(e, i) {
  9642. var n = document.createElement("script");
  9643. n.type = "text/javascript",
  9644. n.src = t,
  9645. n.onload = e,
  9646. document.head.appendChild(n)
  9647. }
  9648. )
  9649. }
  9650. D.find(".enter-button").on("click", r)
  9651. }
  9652. function s() {
  9653. g("webvr_modal_close"),
  9654. D.find(".enter-button").off("click", r),
  9655. L.fadeOut(I.guiAnimationSpeed, function() {
  9656. D.toggleClass("hidden", !1),
  9657. N.toggleClass("hidden", !0),
  9658. C.exitFullscreen()
  9659. }),
  9660. O.fadeIn(I.guiAnimationSpeed)
  9661. }
  9662. function l() {
  9663. k.toggleClass("hidden", !1),
  9664. U.toggleClass("hidden", !0)
  9665. }
  9666. function c() {
  9667. k.toggleClass("hidden", !0),
  9668. U.toggleClass("hidden", !1)
  9669. }
  9670. function h() {
  9671. B.filter(".device-headset").attr("src", G),
  9672. B.filter(".device-phone").attr("src", z),
  9673. J = Z,
  9674. ee = K,
  9675. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9676. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9677. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9678. c()
  9679. }
  9680. function u() {
  9681. B.filter(".badge-cardboard").attr("src", j),
  9682. B.filter(".badge-oculus").attr("src", X),
  9683. l()
  9684. }
  9685. function d() {
  9686. B.filter(".device-headset").attr("src", Y),
  9687. B.filter(".device-phone").attr("src", W),
  9688. J = q,
  9689. ee = Q,
  9690. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9691. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9692. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9693. c()
  9694. }
  9695. function p() {
  9696. D.toggleClass("hidden"),
  9697. N.toggleClass("hidden")
  9698. }
  9699. function f() {
  9700. R.info("exiting webVR"),
  9701. g("webvr_exit_app"),
  9702. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9703. }
  9704. function g(e) {
  9705. var t = C.isLandscape() ? "landscape" : "portrait";
  9706. T.trackAlways("showcase_gui", {
  9707. gui_action: e,
  9708. orientation: t
  9709. })
  9710. }
  9711. function m() {
  9712. var e = C.isLandscape();
  9713. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9714. }
  9715. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9716. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9717. 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 = "static/images/device-daydream-side.png", G = "static/images/device-daydream.png", z = "static/images/device-pixel.png", W = "static/images/ico-android-robot.png", j = "static/images/badge-cardboard.png", Y = "static/images/headset-cardboard.png", X = "static/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 = {
  9718. init: n
  9719. }, ne = {
  9720. tabcardboard: d,
  9721. tabdaydream: h,
  9722. tabnative: u
  9723. };
  9724. S.extendObject(ie, P.prototype),
  9725. $(window).resize(m),
  9726. t.exports = ie
  9727. }
  9728. ).call(this, "/js/gui/webvr/webVRgui.js")
  9729. }
  9730. , {
  9731. "../../analytics": 4,
  9732. "../../constants": 8,
  9733. "../../enum/VRApps": 46,
  9734. "../../enum/VRPlatforms": 49,
  9735. "../../localization/localize": 108,
  9736. "../../settings": 166,
  9737. "../../util/browser": 182,
  9738. "../../util/common": 185,
  9739. "../../util/logger": 189,
  9740. "./../gui": 65,
  9741. "./../vr/vrLink": 86,
  9742. "./WebVrEvent": 88,
  9743. events: 202
  9744. }],
  9745. 90: [function(e, t, i) {
  9746. "use strict";
  9747. function n(e, t, i, n, o) {
  9748. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9749. this.roomId = o || "",
  9750. this.labelId = e,
  9751. this.position = (new r.Vector3).copy(t),
  9752. this.text = i
  9753. }
  9754. var r = e("three")
  9755. , o = e("../util/browser");
  9756. n.prototype.build = function() {
  9757. var e = window.document.createElement("div");
  9758. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9759. var t = window.document.createElement("div");
  9760. t.setAttribute("class", "gui-floorplan-label-text");
  9761. var i = window.document.createTextNode(this.text);
  9762. t.appendChild(i),
  9763. e.appendChild(t),
  9764. window.document.body.appendChild(e),
  9765. this.labelGui = e,
  9766. this.textBlock = t,
  9767. $(this.labelGui).hide();
  9768. var n = window.getComputedStyle(this.labelGui);
  9769. this.initialTransform = n.transform || n.webkitTransform
  9770. }
  9771. ,
  9772. t.exports = n
  9773. }
  9774. , {
  9775. "../util/browser": 182,
  9776. three: 217
  9777. }],
  9778. 91: [function(e, t, i) {
  9779. "use strict";
  9780. function n() {
  9781. this.player = null,
  9782. this.modelManager = null,
  9783. this.container = null
  9784. }
  9785. var r = e("three")
  9786. , o = (e("../util/common"),
  9787. e("../enum/PlayerEvents"))
  9788. , a = (e("../enum/DirectorEvents"),
  9789. e("../enum/ModelManagerEvents"))
  9790. , s = e("../settings")
  9791. , l = e("../enum/Viewmode")
  9792. , c = (e("../enum/WarpStyle"),
  9793. e("../util/transitions"),
  9794. e("../util/lerp"),
  9795. e("../util/browser"));
  9796. //场景初始化
  9797. n.prototype.init = function(e, t, i) {
  9798. this.player = e,
  9799. this.modelManager = t,
  9800. this.container = i,
  9801. this.updateModel(),
  9802. this.bindEvents()
  9803. }
  9804. ,
  9805. n.prototype.bindEvents = function() {
  9806. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9807. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9808. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9809. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9810. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9811. }
  9812. ,
  9813. n.prototype.updateModel = function() {
  9814. this.model = this.modelManager.getActiveModel()
  9815. }
  9816. ,
  9817. n.prototype.handlePlayerViewChanged = function() {
  9818. this.updateLabelVisibility(),
  9819. this.updateLabelDisplay()
  9820. }
  9821. ,
  9822. n.prototype.getLabelsForFloor = function(e, t) {
  9823. return t = t || [],
  9824. t.length = 0,
  9825. this.model.labels.forEach(function(i) {
  9826. this.labelVisibleForFloor(i, e) && t.push(i)
  9827. }
  9828. .bind(this)),
  9829. t
  9830. }
  9831. ,
  9832. n.prototype.getLabelsForCurrentFloor = function(e) {
  9833. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9834. }
  9835. ,
  9836. n.prototype.labelVisibleForFloor = function(e, t) {
  9837. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9838. if (!this.model.showingLabels || !e.labelGui || !i)
  9839. return !1;
  9840. var n = e.floorId === this.model.floors.size() - 1;
  9841. return this.model.allFloorsVisible ? n : e.floorId === t
  9842. }
  9843. ,
  9844. n.prototype.updateLabelVisibility = function(e) {
  9845. this.model.labels.forEach(function(e) {
  9846. 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)
  9847. }
  9848. .bind(this))
  9849. }
  9850. ,
  9851. n.prototype.showAllLabels = function(e, t) {
  9852. this.model.labels.forEach(function(i) {
  9853. this.showLabel(i, e, t)
  9854. }
  9855. .bind(this))
  9856. }
  9857. ,
  9858. n.prototype.hideAllLabels = function(e, t) {
  9859. this.model.labels.forEach(function(i) {
  9860. this.hideLabel(i, e, t)
  9861. }
  9862. .bind(this))
  9863. }
  9864. ,
  9865. n.prototype.showLabel = function(e, t, i) {
  9866. this.model.showingLabels && (e.visible || (e.visible = !0,
  9867. e.labelGui.style.display = "block",
  9868. e.labelGui.style.opacity = 0,
  9869. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9870. }
  9871. ,
  9872. n.prototype.hideLabel = function(e, t, i) {
  9873. e.visible && (e.visible = !1,
  9874. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9875. }
  9876. ,
  9877. n.prototype.supportedMode = function() {
  9878. return this.player.mode === l.FLOORPLAN
  9879. }
  9880. ,
  9881. n.prototype.updateLabelDisplay = function() {
  9882. var e = (new r.Vector3,
  9883. new r.Vector3,
  9884. []);
  9885. return function() {
  9886. var t = this.player.getLabelScaleFactor()
  9887. , i = .6
  9888. , n = 1.2
  9889. , r = (1 - t) * n + i
  9890. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9891. this.getLabelsForCurrentFloor(e);
  9892. for (var a = 0; a < e.length; a++) {
  9893. var l = e[a];
  9894. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9895. 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)
  9896. }
  9897. }
  9898. }(),
  9899. n.prototype.updateProjectedGuiElement = function() {
  9900. var e = new r.Vector3;
  9901. new r.Vector3;
  9902. return function(t, i, n, r, o) {
  9903. i.style.fontSize = 100 * o + "%";
  9904. var a = $("#player").width()
  9905. , s = $("#player").height()
  9906. , l = .5 * a
  9907. , c = .5 * s;
  9908. e.copy(n),
  9909. e.project(this.player.camera);
  9910. var h = e.x * l + l
  9911. , u = -(e.y * c) + c;
  9912. h -= t.offsetWidth / 2,
  9913. u -= t.offsetHeight / 2,
  9914. t.style.left = h + "px",
  9915. t.style.top = u + "px"
  9916. }
  9917. }(),
  9918. n.prototype.handleStartInside = function(e) {
  9919. this.updateLabelVisibility()
  9920. }
  9921. ,
  9922. n.prototype.handleStartOutside = function() {
  9923. this.updateLabelVisibility()
  9924. }
  9925. ,
  9926. t.exports = n
  9927. }
  9928. , {
  9929. "../enum/DirectorEvents": 23,
  9930. "../enum/ModelManagerEvents": 33,
  9931. "../enum/PlayerEvents": 40,
  9932. "../enum/Viewmode": 51,
  9933. "../enum/WarpStyle": 52,
  9934. "../settings": 166,
  9935. "../util/browser": 182,
  9936. "../util/common": 185,
  9937. "../util/lerp": 188,
  9938. "../util/transitions": 195,
  9939. three: 217
  9940. }],
  9941. 92: [function(e, t, i) {
  9942. "use strict";
  9943. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9944. if (null == this)
  9945. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9946. if ("function" != typeof e)
  9947. throw new TypeError("predicate must be a function");
  9948. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9949. if (t = i[o],
  9950. e.call(r, t, o, i))
  9951. return o;
  9952. return -1
  9953. }
  9954. ),
  9955. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9956. value: function(e) {
  9957. if (null == this)
  9958. throw new TypeError('"this" is null or not defined');
  9959. var t = Object(this)
  9960. , i = t.length >>> 0;
  9961. if ("function" != typeof e)
  9962. throw new TypeError("predicate must be a function");
  9963. for (var n = arguments[1], r = 0; r < i; ) {
  9964. var o = t[r];
  9965. if (e.call(n, o, r, t))
  9966. return o;
  9967. r++
  9968. }
  9969. }
  9970. })
  9971. }
  9972. , {}],
  9973. 93: [function(e, t, i) {
  9974. "use strict";
  9975. var n = n || {};
  9976. t.exports = n,
  9977. n.gui = n.gui || {},
  9978. n.utils = n.utils || {},
  9979. n.controllers = n.controllers || {},
  9980. n.dom = n.dom || {},
  9981. n.color = n.color || {},
  9982. n.utils.css = function() {
  9983. return {
  9984. load: function(e, t) {
  9985. t = t || document;
  9986. var i = t.createElement("link");
  9987. i.type = "text/css",
  9988. i.rel = "stylesheet",
  9989. i.href = e,
  9990. t.getElementsByTagName("head")[0].appendChild(i)
  9991. },
  9992. inject: function(e, t) {
  9993. t = t || document;
  9994. var i = document.createElement("style");
  9995. i.type = "text/css",
  9996. i.innerHTML = e,
  9997. t.getElementsByTagName("head")[0].appendChild(i)
  9998. }
  9999. }
  10000. }(),
  10001. n.utils.common = function() {
  10002. var e = Array.prototype.forEach
  10003. , t = Array.prototype.slice;
  10004. return {
  10005. BREAK: {},
  10006. extend: function(e) {
  10007. return this.each(t.call(arguments, 1), function(t) {
  10008. for (var i in t)
  10009. this.isUndefined(t[i]) || (e[i] = t[i])
  10010. }, this),
  10011. e
  10012. },
  10013. defaults: function(e) {
  10014. return this.each(t.call(arguments, 1), function(t) {
  10015. for (var i in t)
  10016. this.isUndefined(e[i]) && (e[i] = t[i])
  10017. }, this),
  10018. e
  10019. },
  10020. compose: function() {
  10021. var e = t.call(arguments);
  10022. return function() {
  10023. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  10024. i = [e[n].apply(this, i)];
  10025. return i[0]
  10026. }
  10027. },
  10028. each: function(t, i, n) {
  10029. if (t)
  10030. if (e && t.forEach && t.forEach === e)
  10031. t.forEach(i, n);
  10032. else if (t.length === t.length + 0) {
  10033. for (var r = 0, o = t.length; r < o; r++)
  10034. if (r in t && i.call(n, t[r], r) === this.BREAK)
  10035. return
  10036. } else
  10037. for (var r in t)
  10038. if (i.call(n, t[r], r) === this.BREAK)
  10039. return
  10040. },
  10041. defer: function(e) {
  10042. setTimeout(e, 0)
  10043. },
  10044. toArray: function(e) {
  10045. return e.toArray ? e.toArray() : t.call(e)
  10046. },
  10047. isUndefined: function(e) {
  10048. return void 0 === e
  10049. },
  10050. isNull: function(e) {
  10051. return null === e
  10052. },
  10053. isNaN: function(e) {
  10054. return e !== e
  10055. },
  10056. isArray: Array.isArray || function(e) {
  10057. return e.constructor === Array
  10058. }
  10059. ,
  10060. isObject: function(e) {
  10061. return e === Object(e)
  10062. },
  10063. isNumber: function(e) {
  10064. return e === e + 0
  10065. },
  10066. isString: function(e) {
  10067. return e === e + ""
  10068. },
  10069. isBoolean: function(e) {
  10070. return e === !1 || e === !0
  10071. },
  10072. isFunction: function(e) {
  10073. return "[object Function]" === Object.prototype.toString.call(e)
  10074. }
  10075. }
  10076. }(),
  10077. n.controllers.Controller = function(e) {
  10078. var t = function(e, t) {
  10079. this.initialValue = e[t],
  10080. this.domElement = document.createElement("div"),
  10081. this.object = e,
  10082. this.property = t,
  10083. this.__onChange = void 0,
  10084. this.__onFinishChange = void 0
  10085. };
  10086. return e.extend(t.prototype, {
  10087. onChange: function(e) {
  10088. return this.__onChange = e,
  10089. this
  10090. },
  10091. onFinishChange: function(e) {
  10092. return this.__onFinishChange = e,
  10093. this
  10094. },
  10095. setValue: function(e) {
  10096. return this.object[this.property] = e,
  10097. this.__onChange && this.__onChange.call(this, e),
  10098. this.updateDisplay(),
  10099. this
  10100. },
  10101. getValue: function() {
  10102. return this.object[this.property]
  10103. },
  10104. updateDisplay: function() {
  10105. return this
  10106. },
  10107. isModified: function() {
  10108. return this.initialValue !== this.getValue()
  10109. }
  10110. }),
  10111. t
  10112. }(n.utils.common),
  10113. n.dom.dom = function(e) {
  10114. function t(t) {
  10115. if ("0" === t || e.isUndefined(t))
  10116. return 0;
  10117. var i = t.match(r);
  10118. return e.isNull(i) ? 0 : parseFloat(i[1])
  10119. }
  10120. var i = {
  10121. HTMLEvents: ["change"],
  10122. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10123. KeyboardEvents: ["keydown"]
  10124. }
  10125. , n = {};
  10126. e.each(i, function(t, i) {
  10127. e.each(t, function(e) {
  10128. n[e] = i
  10129. })
  10130. });
  10131. var r = /(\d+(\.\d+)?)px/
  10132. , o = {
  10133. makeSelectable: function(e, t) {
  10134. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10135. return !1
  10136. }
  10137. : function() {}
  10138. ,
  10139. e.style.MozUserSelect = t ? "auto" : "none",
  10140. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10141. e.unselectable = t ? "on" : "off")
  10142. },
  10143. makeFullscreen: function(t, i, n) {
  10144. e.isUndefined(i) && (i = !0),
  10145. e.isUndefined(n) && (n = !0),
  10146. t.style.position = "absolute",
  10147. i && (t.style.left = 0,
  10148. t.style.right = 0),
  10149. n && (t.style.top = 0,
  10150. t.style.bottom = 0)
  10151. },
  10152. fakeEvent: function(t, i, r, o) {
  10153. r = r || {};
  10154. var a = n[i];
  10155. if (!a)
  10156. throw new Error("Event type " + i + " not supported.");
  10157. var s = document.createEvent(a);
  10158. switch (a) {
  10159. case "MouseEvents":
  10160. var l = r.x || r.clientX || 0
  10161. , c = r.y || r.clientY || 0;
  10162. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10163. break;
  10164. case "KeyboardEvents":
  10165. var h = s.initKeyboardEvent || s.initKeyEvent;
  10166. e.defaults(r, {
  10167. cancelable: !0,
  10168. ctrlKey: !1,
  10169. altKey: !1,
  10170. shiftKey: !1,
  10171. metaKey: !1,
  10172. keyCode: void 0,
  10173. charCode: void 0
  10174. }),
  10175. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10176. break;
  10177. default:
  10178. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10179. }
  10180. e.defaults(s, o),
  10181. t.dispatchEvent(s)
  10182. },
  10183. bind: function(e, t, i, n) {
  10184. return n = n || !1,
  10185. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10186. o
  10187. },
  10188. unbind: function(e, t, i, n) {
  10189. return n = n || !1,
  10190. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10191. o
  10192. },
  10193. addClass: function(e, t) {
  10194. if (void 0 === e.className)
  10195. e.className = t;
  10196. else if (e.className !== t) {
  10197. var i = e.className.split(/ +/);
  10198. i.indexOf(t) == -1 && (i.push(t),
  10199. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10200. }
  10201. return o
  10202. },
  10203. removeClass: function(e, t) {
  10204. if (t)
  10205. if (void 0 === e.className)
  10206. ;
  10207. else if (e.className === t)
  10208. e.removeAttribute("class");
  10209. else {
  10210. var i = e.className.split(/ +/)
  10211. , n = i.indexOf(t);
  10212. n != -1 && (i.splice(n, 1),
  10213. e.className = i.join(" "))
  10214. }
  10215. else
  10216. e.className = void 0;
  10217. return o
  10218. },
  10219. hasClass: function(e, t) {
  10220. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10221. },
  10222. getWidth: function(e) {
  10223. var i = getComputedStyle(e);
  10224. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10225. },
  10226. getHeight: function(e) {
  10227. var i = getComputedStyle(e);
  10228. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10229. },
  10230. getOffset: function(e) {
  10231. var t = {
  10232. left: 0,
  10233. top: 0
  10234. };
  10235. if (e.offsetParent)
  10236. do
  10237. t.left += e.offsetLeft,
  10238. t.top += e.offsetTop;
  10239. while (e = e.offsetParent);return t
  10240. },
  10241. isActive: function(e) {
  10242. return e === document.activeElement && (e.type || e.href)
  10243. }
  10244. };
  10245. return o
  10246. }(n.utils.common),
  10247. n.controllers.OptionController = function(e, t, i) {
  10248. var n = function(e, r, o) {
  10249. n.superclass.call(this, e, r);
  10250. var a = this;
  10251. if (this.__select = document.createElement("select"),
  10252. i.isArray(o)) {
  10253. var s = {};
  10254. i.each(o, function(e) {
  10255. s[e] = e
  10256. }),
  10257. o = s
  10258. }
  10259. i.each(o, function(e, t) {
  10260. var i = document.createElement("option");
  10261. i.innerHTML = t,
  10262. i.setAttribute("value", e),
  10263. a.__select.appendChild(i)
  10264. }),
  10265. this.updateDisplay(),
  10266. t.bind(this.__select, "change", function() {
  10267. var e = this.options[this.selectedIndex].value;
  10268. a.setValue(e)
  10269. }),
  10270. this.domElement.appendChild(this.__select)
  10271. };
  10272. return n.superclass = e,
  10273. i.extend(n.prototype, e.prototype, {
  10274. setValue: function(e) {
  10275. var t = n.superclass.prototype.setValue.call(this, e);
  10276. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10277. t
  10278. },
  10279. updateDisplay: function() {
  10280. return this.__select.value = this.getValue(),
  10281. n.superclass.prototype.updateDisplay.call(this)
  10282. }
  10283. }),
  10284. n
  10285. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10286. n.controllers.NumberController = function(e, t) {
  10287. function i(e) {
  10288. return e = e.toString(),
  10289. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10290. }
  10291. var n = function(e, r, o) {
  10292. n.superclass.call(this, e, r),
  10293. o = o || {},
  10294. this.__min = o.min,
  10295. this.__max = o.max,
  10296. this.__step = o.step,
  10297. 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,
  10298. this.__precision = i(this.__impliedStep)
  10299. };
  10300. return n.superclass = e,
  10301. t.extend(n.prototype, e.prototype, {
  10302. setValue: function(e) {
  10303. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10304. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10305. n.superclass.prototype.setValue.call(this, e)
  10306. },
  10307. min: function(e) {
  10308. return this.__min = e,
  10309. this
  10310. },
  10311. max: function(e) {
  10312. return this.__max = e,
  10313. this
  10314. },
  10315. step: function(e) {
  10316. return this.__step = e,
  10317. this.__impliedStep = e,
  10318. this.__precision = i(e),
  10319. this
  10320. }
  10321. }),
  10322. n
  10323. }(n.controllers.Controller, n.utils.common),
  10324. n.controllers.NumberControllerBox = function(e, t, i) {
  10325. function n(e, t) {
  10326. var i = Math.pow(10, t);
  10327. return Math.round(e * i) / i
  10328. }
  10329. var r = function(e, n, o) {
  10330. function a() {
  10331. var e = parseFloat(d.__input.value);
  10332. i.isNaN(e) || d.setValue(e)
  10333. }
  10334. function s() {
  10335. a(),
  10336. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10337. }
  10338. function l(e) {
  10339. t.bind(window, "mousemove", c),
  10340. t.bind(window, "mouseup", h),
  10341. u = e.clientY
  10342. }
  10343. function c(e) {
  10344. var t = u - e.clientY;
  10345. d.setValue(d.getValue() + t * d.__impliedStep),
  10346. u = e.clientY
  10347. }
  10348. function h() {
  10349. t.unbind(window, "mousemove", c),
  10350. t.unbind(window, "mouseup", h)
  10351. }
  10352. this.__truncationSuspended = !1,
  10353. r.superclass.call(this, e, n, o);
  10354. var u, d = this;
  10355. this.__input = document.createElement("input"),
  10356. this.__input.setAttribute("type", "text"),
  10357. t.bind(this.__input, "change", a),
  10358. t.bind(this.__input, "blur", s),
  10359. t.bind(this.__input, "mousedown", l),
  10360. t.bind(this.__input, "keydown", function(e) {
  10361. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10362. this.blur(),
  10363. d.__truncationSuspended = !1)
  10364. }),
  10365. this.updateDisplay(),
  10366. this.domElement.appendChild(this.__input)
  10367. };
  10368. return r.superclass = e,
  10369. i.extend(r.prototype, e.prototype, {
  10370. updateDisplay: function() {
  10371. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10372. r.superclass.prototype.updateDisplay.call(this)
  10373. }
  10374. }),
  10375. r
  10376. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10377. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10378. function o(e, t, i, n, r) {
  10379. return n + (r - n) * ((e - t) / (i - t))
  10380. }
  10381. var a = function(e, i, n, r, s) {
  10382. function l(e) {
  10383. t.bind(window, "mousemove", c),
  10384. t.bind(window, "mouseup", h),
  10385. c(e)
  10386. }
  10387. function c(e) {
  10388. e.preventDefault();
  10389. var i = t.getOffset(u.__background)
  10390. , n = t.getWidth(u.__background);
  10391. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10392. !1
  10393. }
  10394. function h() {
  10395. t.unbind(window, "mousemove", c),
  10396. t.unbind(window, "mouseup", h),
  10397. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10398. }
  10399. a.superclass.call(this, e, i, {
  10400. min: n,
  10401. max: r,
  10402. step: s
  10403. });
  10404. var u = this;
  10405. this.__background = document.createElement("div"),
  10406. this.__foreground = document.createElement("div"),
  10407. t.bind(this.__background, "mousedown", l),
  10408. t.addClass(this.__background, "slider"),
  10409. t.addClass(this.__foreground, "slider-fg"),
  10410. this.updateDisplay(),
  10411. this.__background.appendChild(this.__foreground),
  10412. this.domElement.appendChild(this.__background)
  10413. };
  10414. return a.superclass = e,
  10415. a.useDefaultStyles = function() {
  10416. i.inject(r)
  10417. }
  10418. ,
  10419. n.extend(a.prototype, e.prototype, {
  10420. updateDisplay: function() {
  10421. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10422. return this.__foreground.style.width = 100 * e + "%",
  10423. a.superclass.prototype.updateDisplay.call(this)
  10424. }
  10425. }),
  10426. a
  10427. }(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}"),
  10428. n.controllers.FunctionController = function(e, t, i) {
  10429. var n = function(e, i, r) {
  10430. n.superclass.call(this, e, i);
  10431. var o = this;
  10432. this.__button = document.createElement("div"),
  10433. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10434. t.bind(this.__button, "click", function(e) {
  10435. return e.preventDefault(),
  10436. o.fire(),
  10437. !1
  10438. }),
  10439. t.addClass(this.__button, "button"),
  10440. this.domElement.appendChild(this.__button)
  10441. };
  10442. return n.superclass = e,
  10443. i.extend(n.prototype, e.prototype, {
  10444. fire: function() {
  10445. this.__onChange && this.__onChange.call(this),
  10446. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10447. this.getValue().call(this.object)
  10448. }
  10449. }),
  10450. n
  10451. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10452. n.controllers.BooleanController = function(e, t, i) {
  10453. var n = function(e, i) {
  10454. function r() {
  10455. o.setValue(!o.__prev)
  10456. }
  10457. n.superclass.call(this, e, i);
  10458. var o = this;
  10459. this.__prev = this.getValue(),
  10460. this.__checkbox = document.createElement("input"),
  10461. this.__checkbox.setAttribute("type", "checkbox"),
  10462. t.bind(this.__checkbox, "change", r, !1),
  10463. this.domElement.appendChild(this.__checkbox),
  10464. this.updateDisplay()
  10465. };
  10466. return n.superclass = e,
  10467. i.extend(n.prototype, e.prototype, {
  10468. setValue: function(e) {
  10469. var t = n.superclass.prototype.setValue.call(this, e);
  10470. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10471. this.__prev = this.getValue(),
  10472. t
  10473. },
  10474. updateDisplay: function() {
  10475. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10476. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10477. n.superclass.prototype.updateDisplay.call(this)
  10478. }
  10479. }),
  10480. n
  10481. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10482. n.color.toString = function(e) {
  10483. return function(t) {
  10484. if (1 == t.a || e.isUndefined(t.a)) {
  10485. for (var i = t.hex.toString(16); i.length < 6; )
  10486. i = "0" + i;
  10487. return "#" + i
  10488. }
  10489. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10490. }
  10491. }(n.utils.common),
  10492. n.color.interpret = function(e, t) {
  10493. var i, n, r = function() {
  10494. n = !1;
  10495. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10496. return t.each(o, function(r) {
  10497. if (r.litmus(e))
  10498. return t.each(r.conversions, function(r, o) {
  10499. if (i = r.read(e),
  10500. n === !1 && i !== !1)
  10501. return n = i,
  10502. i.conversionName = o,
  10503. i.conversion = r,
  10504. t.BREAK
  10505. }),
  10506. t.BREAK
  10507. }),
  10508. n
  10509. }, o = [{
  10510. litmus: t.isString,
  10511. conversions: {
  10512. THREE_CHAR_HEX: {
  10513. read: function(e) {
  10514. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10515. return null !== t && {
  10516. space: "HEX",
  10517. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10518. }
  10519. },
  10520. write: e
  10521. },
  10522. SIX_CHAR_HEX: {
  10523. read: function(e) {
  10524. var t = e.match(/^#([A-F0-9]{6})$/i);
  10525. return null !== t && {
  10526. space: "HEX",
  10527. hex: parseInt("0x" + t[1].toString())
  10528. }
  10529. },
  10530. write: e
  10531. },
  10532. CSS_RGB: {
  10533. read: function(e) {
  10534. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10535. return null !== t && {
  10536. space: "RGB",
  10537. r: parseFloat(t[1]),
  10538. g: parseFloat(t[2]),
  10539. b: parseFloat(t[3])
  10540. }
  10541. },
  10542. write: e
  10543. },
  10544. CSS_RGBA: {
  10545. read: function(e) {
  10546. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10547. return null !== t && {
  10548. space: "RGB",
  10549. r: parseFloat(t[1]),
  10550. g: parseFloat(t[2]),
  10551. b: parseFloat(t[3]),
  10552. a: parseFloat(t[4])
  10553. }
  10554. },
  10555. write: e
  10556. }
  10557. }
  10558. }, {
  10559. litmus: t.isNumber,
  10560. conversions: {
  10561. HEX: {
  10562. read: function(e) {
  10563. return {
  10564. space: "HEX",
  10565. hex: e,
  10566. conversionName: "HEX"
  10567. }
  10568. },
  10569. write: function(e) {
  10570. return e.hex
  10571. }
  10572. }
  10573. }
  10574. }, {
  10575. litmus: t.isArray,
  10576. conversions: {
  10577. RGB_ARRAY: {
  10578. read: function(e) {
  10579. return 3 == e.length && {
  10580. space: "RGB",
  10581. r: e[0],
  10582. g: e[1],
  10583. b: e[2]
  10584. }
  10585. },
  10586. write: function(e) {
  10587. return [e.r, e.g, e.b]
  10588. }
  10589. },
  10590. RGBA_ARRAY: {
  10591. read: function(e) {
  10592. return 4 == e.length && {
  10593. space: "RGB",
  10594. r: e[0],
  10595. g: e[1],
  10596. b: e[2],
  10597. a: e[3]
  10598. }
  10599. },
  10600. write: function(e) {
  10601. return [e.r, e.g, e.b, e.a]
  10602. }
  10603. }
  10604. }
  10605. }, {
  10606. litmus: t.isObject,
  10607. conversions: {
  10608. RGBA_OBJ: {
  10609. read: function(e) {
  10610. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10611. space: "RGB",
  10612. r: e.r,
  10613. g: e.g,
  10614. b: e.b,
  10615. a: e.a
  10616. }
  10617. },
  10618. write: function(e) {
  10619. return {
  10620. r: e.r,
  10621. g: e.g,
  10622. b: e.b,
  10623. a: e.a
  10624. }
  10625. }
  10626. },
  10627. RGB_OBJ: {
  10628. read: function(e) {
  10629. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10630. space: "RGB",
  10631. r: e.r,
  10632. g: e.g,
  10633. b: e.b
  10634. }
  10635. },
  10636. write: function(e) {
  10637. return {
  10638. r: e.r,
  10639. g: e.g,
  10640. b: e.b
  10641. }
  10642. }
  10643. },
  10644. HSVA_OBJ: {
  10645. read: function(e) {
  10646. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10647. space: "HSV",
  10648. h: e.h,
  10649. s: e.s,
  10650. v: e.v,
  10651. a: e.a
  10652. }
  10653. },
  10654. write: function(e) {
  10655. return {
  10656. h: e.h,
  10657. s: e.s,
  10658. v: e.v,
  10659. a: e.a
  10660. }
  10661. }
  10662. },
  10663. HSV_OBJ: {
  10664. read: function(e) {
  10665. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10666. space: "HSV",
  10667. h: e.h,
  10668. s: e.s,
  10669. v: e.v
  10670. }
  10671. },
  10672. write: function(e) {
  10673. return {
  10674. h: e.h,
  10675. s: e.s,
  10676. v: e.v
  10677. }
  10678. }
  10679. }
  10680. }
  10681. }];
  10682. return r
  10683. }(n.color.toString, n.utils.common),
  10684. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10685. function g(e, t, i, o) {
  10686. if (void 0 === t[i])
  10687. throw new Error("Object " + t + ' has no property "' + i + '"');
  10688. var a;
  10689. if (o.color)
  10690. a = new h(t,i);
  10691. else {
  10692. var s = [t, i].concat(o.factoryArgs);
  10693. a = n.apply(e, s)
  10694. }
  10695. o.before instanceof r && (o.before = o.before.__li),
  10696. A(e, a),
  10697. p.addClass(a.domElement, "c");
  10698. var l = document.createElement("span");
  10699. p.addClass(l, "property-name"),
  10700. l.innerHTML = a.property;
  10701. var c = document.createElement("div");
  10702. c.appendChild(l),
  10703. c.appendChild(a.domElement);
  10704. var u = m(e, c, o.before);
  10705. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10706. p.addClass(u, typeof a.getValue()),
  10707. v(e, u, a),
  10708. e.__controllers.push(a),
  10709. a
  10710. }
  10711. function m(e, t, i) {
  10712. var n = document.createElement("li");
  10713. return t && n.appendChild(t),
  10714. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10715. e.onResize(),
  10716. n
  10717. }
  10718. function v(e, t, i) {
  10719. if (i.__li = t,
  10720. i.__gui = e,
  10721. f.extend(i, {
  10722. options: function(t) {
  10723. return arguments.length > 1 ? (i.remove(),
  10724. g(e, i.object, i.property, {
  10725. before: i.__li.nextElementSibling,
  10726. factoryArgs: [f.toArray(arguments)]
  10727. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10728. g(e, i.object, i.property, {
  10729. before: i.__li.nextElementSibling,
  10730. factoryArgs: [t]
  10731. })) : void 0
  10732. },
  10733. name: function(e) {
  10734. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10735. i
  10736. },
  10737. listen: function() {
  10738. return i.__gui.listen(i),
  10739. i
  10740. },
  10741. remove: function() {
  10742. return i.__gui.remove(i),
  10743. i
  10744. }
  10745. }),
  10746. i instanceof l) {
  10747. var n = new s(i.object,i.property,{
  10748. min: i.__min,
  10749. max: i.__max,
  10750. step: i.__step
  10751. });
  10752. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10753. var t = i[e]
  10754. , r = n[e];
  10755. i[e] = n[e] = function() {
  10756. var e = Array.prototype.slice.call(arguments);
  10757. return t.apply(i, e),
  10758. r.apply(n, e)
  10759. }
  10760. }),
  10761. p.addClass(t, "has-slider"),
  10762. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10763. } else if (i instanceof s) {
  10764. var r = function(t) {
  10765. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10766. g(e, i.object, i.property, {
  10767. before: i.__li.nextElementSibling,
  10768. factoryArgs: [i.__min, i.__max, i.__step]
  10769. })) : t
  10770. };
  10771. i.min = f.compose(r, i.min),
  10772. i.max = f.compose(r, i.max)
  10773. } else
  10774. i instanceof o ? (p.bind(t, "click", function() {
  10775. p.fakeEvent(i.__checkbox, "click")
  10776. }),
  10777. p.bind(i.__checkbox, "click", function(e) {
  10778. e.stopPropagation()
  10779. })) : i instanceof a ? (p.bind(t, "click", function() {
  10780. p.fakeEvent(i.__button, "click")
  10781. }),
  10782. p.bind(t, "mouseover", function() {
  10783. p.addClass(i.__button, "hover")
  10784. }),
  10785. p.bind(t, "mouseout", function() {
  10786. p.removeClass(i.__button, "hover")
  10787. })) : i instanceof h && (p.addClass(t, "color"),
  10788. i.updateDisplay = f.compose(function(e) {
  10789. return t.style.borderLeftColor = i.__color.toString(),
  10790. e
  10791. }, i.updateDisplay),
  10792. i.updateDisplay());
  10793. i.setValue = f.compose(function(t) {
  10794. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10795. t
  10796. }, i.setValue)
  10797. }
  10798. function A(e, t) {
  10799. var i = e.getRoot()
  10800. , n = i.__rememberedObjects.indexOf(t.object);
  10801. if (n != -1) {
  10802. var r = i.__rememberedObjectIndecesToControllers[n];
  10803. if (void 0 === r && (r = {},
  10804. i.__rememberedObjectIndecesToControllers[n] = r),
  10805. r[t.property] = t,
  10806. i.load && i.load.remembered) {
  10807. var o, a = i.load.remembered;
  10808. if (a[e.preset])
  10809. o = a[e.preset];
  10810. else {
  10811. if (!a[L])
  10812. return;
  10813. o = a[L]
  10814. }
  10815. if (o[n] && void 0 !== o[n][t.property]) {
  10816. var s = o[n][t.property];
  10817. t.initialValue = s,
  10818. t.setValue(s)
  10819. }
  10820. }
  10821. }
  10822. }
  10823. function y(e, t) {
  10824. return document.location.href + "." + t
  10825. }
  10826. function C(e) {
  10827. var t = e.__save_row = document.createElement("li");
  10828. p.addClass(e.domElement, "has-save"),
  10829. e.__ul.insertBefore(t, e.__ul.firstChild),
  10830. p.addClass(t, "save-row");
  10831. var i = document.createElement("span");
  10832. i.innerHTML = "&nbsp;",
  10833. p.addClass(i, "button gears");
  10834. var n = document.createElement("span");
  10835. n.innerHTML = "Save",
  10836. p.addClass(n, "button"),
  10837. p.addClass(n, "save");
  10838. var r = document.createElement("span");
  10839. r.innerHTML = "New",
  10840. p.addClass(r, "button"),
  10841. p.addClass(r, "save-as");
  10842. var o = document.createElement("span");
  10843. o.innerHTML = "Revert",
  10844. p.addClass(o, "button"),
  10845. p.addClass(o, "revert");
  10846. var a = e.__preset_select = document.createElement("select");
  10847. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10848. w(e, i, i == e.preset)
  10849. }) : w(e, L, !1),
  10850. p.bind(a, "change", function() {
  10851. for (var t = 0; t < e.__preset_select.length; t++)
  10852. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10853. e.preset = this.value
  10854. }),
  10855. t.appendChild(a),
  10856. t.appendChild(i),
  10857. t.appendChild(n),
  10858. t.appendChild(r),
  10859. t.appendChild(o),
  10860. D) {
  10861. var s = document.getElementById("dg-save-locally")
  10862. , l = document.getElementById("dg-local-explain");
  10863. s.style.display = "block";
  10864. var c = document.getElementById("dg-local-storage");
  10865. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10866. var h = function() {
  10867. l.style.display = e.useLocalStorage ? "block" : "none"
  10868. };
  10869. h(),
  10870. p.bind(c, "change", function() {
  10871. e.useLocalStorage = !e.useLocalStorage,
  10872. h()
  10873. })
  10874. }
  10875. var u = document.getElementById("dg-new-constructor");
  10876. p.bind(u, "keydown", function(e) {
  10877. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10878. }),
  10879. p.bind(i, "click", function() {
  10880. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10881. S.show(),
  10882. u.focus(),
  10883. u.select()
  10884. }),
  10885. p.bind(n, "click", function() {
  10886. e.save()
  10887. }),
  10888. p.bind(r, "click", function() {
  10889. var t = prompt("Enter a new preset name.");
  10890. t && e.saveAs(t)
  10891. }),
  10892. p.bind(o, "click", function() {
  10893. e.revert()
  10894. })
  10895. }
  10896. function I(e) {
  10897. function t(t) {
  10898. return t.preventDefault(),
  10899. r = t.clientX,
  10900. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10901. p.bind(window, "mousemove", i),
  10902. p.bind(window, "mouseup", n),
  10903. !1
  10904. }
  10905. function i(t) {
  10906. return t.preventDefault(),
  10907. e.width += r - t.clientX,
  10908. e.onResize(),
  10909. r = t.clientX,
  10910. !1
  10911. }
  10912. function n() {
  10913. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10914. p.unbind(window, "mousemove", i),
  10915. p.unbind(window, "mouseup", n)
  10916. }
  10917. e.__resize_handle = document.createElement("div"),
  10918. f.extend(e.__resize_handle.style, {
  10919. width: "6px",
  10920. marginLeft: "-3px",
  10921. height: "200px",
  10922. cursor: "ew-resize",
  10923. position: "absolute"
  10924. });
  10925. var r;
  10926. p.bind(e.__resize_handle, "mousedown", t),
  10927. p.bind(e.__closeButton, "mousedown", t),
  10928. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10929. }
  10930. function E(e, t) {
  10931. e.domElement.style.width = t + "px",
  10932. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10933. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10934. }
  10935. function b(e, t) {
  10936. var i = {};
  10937. return f.each(e.__rememberedObjects, function(n, r) {
  10938. var o = {}
  10939. , a = e.__rememberedObjectIndecesToControllers[r];
  10940. f.each(a, function(e, i) {
  10941. o[i] = t ? e.initialValue : e.getValue()
  10942. }),
  10943. i[r] = o
  10944. }),
  10945. i
  10946. }
  10947. function w(e, t, i) {
  10948. var n = document.createElement("option");
  10949. n.innerHTML = t,
  10950. n.value = t,
  10951. e.__preset_select.appendChild(n),
  10952. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10953. }
  10954. function _(e) {
  10955. for (var t = 0; t < e.__preset_select.length; t++)
  10956. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10957. }
  10958. function T(e, t) {
  10959. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10960. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10961. }
  10962. function x(e) {
  10963. 0 != e.length && u(function() {
  10964. x(e)
  10965. }),
  10966. f.each(e, function(e) {
  10967. e.updateDisplay()
  10968. })
  10969. }
  10970. e.inject(i);
  10971. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10972. try {
  10973. return "localStorage"in window && null !== window.localStorage
  10974. } catch (e) {
  10975. return !1
  10976. }
  10977. }(), N = !0, B = !1, F = [], V = function(e) {
  10978. function t() {
  10979. var e = i.getRoot();
  10980. e.width += 1,
  10981. f.defer(function() {
  10982. e.width -= 1
  10983. })
  10984. }
  10985. var i = this;
  10986. this.domElement = document.createElement("div"),
  10987. this.__ul = document.createElement("ul"),
  10988. this.domElement.appendChild(this.__ul),
  10989. p.addClass(this.domElement, R),
  10990. this.__folders = {},
  10991. this.__controllers = [],
  10992. this.__rememberedObjects = [],
  10993. this.__rememberedObjectIndecesToControllers = [],
  10994. this.__listening = [],
  10995. e = e || {},
  10996. e = f.defaults(e, {
  10997. autoPlace: !0,
  10998. width: V.DEFAULT_WIDTH
  10999. }),
  11000. e = f.defaults(e, {
  11001. resizable: e.autoPlace,
  11002. hideable: e.autoPlace
  11003. }),
  11004. f.isUndefined(e.load) ? e.load = {
  11005. preset: L
  11006. } : e.preset && (e.load.preset = e.preset),
  11007. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11008. e.resizable = f.isUndefined(e.parent) && e.resizable,
  11009. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  11010. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  11011. if (Object.defineProperties(this, {
  11012. parent: {
  11013. get: function() {
  11014. return e.parent
  11015. }
  11016. },
  11017. scrollable: {
  11018. get: function() {
  11019. return e.scrollable
  11020. }
  11021. },
  11022. autoPlace: {
  11023. get: function() {
  11024. return e.autoPlace
  11025. }
  11026. },
  11027. preset: {
  11028. get: function() {
  11029. return i.parent ? i.getRoot().preset : e.load.preset
  11030. },
  11031. set: function(t) {
  11032. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  11033. _(this),
  11034. i.revert()
  11035. }
  11036. },
  11037. width: {
  11038. get: function() {
  11039. return e.width
  11040. },
  11041. set: function(t) {
  11042. e.width = t,
  11043. E(i, t)
  11044. }
  11045. },
  11046. name: {
  11047. get: function() {
  11048. return e.name
  11049. },
  11050. set: function(t) {
  11051. e.name = t,
  11052. a && (a.innerHTML = e.name)
  11053. }
  11054. },
  11055. closed: {
  11056. get: function() {
  11057. return e.closed
  11058. },
  11059. set: function(t) {
  11060. e.closed = t,
  11061. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11062. this.onResize(),
  11063. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11064. }
  11065. },
  11066. load: {
  11067. get: function() {
  11068. return e.load
  11069. }
  11070. },
  11071. useLocalStorage: {
  11072. get: function() {
  11073. return r
  11074. },
  11075. set: function(e) {
  11076. D && (r = e,
  11077. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11078. localStorage.setItem(y(i, "isLocal"), e))
  11079. }
  11080. }
  11081. }),
  11082. f.isUndefined(e.parent)) {
  11083. if (e.closed = !1,
  11084. p.addClass(this.domElement, V.CLASS_MAIN),
  11085. p.makeSelectable(this.domElement, !1),
  11086. D && r) {
  11087. i.useLocalStorage = !0;
  11088. var o = localStorage.getItem(y(this, "gui"));
  11089. o && (e.load = JSON.parse(o))
  11090. }
  11091. this.__closeButton = document.createElement("div"),
  11092. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11093. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11094. this.domElement.appendChild(this.__closeButton),
  11095. p.bind(this.__closeButton, "click", function() {
  11096. i.closed = !i.closed
  11097. })
  11098. } else {
  11099. void 0 === e.closed && (e.closed = !0);
  11100. var a = document.createTextNode(e.name);
  11101. p.addClass(a, "controller-name");
  11102. var s = m(i, a)
  11103. , l = function(e) {
  11104. return e.preventDefault(),
  11105. i.closed = !i.closed,
  11106. !1
  11107. };
  11108. p.addClass(this.__ul, V.CLASS_CLOSED),
  11109. p.addClass(s, "title"),
  11110. p.bind(s, "click", l),
  11111. e.closed || (this.closed = !1)
  11112. }
  11113. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11114. p.addClass(M, R),
  11115. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11116. document.body.appendChild(M),
  11117. N = !1),
  11118. M.appendChild(this.domElement),
  11119. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11120. this.parent || E(i, e.width)),
  11121. p.bind(window, "resize", function() {
  11122. i.onResize()
  11123. }),
  11124. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11125. i.onResize()
  11126. }),
  11127. p.bind(this.__ul, "transitionend", function() {
  11128. i.onResize()
  11129. }),
  11130. p.bind(this.__ul, "oTransitionEnd", function() {
  11131. i.onResize()
  11132. }),
  11133. this.onResize(),
  11134. e.resizable && I(this),
  11135. n = function() {
  11136. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11137. }
  11138. ,
  11139. this.saveToLocalStorageIfPossible = n;
  11140. i.getRoot();
  11141. e.parent || t()
  11142. };
  11143. return V.toggleHide = function() {
  11144. B = !B,
  11145. f.each(F, function(e) {
  11146. e.domElement.style.zIndex = B ? -999 : 999,
  11147. e.domElement.style.opacity = B ? 0 : 1
  11148. })
  11149. }
  11150. ,
  11151. V.CLASS_AUTO_PLACE = "a",
  11152. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11153. V.CLASS_MAIN = "main",
  11154. V.CLASS_CONTROLLER_ROW = "cr",
  11155. V.CLASS_TOO_TALL = "taller-than-window",
  11156. V.CLASS_CLOSED = "closed",
  11157. V.CLASS_CLOSE_BUTTON = "close-button",
  11158. V.CLASS_DRAG = "drag",
  11159. V.DEFAULT_WIDTH = 245,
  11160. V.TEXT_CLOSED = "Close Controls",
  11161. V.TEXT_OPEN = "Open Controls",
  11162. p.bind(window, "keydown", function(e) {
  11163. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11164. }, !1),
  11165. f.extend(V.prototype, {
  11166. add: function(e, t) {
  11167. return g(this, e, t, {
  11168. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11169. })
  11170. },
  11171. addColor: function(e, t) {
  11172. return g(this, e, t, {
  11173. color: !0
  11174. })
  11175. },
  11176. remove: function(e) {
  11177. this.__ul.removeChild(e.__li),
  11178. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11179. var t = this;
  11180. f.defer(function() {
  11181. t.onResize()
  11182. })
  11183. },
  11184. destroy: function() {
  11185. this.autoPlace && M.removeChild(this.domElement)
  11186. },
  11187. addFolder: function(e) {
  11188. if (void 0 !== this.__folders[e])
  11189. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11190. var t = {
  11191. name: e,
  11192. parent: this
  11193. };
  11194. t.autoPlace = this.autoPlace,
  11195. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11196. t.load = this.load.folders[e]);
  11197. var i = new V(t);
  11198. this.__folders[e] = i;
  11199. var n = m(this, i.domElement);
  11200. return p.addClass(n, "folder"),
  11201. i
  11202. },
  11203. open: function() {
  11204. this.closed = !1
  11205. },
  11206. close: function() {
  11207. this.closed = !0
  11208. },
  11209. onResize: function() {
  11210. var e = this.getRoot();
  11211. if (e.scrollable) {
  11212. var t = p.getOffset(e.__ul).top
  11213. , i = 0;
  11214. f.each(e.__ul.childNodes, function(t) {
  11215. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11216. }),
  11217. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11218. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11219. e.__ul.style.height = "auto")
  11220. }
  11221. e.__resize_handle && f.defer(function() {
  11222. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11223. }),
  11224. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11225. },
  11226. remember: function() {
  11227. if (f.isUndefined(S) && (S = new d,
  11228. S.domElement.innerHTML = t),
  11229. this.parent)
  11230. throw new Error("You can only call remember on a top level GUI.");
  11231. var e = this;
  11232. f.each(Array.prototype.slice.call(arguments), function(t) {
  11233. 0 == e.__rememberedObjects.length && C(e),
  11234. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11235. }),
  11236. this.autoPlace && E(this, this.width)
  11237. },
  11238. getRoot: function() {
  11239. for (var e = this; e.parent; )
  11240. e = e.parent;
  11241. return e
  11242. },
  11243. getSaveObject: function() {
  11244. var e = this.load;
  11245. return e.closed = this.closed,
  11246. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11247. e.remembered || (e.remembered = {}),
  11248. e.remembered[this.preset] = b(this)),
  11249. e.folders = {},
  11250. f.each(this.__folders, function(t, i) {
  11251. e.folders[i] = t.getSaveObject()
  11252. }),
  11253. e
  11254. },
  11255. save: function() {
  11256. this.load.remembered || (this.load.remembered = {}),
  11257. this.load.remembered[this.preset] = b(this),
  11258. T(this, !1),
  11259. this.saveToLocalStorageIfPossible()
  11260. },
  11261. saveAs: function(e) {
  11262. this.load.remembered || (this.load.remembered = {},
  11263. this.load.remembered[L] = b(this, !0)),
  11264. this.load.remembered[e] = b(this),
  11265. this.preset = e,
  11266. w(this, e, !0),
  11267. this.saveToLocalStorageIfPossible()
  11268. },
  11269. revert: function(e) {
  11270. f.each(this.__controllers, function(t) {
  11271. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11272. }, this),
  11273. f.each(this.__folders, function(e) {
  11274. e.revert(e)
  11275. }),
  11276. e || T(this.getRoot(), !1)
  11277. },
  11278. listen: function(e) {
  11279. var t = 0 == this.__listening.length;
  11280. this.__listening.push(e),
  11281. t && x(this.__listening)
  11282. }
  11283. }),
  11284. V
  11285. }(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) {
  11286. return function(s, l) {
  11287. var c = s[l];
  11288. 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,{
  11289. min: arguments[2],
  11290. max: arguments[3]
  11291. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11292. }
  11293. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11294. var n = function(e, i) {
  11295. function r() {
  11296. a.setValue(a.__input.value)
  11297. }
  11298. function o() {
  11299. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11300. }
  11301. n.superclass.call(this, e, i);
  11302. var a = this;
  11303. this.__input = document.createElement("input"),
  11304. this.__input.setAttribute("type", "text"),
  11305. t.bind(this.__input, "keyup", r),
  11306. t.bind(this.__input, "change", r),
  11307. t.bind(this.__input, "blur", o),
  11308. t.bind(this.__input, "keydown", function(e) {
  11309. 13 === e.keyCode && this.blur()
  11310. }),
  11311. this.updateDisplay(),
  11312. this.domElement.appendChild(this.__input)
  11313. };
  11314. return n.superclass = e,
  11315. i.extend(n.prototype, e.prototype, {
  11316. updateDisplay: function() {
  11317. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11318. n.superclass.prototype.updateDisplay.call(this)
  11319. }
  11320. }),
  11321. n
  11322. }(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) {
  11323. function o(e, t, i, n) {
  11324. e.style.background = "",
  11325. r.each(l, function(r) {
  11326. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11327. })
  11328. }
  11329. function a(e) {
  11330. e.style.background = "",
  11331. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11332. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11333. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11334. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11335. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11336. }
  11337. var s = function(e, l) {
  11338. function c(e) {
  11339. p(e),
  11340. t.bind(window, "mousemove", p),
  11341. t.bind(window, "mouseup", h)
  11342. }
  11343. function h() {
  11344. t.unbind(window, "mousemove", p),
  11345. t.unbind(window, "mouseup", h)
  11346. }
  11347. function u() {
  11348. var e = n(this.value);
  11349. e !== !1 ? (g.__color.__state = e,
  11350. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11351. }
  11352. function d() {
  11353. t.unbind(window, "mousemove", f),
  11354. t.unbind(window, "mouseup", d)
  11355. }
  11356. function p(e) {
  11357. e.preventDefault();
  11358. var i = t.getWidth(g.__saturation_field)
  11359. , n = t.getOffset(g.__saturation_field)
  11360. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11361. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11362. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11363. r > 1 ? r = 1 : r < 0 && (r = 0),
  11364. g.__color.v = o,
  11365. g.__color.s = r,
  11366. g.setValue(g.__color.toOriginal()),
  11367. !1
  11368. }
  11369. function f(e) {
  11370. e.preventDefault();
  11371. var i = t.getHeight(g.__hue_field)
  11372. , n = t.getOffset(g.__hue_field)
  11373. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11374. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11375. g.__color.h = 360 * r,
  11376. g.setValue(g.__color.toOriginal()),
  11377. !1
  11378. }
  11379. s.superclass.call(this, e, l),
  11380. this.__color = new i(this.getValue()),
  11381. this.__temp = new i(0);
  11382. var g = this;
  11383. this.domElement = document.createElement("div"),
  11384. t.makeSelectable(this.domElement, !1),
  11385. this.__selector = document.createElement("div"),
  11386. this.__selector.className = "selector",
  11387. this.__saturation_field = document.createElement("div"),
  11388. this.__saturation_field.className = "saturation-field",
  11389. this.__field_knob = document.createElement("div"),
  11390. this.__field_knob.className = "field-knob",
  11391. this.__field_knob_border = "2px solid ",
  11392. this.__hue_knob = document.createElement("div"),
  11393. this.__hue_knob.className = "hue-knob",
  11394. this.__hue_field = document.createElement("div"),
  11395. this.__hue_field.className = "hue-field",
  11396. this.__input = document.createElement("input"),
  11397. this.__input.type = "text",
  11398. this.__input_textShadow = "0 1px 1px ",
  11399. t.bind(this.__input, "keydown", function(e) {
  11400. 13 === e.keyCode && u.call(this)
  11401. }),
  11402. t.bind(this.__input, "blur", u),
  11403. t.bind(this.__selector, "mousedown", function(e) {
  11404. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11405. t.removeClass(g.__selector, "drag")
  11406. })
  11407. });
  11408. var m = document.createElement("div");
  11409. r.extend(this.__selector.style, {
  11410. width: "122px",
  11411. height: "102px",
  11412. padding: "3px",
  11413. backgroundColor: "#222",
  11414. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11415. }),
  11416. r.extend(this.__field_knob.style, {
  11417. position: "absolute",
  11418. width: "12px",
  11419. height: "12px",
  11420. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11421. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11422. borderRadius: "12px",
  11423. zIndex: 1
  11424. }),
  11425. r.extend(this.__hue_knob.style, {
  11426. position: "absolute",
  11427. width: "15px",
  11428. height: "2px",
  11429. borderRight: "4px solid #fff",
  11430. zIndex: 1
  11431. }),
  11432. r.extend(this.__saturation_field.style, {
  11433. width: "100px",
  11434. height: "100px",
  11435. border: "1px solid #555",
  11436. marginRight: "3px",
  11437. display: "inline-block",
  11438. cursor: "pointer"
  11439. }),
  11440. r.extend(m.style, {
  11441. width: "100%",
  11442. height: "100%",
  11443. background: "none"
  11444. }),
  11445. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11446. r.extend(this.__hue_field.style, {
  11447. width: "15px",
  11448. height: "100px",
  11449. display: "inline-block",
  11450. border: "1px solid #555",
  11451. cursor: "ns-resize"
  11452. }),
  11453. a(this.__hue_field),
  11454. r.extend(this.__input.style, {
  11455. outline: "none",
  11456. textAlign: "center",
  11457. color: "#fff",
  11458. border: 0,
  11459. fontWeight: "bold",
  11460. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11461. }),
  11462. t.bind(this.__saturation_field, "mousedown", c),
  11463. t.bind(this.__field_knob, "mousedown", c),
  11464. t.bind(this.__hue_field, "mousedown", function(e) {
  11465. f(e),
  11466. t.bind(window, "mousemove", f),
  11467. t.bind(window, "mouseup", d)
  11468. }),
  11469. this.__saturation_field.appendChild(m),
  11470. this.__selector.appendChild(this.__field_knob),
  11471. this.__selector.appendChild(this.__saturation_field),
  11472. this.__selector.appendChild(this.__hue_field),
  11473. this.__hue_field.appendChild(this.__hue_knob),
  11474. this.domElement.appendChild(this.__input),
  11475. this.domElement.appendChild(this.__selector),
  11476. this.updateDisplay()
  11477. };
  11478. s.superclass = e,
  11479. r.extend(s.prototype, e.prototype, {
  11480. updateDisplay: function() {
  11481. var e = n(this.getValue());
  11482. if (e !== !1) {
  11483. var t = !1;
  11484. r.each(i.COMPONENTS, function(i) {
  11485. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11486. return t = !0,
  11487. {}
  11488. }, this),
  11489. t && r.extend(this.__color.__state, e)
  11490. }
  11491. r.extend(this.__temp.__state, this.__color.__state),
  11492. this.__temp.a = 1;
  11493. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11494. , s = 255 - a;
  11495. r.extend(this.__field_knob.style, {
  11496. marginLeft: 100 * this.__color.s - 7 + "px",
  11497. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11498. backgroundColor: this.__temp.toString(),
  11499. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11500. }),
  11501. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11502. this.__temp.s = 1,
  11503. this.__temp.v = 1,
  11504. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11505. r.extend(this.__input.style, {
  11506. backgroundColor: this.__input.value = this.__color.toString(),
  11507. color: "rgb(" + a + "," + a + "," + a + ")",
  11508. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11509. })
  11510. }
  11511. });
  11512. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11513. return s
  11514. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11515. function r(e, t, i) {
  11516. Object.defineProperty(e, t, {
  11517. get: function() {
  11518. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11519. this.__state[t])
  11520. },
  11521. set: function(e) {
  11522. "RGB" !== this.__state.space && (a(this, t, i),
  11523. this.__state.space = "RGB"),
  11524. this.__state[t] = e
  11525. }
  11526. })
  11527. }
  11528. function o(e, t) {
  11529. Object.defineProperty(e, t, {
  11530. get: function() {
  11531. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11532. this.__state[t])
  11533. },
  11534. set: function(e) {
  11535. "HSV" !== this.__state.space && (s(this),
  11536. this.__state.space = "HSV"),
  11537. this.__state[t] = e
  11538. }
  11539. })
  11540. }
  11541. function a(e, i, r) {
  11542. if ("HEX" === e.__state.space)
  11543. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11544. else {
  11545. if ("HSV" !== e.__state.space)
  11546. throw "Corrupted color state";
  11547. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11548. }
  11549. }
  11550. function s(e) {
  11551. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11552. n.extend(e.__state, {
  11553. s: i.s,
  11554. v: i.v
  11555. }),
  11556. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11557. }
  11558. var l = function() {
  11559. if (this.__state = e.apply(this, arguments),
  11560. this.__state === !1)
  11561. throw "Failed to interpret color arguments";
  11562. this.__state.a = this.__state.a || 1
  11563. };
  11564. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11565. n.extend(l.prototype, {
  11566. toString: function() {
  11567. return i(this)
  11568. },
  11569. toOriginal: function() {
  11570. return this.__state.conversion.write(this)
  11571. }
  11572. }),
  11573. r(l.prototype, "r", 2),
  11574. r(l.prototype, "g", 1),
  11575. r(l.prototype, "b", 0),
  11576. o(l.prototype, "h"),
  11577. o(l.prototype, "s"),
  11578. o(l.prototype, "v"),
  11579. Object.defineProperty(l.prototype, "a", {
  11580. get: function() {
  11581. return this.__state.a
  11582. },
  11583. set: function(e) {
  11584. this.__state.a = e
  11585. }
  11586. }),
  11587. Object.defineProperty(l.prototype, "hex", {
  11588. get: function() {
  11589. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11590. this.__state.hex
  11591. },
  11592. set: function(e) {
  11593. this.__state.space = "HEX",
  11594. this.__state.hex = e
  11595. }
  11596. }),
  11597. l
  11598. }(n.color.interpret, n.color.math = function() {
  11599. var e;
  11600. return {
  11601. hsv_to_rgb: function(e, t, i) {
  11602. var n = Math.floor(e / 60) % 6
  11603. , r = e / 60 - Math.floor(e / 60)
  11604. , o = i * (1 - t)
  11605. , a = i * (1 - r * t)
  11606. , s = i * (1 - (1 - r) * t)
  11607. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11608. return {
  11609. r: 255 * l[0],
  11610. g: 255 * l[1],
  11611. b: 255 * l[2]
  11612. }
  11613. },
  11614. rgb_to_hsv: function(e, t, i) {
  11615. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11616. return 0 == a ? {
  11617. h: NaN,
  11618. s: 0,
  11619. v: 0
  11620. } : (r = s / a,
  11621. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11622. n /= 6,
  11623. n < 0 && (n += 1),
  11624. {
  11625. h: 360 * n,
  11626. s: r,
  11627. v: a / 255
  11628. })
  11629. },
  11630. rgb_to_hex: function(e, t, i) {
  11631. var n = this.hex_with_component(0, 2, e);
  11632. return n = this.hex_with_component(n, 1, t),
  11633. n = this.hex_with_component(n, 0, i)
  11634. },
  11635. component_from_hex: function(e, t) {
  11636. return e >> 8 * t & 255
  11637. },
  11638. hex_with_component: function(t, i, n) {
  11639. return n << (e = 8 * i) | t & ~(255 << e)
  11640. }
  11641. }
  11642. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11643. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11644. window.setTimeout(e, 1e3 / 60)
  11645. }
  11646. }(), n.dom.CenteredDiv = function(e, t) {
  11647. var i = function() {
  11648. this.backgroundElement = document.createElement("div"),
  11649. t.extend(this.backgroundElement.style, {
  11650. backgroundColor: "rgba(0,0,0,0.8)",
  11651. top: 0,
  11652. left: 0,
  11653. display: "none",
  11654. zIndex: "1000",
  11655. opacity: 0,
  11656. WebkitTransition: "opacity 0.2s linear"
  11657. }),
  11658. e.makeFullscreen(this.backgroundElement),
  11659. this.backgroundElement.style.position = "fixed",
  11660. this.domElement = document.createElement("div"),
  11661. t.extend(this.domElement.style, {
  11662. position: "fixed",
  11663. display: "none",
  11664. zIndex: "1001",
  11665. opacity: 0,
  11666. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11667. }),
  11668. document.body.appendChild(this.backgroundElement),
  11669. document.body.appendChild(this.domElement);
  11670. var i = this;
  11671. e.bind(this.backgroundElement, "click", function() {
  11672. i.hide()
  11673. })
  11674. };
  11675. return i.prototype.show = function() {
  11676. var e = this;
  11677. this.backgroundElement.style.display = "block",
  11678. this.domElement.style.display = "block",
  11679. this.domElement.style.opacity = 0,
  11680. this.domElement.style.webkitTransform = "scale(1.1)",
  11681. this.layout(),
  11682. t.defer(function() {
  11683. e.backgroundElement.style.opacity = 1,
  11684. e.domElement.style.opacity = 1,
  11685. e.domElement.style.webkitTransform = "scale(1)"
  11686. })
  11687. }
  11688. ,
  11689. i.prototype.hide = function() {
  11690. var t = this
  11691. , i = function() {
  11692. t.domElement.style.display = "none",
  11693. t.backgroundElement.style.display = "none",
  11694. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11695. e.unbind(t.domElement, "transitionend", i),
  11696. e.unbind(t.domElement, "oTransitionEnd", i)
  11697. };
  11698. e.bind(this.domElement, "webkitTransitionEnd", i),
  11699. e.bind(this.domElement, "transitionend", i),
  11700. e.bind(this.domElement, "oTransitionEnd", i),
  11701. this.backgroundElement.style.opacity = 0,
  11702. this.domElement.style.opacity = 0,
  11703. this.domElement.style.webkitTransform = "scale(1.1)"
  11704. }
  11705. ,
  11706. i.prototype.layout = function() {
  11707. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11708. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11709. }
  11710. ,
  11711. i
  11712. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11713. }
  11714. , {}],
  11715. 94: [function(e, t, i) {
  11716. (function(e) {
  11717. "use strict";
  11718. function i(t) {
  11719. function i(e) {
  11720. 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++) {
  11721. var n = _((t[i] * e + 50) / 100);
  11722. n < 1 ? n = 1 : n > 255 && (n = 255),
  11723. T[G[i]] = n
  11724. }
  11725. 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++) {
  11726. var a = _((r[o] * e + 50) / 100);
  11727. a < 1 ? a = 1 : a > 255 && (a = 255),
  11728. x[G[o]] = a
  11729. }
  11730. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11731. for (var h = 0; h < 8; h++)
  11732. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11733. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11734. l++
  11735. }
  11736. function n(e, t) {
  11737. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11738. for (var a = 1; a <= e[o]; a++)
  11739. r[t[n]] = [],
  11740. r[t[n]][0] = i,
  11741. r[t[n]][1] = o,
  11742. n++,
  11743. i++;
  11744. i *= 2
  11745. }
  11746. return r
  11747. }
  11748. function r() {
  11749. C = n(z, W),
  11750. I = n(X, Z),
  11751. E = n(j, Y),
  11752. b = n(q, K)
  11753. }
  11754. function o() {
  11755. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11756. for (var n = e; n < t; n++)
  11757. P[32767 + n] = i,
  11758. R[32767 + n] = [],
  11759. R[32767 + n][1] = i,
  11760. R[32767 + n][0] = n;
  11761. for (var r = -(t - 1); r <= -e; r++)
  11762. P[32767 + r] = i,
  11763. R[32767 + r] = [],
  11764. R[32767 + r][1] = i,
  11765. R[32767 + r][0] = t - 1 + r;
  11766. e <<= 1,
  11767. t <<= 1
  11768. }
  11769. }
  11770. function a() {
  11771. for (var e = 0; e < 256; e++)
  11772. H[e] = 19595 * e,
  11773. H[e + 256 >> 0] = 38470 * e,
  11774. H[e + 512 >> 0] = 7471 * e + 32768,
  11775. H[e + 768 >> 0] = -11059 * e,
  11776. H[e + 1024 >> 0] = -21709 * e,
  11777. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11778. H[e + 1536 >> 0] = -27439 * e,
  11779. H[e + 1792 >> 0] = -5329 * e
  11780. }
  11781. function s(e) {
  11782. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11783. t & 1 << i && (N |= 1 << B),
  11784. i--,
  11785. B--,
  11786. B < 0 && (255 == N ? (l(255),
  11787. l(0)) : l(N),
  11788. B = 7,
  11789. N = 0)
  11790. }
  11791. function l(e) {
  11792. D.push(e)
  11793. }
  11794. function c(e) {
  11795. l(e >> 8 & 255),
  11796. l(255 & e)
  11797. }
  11798. function h(e, t) {
  11799. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11800. for (h = 0; h < d; ++h) {
  11801. i = e[u],
  11802. n = e[u + 1],
  11803. r = e[u + 2],
  11804. o = e[u + 3],
  11805. a = e[u + 4],
  11806. s = e[u + 5],
  11807. l = e[u + 6],
  11808. c = e[u + 7];
  11809. var f = i + c
  11810. , g = i - c
  11811. , m = n + l
  11812. , v = n - l
  11813. , A = r + s
  11814. , y = r - s
  11815. , C = o + a
  11816. , I = o - a
  11817. , E = f + C
  11818. , b = f - C
  11819. , w = m + A
  11820. , _ = m - A;
  11821. e[u] = E + w,
  11822. e[u + 4] = E - w;
  11823. var T = .707106781 * (_ + b);
  11824. e[u + 2] = b + T,
  11825. e[u + 6] = b - T,
  11826. E = I + y,
  11827. w = y + v,
  11828. _ = v + g;
  11829. var x = .382683433 * (E - _)
  11830. , S = .5411961 * E + x
  11831. , M = 1.306562965 * _ + x
  11832. , R = .707106781 * w
  11833. , P = g + R
  11834. , L = g - R;
  11835. e[u + 5] = L + S,
  11836. e[u + 3] = L - S,
  11837. e[u + 1] = P + M,
  11838. e[u + 7] = P - M,
  11839. u += 8
  11840. }
  11841. for (u = 0,
  11842. h = 0; h < d; ++h) {
  11843. i = e[u],
  11844. n = e[u + 8],
  11845. r = e[u + 16],
  11846. o = e[u + 24],
  11847. a = e[u + 32],
  11848. s = e[u + 40],
  11849. l = e[u + 48],
  11850. c = e[u + 56];
  11851. var D = i + c
  11852. , N = i - c
  11853. , B = n + l
  11854. , F = n - l
  11855. , V = r + s
  11856. , U = r - s
  11857. , k = o + a
  11858. , H = o - a
  11859. , G = D + k
  11860. , z = D - k
  11861. , W = B + V
  11862. , j = B - V;
  11863. e[u] = G + W,
  11864. e[u + 32] = G - W;
  11865. var Y = .707106781 * (j + z);
  11866. e[u + 16] = z + Y,
  11867. e[u + 48] = z - Y,
  11868. G = H + U,
  11869. W = U + F,
  11870. j = F + N;
  11871. var X = .382683433 * (G - j)
  11872. , Z = .5411961 * G + X
  11873. , q = 1.306562965 * j + X
  11874. , K = .707106781 * W
  11875. , Q = N + K
  11876. , J = N - K;
  11877. e[u + 40] = J + Z,
  11878. e[u + 24] = J - Z,
  11879. e[u + 8] = Q + q,
  11880. e[u + 56] = Q - q,
  11881. u++
  11882. }
  11883. var $;
  11884. for (h = 0; h < p; ++h)
  11885. $ = e[h] * t[h],
  11886. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11887. return O
  11888. }
  11889. function u() {
  11890. c(65504),
  11891. c(16),
  11892. l(74),
  11893. l(70),
  11894. l(73),
  11895. l(70),
  11896. l(0),
  11897. l(1),
  11898. l(1),
  11899. l(0),
  11900. c(1),
  11901. c(1),
  11902. l(0),
  11903. l(0)
  11904. }
  11905. function d(e, t) {
  11906. c(65472),
  11907. c(17),
  11908. l(8),
  11909. c(t),
  11910. c(e),
  11911. l(3),
  11912. l(1),
  11913. l(17),
  11914. l(0),
  11915. l(2),
  11916. l(17),
  11917. l(1),
  11918. l(3),
  11919. l(17),
  11920. l(1)
  11921. }
  11922. function p() {
  11923. c(65499),
  11924. c(132),
  11925. l(0);
  11926. for (var e = 0; e < 64; e++)
  11927. l(T[e]);
  11928. l(1);
  11929. for (var t = 0; t < 64; t++)
  11930. l(x[t])
  11931. }
  11932. function f() {
  11933. c(65476),
  11934. c(418),
  11935. l(0);
  11936. for (var e = 0; e < 16; e++)
  11937. l(z[e + 1]);
  11938. for (var t = 0; t <= 11; t++)
  11939. l(W[t]);
  11940. l(16);
  11941. for (var i = 0; i < 16; i++)
  11942. l(j[i + 1]);
  11943. for (var n = 0; n <= 161; n++)
  11944. l(Y[n]);
  11945. l(1);
  11946. for (var r = 0; r < 16; r++)
  11947. l(X[r + 1]);
  11948. for (var o = 0; o <= 11; o++)
  11949. l(Z[o]);
  11950. l(17);
  11951. for (var a = 0; a < 16; a++)
  11952. l(q[a + 1]);
  11953. for (var s = 0; s <= 161; s++)
  11954. l(K[s])
  11955. }
  11956. function g() {
  11957. c(65498),
  11958. c(12),
  11959. l(3),
  11960. l(1),
  11961. l(0),
  11962. l(2),
  11963. l(17),
  11964. l(3),
  11965. l(17),
  11966. l(0),
  11967. l(63),
  11968. l(0)
  11969. }
  11970. function m(e, t, i, n, r) {
  11971. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11972. L[G[f]] = p[f];
  11973. var g = L[0] - i;
  11974. i = L[0],
  11975. 0 == g ? s(n[0]) : (o = 32767 + g,
  11976. s(n[P[o]]),
  11977. s(R[o]));
  11978. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11979. ;
  11980. if (0 == m)
  11981. return s(a),
  11982. i;
  11983. for (var v, A = 1; A <= m; ) {
  11984. for (var y = A; 0 == L[A] && A <= m; ++A)
  11985. ;
  11986. var C = A - y;
  11987. if (C >= c) {
  11988. v = C >> 4;
  11989. for (var I = 1; I <= v; ++I)
  11990. s(l);
  11991. C &= 15
  11992. }
  11993. o = 32767 + L[A],
  11994. s(r[(C << 4) + P[o]]),
  11995. s(R[o]),
  11996. A++
  11997. }
  11998. return m != u && s(a),
  11999. i
  12000. }
  12001. function v() {
  12002. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  12003. k[t] = e(t)
  12004. }
  12005. function A(e) {
  12006. if (e <= 0 && (e = 1),
  12007. e > 100 && (e = 100),
  12008. w != e) {
  12009. var t = 0;
  12010. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  12011. i(t),
  12012. w = e
  12013. }
  12014. }
  12015. function y() {
  12016. var e = (new Date).getTime();
  12017. t || (t = 50),
  12018. v(),
  12019. r(),
  12020. o(),
  12021. a(),
  12022. A(t);
  12023. (new Date).getTime() - e
  12024. }
  12025. var C, I, E, b, w, _ = (Math.round,
  12026. 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];
  12027. this.encode = function(t, i) {
  12028. var n = ((new Date).getTime(),
  12029. i.quality);
  12030. n && A(n),
  12031. D = new Array,
  12032. N = 0,
  12033. B = 7,
  12034. c(65496),
  12035. u(),
  12036. p(),
  12037. d(t.width, t.height),
  12038. f(),
  12039. g();
  12040. var r = 0
  12041. , o = 0
  12042. , a = 0;
  12043. N = 0,
  12044. B = 7,
  12045. this.encode.displayName = "_encode_";
  12046. 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; ) {
  12047. for (l = 0; l < G; ) {
  12048. for (w = G * z + l,
  12049. _ = w,
  12050. T = -1,
  12051. x = 0,
  12052. R = 0; R < 64; R++)
  12053. x = (k ? 63 - R : R) >> 3,
  12054. T = 4 * (7 & R),
  12055. _ = w + x * G + T,
  12056. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12057. l + T >= G && (_ -= l + T - G + 4),
  12058. h = P[_++],
  12059. v = P[_++],
  12060. y = P[_++],
  12061. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12062. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12063. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12064. r = m(F, S, r, C, E),
  12065. o = m(V, M, o, I, b),
  12066. a = m(U, M, a, I, b),
  12067. l += 32
  12068. }
  12069. z += W
  12070. }
  12071. if (B >= 0) {
  12072. var j = [];
  12073. j[1] = B + 1,
  12074. j[0] = (1 << B + 1) - 1,
  12075. s(j)
  12076. }
  12077. return c(65497),
  12078. new e(D)
  12079. }
  12080. ,
  12081. y()
  12082. }
  12083. function n(e, t) {
  12084. t = t || {},
  12085. t.quality = t.quality || 50;
  12086. var n = t.quality
  12087. , r = new i(n)
  12088. , o = r.encode(e, t);
  12089. return {
  12090. data: o,
  12091. width: e.width,
  12092. height: e.height
  12093. }
  12094. }
  12095. t.exports.encode = n
  12096. }
  12097. ).call(this, e("buffer").Buffer)
  12098. }
  12099. , {
  12100. buffer: 198
  12101. }],
  12102. 95: [function(e, t, i) {
  12103. "use strict";
  12104. !function() {
  12105. if ("performance"in window == !1 && (window.performance = {}),
  12106. Date.now = Date.now || function() {
  12107. return (new Date).getTime()
  12108. }
  12109. ,
  12110. "now"in window.performance == !1) {
  12111. var e = Date.now();
  12112. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12113. window.performance.now = function() {
  12114. return Date.now() - e
  12115. }
  12116. }
  12117. }()
  12118. }
  12119. , {}],
  12120. 96: [function(e, t, i) {
  12121. "use strict";
  12122. var n = e("three");
  12123. n.EffectComposer = function(e, t) {
  12124. if (this.renderer = e,
  12125. void 0 === t) {
  12126. var i = {
  12127. minFilter: n.LinearFilter,
  12128. magFilter: n.LinearFilter,
  12129. format: n.RGBAFormat,
  12130. stencilBuffer: !1
  12131. }
  12132. , r = e.getSize();
  12133. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12134. }
  12135. this.renderTarget1 = t,
  12136. this.renderTarget2 = t.clone(),
  12137. this.writeBuffer = this.renderTarget1,
  12138. this.readBuffer = this.renderTarget2,
  12139. this.passes = [],
  12140. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12141. this.copyPass = new n.ShaderPass(n.CopyShader)
  12142. }
  12143. ,
  12144. n.EffectComposer.prototype = {
  12145. swapBuffers: function() {
  12146. var e = this.readBuffer;
  12147. this.readBuffer = this.writeBuffer,
  12148. this.writeBuffer = e
  12149. },
  12150. addPass: function(e) {
  12151. this.passes.push(e)
  12152. },
  12153. insertPass: function(e, t) {
  12154. this.passes.splice(t, 0, e)
  12155. },
  12156. render: function(e) {
  12157. this.writeBuffer = this.renderTarget1,
  12158. this.readBuffer = this.renderTarget2;
  12159. var t, i, r = !1, o = this.passes.length;
  12160. for (i = 0; i < o; i++)
  12161. if (t = this.passes[i],
  12162. t.enabled) {
  12163. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12164. t.needsSwap) {
  12165. if (r) {
  12166. var a = this.renderer.context;
  12167. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12168. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12169. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12170. }
  12171. this.swapBuffers()
  12172. }
  12173. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12174. }
  12175. },
  12176. reset: function(e) {
  12177. if (void 0 === e) {
  12178. var t = this.renderer.getSize();
  12179. e = this.renderTarget1.clone(),
  12180. e.setSize(t.width, t.height)
  12181. }
  12182. this.renderTarget1.dispose(),
  12183. this.renderTarget2.dispose(),
  12184. this.renderTarget1 = e,
  12185. this.renderTarget2 = e.clone(),
  12186. this.writeBuffer = this.renderTarget1,
  12187. this.readBuffer = this.renderTarget2
  12188. },
  12189. setSize: function(e, t) {
  12190. this.renderTarget1.setSize(e, t),
  12191. this.renderTarget2.setSize(e, t)
  12192. this.passes.forEach(a=>{//add
  12193. a.setSize && a.setSize(e, t)
  12194. })
  12195. }
  12196. }
  12197. }
  12198. , {
  12199. three: 217
  12200. }],
  12201. 97: [function(e, t, i) {
  12202. "use strict";
  12203. var n = e("three");
  12204. n.MaskPass = function(e, t) {
  12205. this.scene = e,
  12206. this.camera = t,
  12207. this.enabled = !0,
  12208. this.clear = !0,
  12209. this.needsSwap = !1,
  12210. this.inverse = !1
  12211. }
  12212. ,
  12213. n.MaskPass.prototype = {
  12214. render: function(e, t, i, n) {
  12215. var r = e.context;
  12216. r.colorMask(!1, !1, !1, !1),
  12217. r.depthMask(!1);
  12218. var o, a;
  12219. this.inverse ? (o = 0,
  12220. a = 1) : (o = 1,
  12221. a = 0),
  12222. r.enable(r.STENCIL_TEST),
  12223. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12224. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12225. r.clearStencil(a),
  12226. e.render(this.scene, this.camera, i, this.clear),
  12227. e.render(this.scene, this.camera, t, this.clear),
  12228. r.colorMask(!0, !0, !0, !0),
  12229. r.depthMask(!0),
  12230. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12231. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12232. }
  12233. },
  12234. n.ClearMaskPass = function() {
  12235. this.enabled = !0
  12236. }
  12237. ,
  12238. n.ClearMaskPass.prototype = {
  12239. render: function(e, t, i, n) {
  12240. var r = e.context;
  12241. r.disable(r.STENCIL_TEST)
  12242. }
  12243. }
  12244. }
  12245. , {
  12246. three: 217
  12247. }],
  12248. 98: [function(e, t, i) {
  12249. "use strict";
  12250. var n = e("three");
  12251. n.RenderPass = function(e, t, i, r, o) {
  12252. this.scene = e,
  12253. this.camera = t,
  12254. this.overrideMaterial = i,
  12255. this.clearColor = r,
  12256. this.clearAlpha = void 0 !== o ? o : 1,
  12257. this.oldClearColor = new n.Color,
  12258. this.oldClearAlpha = 1,
  12259. this.enabled = !0,
  12260. this.clear = !0,
  12261. this.needsSwap = !1
  12262. }
  12263. ,
  12264. n.RenderPass.prototype = {
  12265. render: function(e, t, i, n) {
  12266. this.scene.overrideMaterial = this.overrideMaterial,
  12267. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12268. this.oldClearAlpha = e.getClearAlpha(),
  12269. e.setClearColor(this.clearColor, this.clearAlpha)),
  12270. e.render(this.scene, this.camera, i, this.clear),
  12271. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12272. this.scene.overrideMaterial = null
  12273. }
  12274. }
  12275. }
  12276. , {
  12277. three: 217
  12278. }],
  12279. 99: [function(e, t, i) {
  12280. "use strict";
  12281. var n = e("three");
  12282. n.ShaderPass = function(e, t) {
  12283. this.textureID = void 0 !== t ? t : "tDiffuse",
  12284. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12285. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12286. this.material = new n.ShaderMaterial({
  12287. defines: e.defines || {},
  12288. uniforms: this.uniforms,
  12289. vertexShader: e.vertexShader,
  12290. fragmentShader: e.fragmentShader
  12291. })),
  12292. this.renderToScreen = !1,
  12293. this.enabled = !0,
  12294. this.needsSwap = !0,
  12295. this.clear = !1,
  12296. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12297. this.scene = new n.Scene,
  12298. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12299. this.scene.add(this.quad)
  12300. }
  12301. ,
  12302. n.ShaderPass.prototype = {
  12303. render: function(e, t, i, n) {
  12304. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12305. this.quad.material = this.material,
  12306. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12307. }
  12308. }
  12309. }
  12310. , {
  12311. three: 217
  12312. }],
  12313. 100: [function(e, t, i) {
  12314. "use strict";
  12315. var n = e("three");
  12316. n.CopyShader = {
  12317. uniforms: {
  12318. tDiffuse: {
  12319. type: "t",
  12320. value: null
  12321. },
  12322. opacity: {
  12323. type: "f",
  12324. value: 1
  12325. }
  12326. },
  12327. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12328. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12329. }
  12330. }
  12331. , {
  12332. three: 217
  12333. }],
  12334. 101: [function(e, t, i) {
  12335. "use strict";
  12336. var n = e("three");
  12337. n.HorizontalBlurShader = {
  12338. uniforms: {
  12339. tDiffuse: {
  12340. type: "t",
  12341. value: null
  12342. },
  12343. h: {
  12344. type: "f",
  12345. value: 1 / 512
  12346. }
  12347. },
  12348. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12349. 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")
  12350. }
  12351. }
  12352. , {
  12353. three: 217
  12354. }],
  12355. 102: [function(e, t, i) {
  12356. "use strict";
  12357. var n = e("three");
  12358. n.VerticalBlurShader = {
  12359. uniforms: {
  12360. tDiffuse: {
  12361. type: "t",
  12362. value: null
  12363. },
  12364. v: {
  12365. type: "f",
  12366. value: 1 / 512
  12367. }
  12368. },
  12369. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12370. 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")
  12371. }
  12372. }
  12373. , {
  12374. three: 217
  12375. }],
  12376. 103: [function(e, t, i) {
  12377. "use strict";
  12378. var n = e("three");
  12379. !function() {
  12380. if ("performance"in window == 0 && (window.performance = {}),
  12381. "now"in window.performance == 0) {
  12382. var e = Date.now();
  12383. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12384. window.performance.now = function() {
  12385. return Date.now() - e
  12386. }
  12387. }
  12388. }(),
  12389. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12390. var t, i = this.extensions, r = this.context;
  12391. if (e === n.RepeatWrapping)
  12392. return r.REPEAT;
  12393. if (e === n.ClampToEdgeWrapping)
  12394. return r.CLAMP_TO_EDGE;
  12395. if (e === n.MirroredRepeatWrapping)
  12396. return r.MIRRORED_REPEAT;
  12397. if (e === n.NearestFilter)
  12398. return r.NEAREST;
  12399. if (e === n.NearestMipMapNearestFilter)
  12400. return r.NEAREST_MIPMAP_NEAREST;
  12401. if (e === n.NearestMipMapLinearFilter)
  12402. return r.NEAREST_MIPMAP_LINEAR;
  12403. if (e === n.LinearFilter)
  12404. return r.LINEAR;
  12405. if (e === n.LinearMipMapNearestFilter)
  12406. return r.LINEAR_MIPMAP_NEAREST;
  12407. if (e === n.LinearMipMapLinearFilter)
  12408. return r.LINEAR_MIPMAP_LINEAR;
  12409. if (e === n.UnsignedByteType)
  12410. return r.UNSIGNED_BYTE;
  12411. if (e === n.UnsignedShort4444Type)
  12412. return r.UNSIGNED_SHORT_4_4_4_4;
  12413. if (e === n.UnsignedShort5551Type)
  12414. return r.UNSIGNED_SHORT_5_5_5_1;
  12415. if (e === n.UnsignedShort565Type)
  12416. return r.UNSIGNED_SHORT_5_6_5;
  12417. if (e === n.ByteType)
  12418. return r.BYTE;
  12419. if (e === n.ShortType)
  12420. return r.SHORT;
  12421. if (e === n.UnsignedShortType)
  12422. return r.UNSIGNED_SHORT;
  12423. if (e === n.IntType)
  12424. return r.INT;
  12425. if (e === n.UnsignedIntType)
  12426. return r.UNSIGNED_INT;
  12427. if (e === n.FloatType)
  12428. return r.FLOAT;
  12429. if (t = i.get("OES_texture_half_float"),
  12430. null !== t && e === n.HalfFloatType)
  12431. return t.HALF_FLOAT_OES;
  12432. if (e === n.AlphaFormat)
  12433. return r.ALPHA;
  12434. if (e === n.RGBFormat)
  12435. return r.RGB;
  12436. if (e === n.RGBAFormat)
  12437. return r.RGBA;
  12438. if (e === n.LuminanceFormat)
  12439. return r.LUMINANCE;
  12440. if (e === n.LuminanceAlphaFormat)
  12441. return r.LUMINANCE_ALPHA;
  12442. if (e === n.AddEquation)
  12443. return r.FUNC_ADD;
  12444. if (e === n.SubtractEquation)
  12445. return r.FUNC_SUBTRACT;
  12446. if (e === n.ReverseSubtractEquation)
  12447. return r.FUNC_REVERSE_SUBTRACT;
  12448. if (e === n.ZeroFactor)
  12449. return r.ZERO;
  12450. if (e === n.OneFactor)
  12451. return r.ONE;
  12452. if (e === n.SrcColorFactor)
  12453. return r.SRC_COLOR;
  12454. if (e === n.OneMinusSrcColorFactor)
  12455. return r.ONE_MINUS_SRC_COLOR;
  12456. if (e === n.SrcAlphaFactor)
  12457. return r.SRC_ALPHA;
  12458. if (e === n.OneMinusSrcAlphaFactor)
  12459. return r.ONE_MINUS_SRC_ALPHA;
  12460. if (e === n.DstAlphaFactor)
  12461. return r.DST_ALPHA;
  12462. if (e === n.OneMinusDstAlphaFactor)
  12463. return r.ONE_MINUS_DST_ALPHA;
  12464. if (e === n.DstColorFactor)
  12465. return r.DST_COLOR;
  12466. if (e === n.OneMinusDstColorFactor)
  12467. return r.ONE_MINUS_DST_COLOR;
  12468. if (e === n.SrcAlphaSaturateFactor)
  12469. return r.SRC_ALPHA_SATURATE;
  12470. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12471. null !== t) {
  12472. if (e === n.RGB_S3TC_DXT1_Format)
  12473. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12474. if (e === n.RGBA_S3TC_DXT1_Format)
  12475. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12476. if (e === n.RGBA_S3TC_DXT3_Format)
  12477. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12478. if (e === n.RGBA_S3TC_DXT5_Format)
  12479. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12480. }
  12481. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12482. null !== t) {
  12483. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12484. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12485. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12486. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12487. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12488. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12489. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12490. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12491. }
  12492. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12493. null !== t && e === n.RGB_ETC1_Format)
  12494. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12495. if (t = i.get("EXT_blend_minmax"),
  12496. null !== t) {
  12497. if (e === n.MinEquation)
  12498. return t.MIN_EXT;
  12499. if (e === n.MaxEquation)
  12500. return t.MAX_EXT
  12501. }
  12502. return 0
  12503. }
  12504. ,
  12505. n.WebGLState = function(e, t, i) {
  12506. var r = this
  12507. , o = new n.Vector4
  12508. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12509. , s = new Uint8Array(a)
  12510. , l = new Uint8Array(a)
  12511. , c = new Uint8Array(a)
  12512. , h = {}
  12513. , u = null
  12514. , d = null
  12515. , p = null
  12516. , f = null
  12517. , g = null
  12518. , m = null
  12519. , v = null
  12520. , A = null
  12521. , y = !1
  12522. , C = null
  12523. , I = null
  12524. , E = null
  12525. , b = null
  12526. , w = null
  12527. , _ = null
  12528. , T = null
  12529. , x = null
  12530. , S = null
  12531. , M = null
  12532. , R = null
  12533. , P = null
  12534. , O = null
  12535. , L = null
  12536. , D = null
  12537. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12538. , B = void 0
  12539. , F = {}
  12540. , V = new n.Vector4
  12541. , U = null
  12542. , k = null
  12543. , H = new n.Vector4
  12544. , G = new n.Vector4;
  12545. this.init = function() {
  12546. this.clearColor(0, 0, 0, 1),
  12547. this.clearDepth(1),
  12548. this.clearStencil(0),
  12549. this.enable(e.DEPTH_TEST),
  12550. e.depthFunc(e.LEQUAL),
  12551. e.frontFace(e.CCW),
  12552. e.cullFace(e.BACK),
  12553. this.enable(e.CULL_FACE),
  12554. this.enable(e.BLEND),
  12555. e.blendEquation(e.FUNC_ADD),
  12556. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12557. }
  12558. ,
  12559. this.initAttributes = function() {
  12560. for (var e = 0, t = s.length; e < t; e++)
  12561. s[e] = 0
  12562. }
  12563. ,
  12564. this.enableAttribute = function(i) {
  12565. if (s[i] = 1,
  12566. 0 === l[i] && (e.enableVertexAttribArray(i),
  12567. l[i] = 1),
  12568. 0 !== c[i]) {
  12569. var n = t.get("ANGLE_instanced_arrays");
  12570. n.vertexAttribDivisorANGLE(i, 0),
  12571. c[i] = 0
  12572. }
  12573. }
  12574. ,
  12575. this.enableAttributeAndDivisor = function(t, i, n) {
  12576. s[t] = 1,
  12577. 0 === l[t] && (e.enableVertexAttribArray(t),
  12578. l[t] = 1),
  12579. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12580. c[t] = i)
  12581. }
  12582. ,
  12583. this.disableUnusedAttributes = function() {
  12584. for (var t = 0, i = l.length; t < i; t++)
  12585. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12586. l[t] = 0)
  12587. }
  12588. ,
  12589. this.enable = function(t) {
  12590. h[t] !== !0 && (e.enable(t),
  12591. h[t] = !0)
  12592. }
  12593. ,
  12594. this.disable = function(t) {
  12595. h[t] !== !1 && (e.disable(t),
  12596. h[t] = !1)
  12597. }
  12598. ,
  12599. this.getCompressedTextureFormats = function() {
  12600. if (null === u && (u = [],
  12601. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12602. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12603. u.push(i[n]);
  12604. return u
  12605. }
  12606. ,
  12607. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12608. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12609. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12610. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12611. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12612. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12613. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12614. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12615. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12616. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12617. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12618. d = t,
  12619. y = h),
  12620. t === n.CustomBlending ? (s = s || r,
  12621. l = l || o,
  12622. c = c || a,
  12623. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12624. p = r,
  12625. m = s),
  12626. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12627. f = o,
  12628. g = a,
  12629. v = l,
  12630. A = c)) : (p = null,
  12631. f = null,
  12632. g = null,
  12633. m = null,
  12634. v = null,
  12635. A = null)
  12636. }
  12637. ,
  12638. this.setDepthFunc = function(t) {
  12639. if (C !== t) {
  12640. if (t)
  12641. switch (t) {
  12642. case n.NeverDepth:
  12643. e.depthFunc(e.NEVER);
  12644. break;
  12645. case n.AlwaysDepth:
  12646. e.depthFunc(e.ALWAYS);
  12647. break;
  12648. case n.LessDepth:
  12649. e.depthFunc(e.LESS);
  12650. break;
  12651. case n.LessEqualDepth:
  12652. e.depthFunc(e.LEQUAL);
  12653. break;
  12654. case n.EqualDepth:
  12655. e.depthFunc(e.EQUAL);
  12656. break;
  12657. case n.GreaterEqualDepth:
  12658. e.depthFunc(e.GEQUAL);
  12659. break;
  12660. case n.GreaterDepth:
  12661. e.depthFunc(e.GREATER);
  12662. break;
  12663. case n.NotEqualDepth:
  12664. e.depthFunc(e.NOTEQUAL);
  12665. break;
  12666. default:
  12667. e.depthFunc(e.LEQUAL)
  12668. }
  12669. else
  12670. e.depthFunc(e.LEQUAL);
  12671. C = t
  12672. }
  12673. }
  12674. ,
  12675. this.setDepthTest = function(t) {
  12676. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12677. }
  12678. ,
  12679. this.setDepthWrite = function(t) {
  12680. I !== t && (e.depthMask(t),
  12681. I = t)
  12682. }
  12683. ,
  12684. this.setColorWrite = function(t) {
  12685. E !== t && (e.colorMask(t, t, t, t),
  12686. E = t)
  12687. }
  12688. ,
  12689. this.setStencilFunc = function(t, i, n) {
  12690. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12691. w = t,
  12692. _ = i,
  12693. T = n)
  12694. }
  12695. ,
  12696. this.setStencilOp = function(t, i, n) {
  12697. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12698. x = t,
  12699. S = i,
  12700. M = n)
  12701. }
  12702. ,
  12703. this.setStencilTest = function(t) {
  12704. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12705. }
  12706. ,
  12707. this.setStencilWrite = function(t) {
  12708. b !== t && (e.stencilMask(t),
  12709. b = t)
  12710. }
  12711. ,
  12712. this.setFlipSided = function(t) {
  12713. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12714. R = t)
  12715. }
  12716. ,
  12717. this.setLineWidth = function(t) {
  12718. t !== P && (e.lineWidth(t),
  12719. P = t)
  12720. }
  12721. ,
  12722. this.setPolygonOffset = function(t, i, n) {
  12723. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12724. !t || O === i && L === n || (e.polygonOffset(i, n),
  12725. O = i,
  12726. L = n)
  12727. }
  12728. ,
  12729. this.getScissorTest = function() {
  12730. return D
  12731. }
  12732. ,
  12733. this.setScissorTest = function(t) {
  12734. D = t,
  12735. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12736. }
  12737. ,
  12738. this.activeTexture = function(t) {
  12739. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12740. B !== t && (e.activeTexture(t),
  12741. B = t)
  12742. }
  12743. ,
  12744. this.bindTexture = function(t, i) {
  12745. void 0 === B && r.activeTexture();
  12746. var n = F[B];
  12747. void 0 === n && (n = {
  12748. type: void 0,
  12749. texture: void 0
  12750. },
  12751. F[B] = n),
  12752. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12753. n.type = t,
  12754. n.texture = i)
  12755. }
  12756. ,
  12757. this.compressedTexImage2D = function() {
  12758. try {
  12759. e.compressedTexImage2D.apply(e, arguments)
  12760. } catch (e) {
  12761. console.error(e)
  12762. }
  12763. }
  12764. ,
  12765. this.texImage2D = function() {
  12766. try {
  12767. e.texImage2D.apply(e, arguments)
  12768. } catch (e) {
  12769. console.error(e)
  12770. }
  12771. }
  12772. ,
  12773. this.clearColor = function(t, i, n, r) {
  12774. o.set(t, i, n, r),
  12775. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12776. V.copy(o))
  12777. }
  12778. ,
  12779. this.clearDepth = function(t) {
  12780. U !== t && (e.clearDepth(t),
  12781. U = t)
  12782. }
  12783. ,
  12784. this.clearStencil = function(t) {
  12785. k !== t && (e.clearStencil(t),
  12786. k = t)
  12787. }
  12788. ,
  12789. this.scissor = function(t) {
  12790. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12791. H.copy(t))
  12792. }
  12793. ,
  12794. this.viewport = function(t) {
  12795. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12796. G.copy(t))
  12797. }
  12798. ,
  12799. this.reset = function() {
  12800. for (var t = 0; t < l.length; t++)
  12801. 1 === l[t] && (e.disableVertexAttribArray(t),
  12802. l[t] = 0);
  12803. h = {},
  12804. u = null,
  12805. B = void 0,
  12806. F = {},
  12807. d = null,
  12808. E = null,
  12809. I = null,
  12810. b = null,
  12811. R = null
  12812. }
  12813. }
  12814. }
  12815. , {
  12816. three: 217
  12817. }],
  12818. 104: [function(e, t, i) {
  12819. (function(i, n) {
  12820. "use strict";
  12821. function r(e) {
  12822. this.urls = e;
  12823. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12824. this.builder = a.loadProto(t),
  12825. this.decoder = this.builder.build("binary_mesh")
  12826. }
  12827. var o = e("three")
  12828. , a = e("protobufjs")
  12829. , s = e("../util/logger")
  12830. , l = (e("../util/common"),
  12831. e("../util/ajax"))
  12832. , c = e("../objects/Chunk")
  12833. , h = new s(n);
  12834. r.prototype = {
  12835. constructor: r,
  12836. load: function(e, t, i, n) {
  12837. return h.time("download"),
  12838. l.get(e, {
  12839. responseType: "arraybuffer"
  12840. }).done(function(r) {
  12841. h.timeEnd("download"),
  12842. this.parse(r, e, t, i, n)
  12843. }
  12844. .bind(this)).fail(n)
  12845. },
  12846. parse: function(e, t, i, n, r) {
  12847. var o = this.readProtobuf(e);
  12848. if (!o)
  12849. return r();
  12850. try {
  12851. h.time("convert to webgl"),
  12852. this.convertProtobufToSceneObject(o, t, i, n, r),
  12853. h.timeEnd("convert to webgl")
  12854. } catch (e) {
  12855. return h.error("failed parsing .dam"),
  12856. h.error(e.message),
  12857. r()
  12858. }
  12859. },
  12860. readProtobuf: function(e) {
  12861. var t;
  12862. try {
  12863. h.time("parse proto"),
  12864. t = this.decoder.decode(e),
  12865. h.timeEnd("parse proto")
  12866. } catch (e) {
  12867. return h.error("failed parsing proto for .dam"),
  12868. h.error(e.message),
  12869. null
  12870. }
  12871. return t
  12872. },
  12873. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12874. function a(e) {
  12875. var i = new o.BufferGeometry;
  12876. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12877. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12878. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12879. i.applyMatrix(s),
  12880. i.computeBoundingBox(),
  12881. new c({
  12882. geometry: i,
  12883. textureName: e.material_name,
  12884. name: e.chunk_name,
  12885. meshUrl: t
  12886. })
  12887. }
  12888. if (0 === e.chunk.length)
  12889. return h.warn("No chunks in damfile..."),
  12890. i([]);
  12891. var s = new o.Matrix4;
  12892. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12893. var l = e.chunk.map(a);
  12894. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12895. r())
  12896. }
  12897. },
  12898. t.exports = r
  12899. }
  12900. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12901. }
  12902. , {
  12903. "../objects/Chunk": 144,
  12904. "../util/ajax": 181,
  12905. "../util/common": 185,
  12906. "../util/logger": 189,
  12907. buffer: 198,
  12908. protobufjs: 214,
  12909. three: 217
  12910. }],
  12911. 105: [function(e, t, i) {
  12912. (function(i) {
  12913. "use strict";
  12914. var n = (e("three"),
  12915. e("../settings"),
  12916. e("../util/browser"),
  12917. e("./DamLoader"))
  12918. , r = e("../util/logger")
  12919. , o = (e("../ab"),
  12920. new r(i));
  12921. t.exports = {
  12922. getLoaders: function() {
  12923. return [["_50k", ".dam", n], ["", ".dam", n]]
  12924. },
  12925. load: function(e, t, i, n, r, a) {
  12926. var s = this.getLoaders();
  12927. a = a || 0;
  12928. var l = s[a];
  12929. if (!l)
  12930. return void (r && r("No suitable model file found..."));
  12931. var c = l[0]
  12932. , h = l[1]
  12933. , u = new l[2](t)
  12934. , d = t.get(e + c + h);
  12935. d ? (o.debug("Trying " + c + h),
  12936. u.load(d, i, n, function() {
  12937. this.load(e, t, i, n, r, ++a)
  12938. }
  12939. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12940. this.load(e, t, i, n, r, ++a))
  12941. }
  12942. }
  12943. }
  12944. ).call(this, "/js/loaders/ModelLoader.js")
  12945. }
  12946. , {
  12947. "../ab": 3,
  12948. "../settings": 166,
  12949. "../util/browser": 182,
  12950. "../util/logger": 189,
  12951. "./DamLoader": 104,
  12952. three: 217
  12953. }],
  12954. 106: [function(e, t, i) {
  12955. (function(i) {
  12956. "use strict";
  12957. var n = e("../util/common")
  12958. , r = e("../util/texture")
  12959. , o = e("../util/browser")
  12960. , a = e("../util/logger")
  12961. , s = e("../settings")
  12962. , l = new a(i);
  12963. t.exports = {
  12964. load: function(e, t) {
  12965. function i(e, i) {
  12966. e || (t.push(i),
  12967. p++,
  12968. d.notify(p, a),
  12969. p === a && d.resolve())
  12970. }
  12971. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12972. return $.when();
  12973. var a = n.countUnique(e.chunks.map(function(e) {
  12974. return e.textureName
  12975. }))
  12976. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12977. , h = "_50k" === c ? "high" : "low";
  12978. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12979. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12980. h = "low"));
  12981. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12982. , d = $.Deferred()
  12983. , p = 0;
  12984. return e.chunks.forEach(function(t) {
  12985. if (!t.material.map && t.textureName) {
  12986. var n = e.urls.get(u + t.textureName);
  12987. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12988. }
  12989. }),
  12990. d.promise()
  12991. }
  12992. }
  12993. }
  12994. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12995. }
  12996. , {
  12997. "../settings": 166,
  12998. "../util/browser": 182,
  12999. "../util/common": 185,
  13000. "../util/logger": 189,
  13001. "../util/texture": 194
  13002. }],
  13003. 107: [function(e, t, i) {
  13004. (function(i, n) {
  13005. "use strict";
  13006. function r(e) {
  13007. this.model = e,
  13008. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  13009. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  13010. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  13011. , n = o.loadProto(t);
  13012. this.decoder = n.build("VisionModeldata")
  13013. }
  13014. var o = e("protobufjs")
  13015. , a = e("../util/ajax")
  13016. , s = (e("../util/common"),
  13017. e("../util/math"))
  13018. , l = e("../util/logger")
  13019. , c = new l(n);
  13020. r.prototype.load = function() {
  13021. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  13022. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  13023. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  13024. $.when([]))
  13025. }
  13026. ,
  13027. r.prototype.loadVisionModelData = function() {
  13028. return a.get(this.modelDataPath, {
  13029. responseType: "arraybuffer"
  13030. }).then(function(e) {
  13031. var t;
  13032. try {
  13033. t = this.decoder.decode(e)
  13034. } catch (e) {
  13035. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  13036. this.loadSweepLocationsCSV()
  13037. }
  13038. var i = t.sweepLocations.map(function(e) {
  13039. return {
  13040. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13041. position: {
  13042. x: e.pose.translation.x,
  13043. y: e.pose.translation.y,
  13044. z: e.pose.translation.z
  13045. },
  13046. quaternion: {
  13047. x: e.pose.rotation.x,
  13048. y: e.pose.rotation.y,
  13049. z: e.pose.rotation.z,
  13050. w: e.pose.rotation.w
  13051. },
  13052. puck: {
  13053. x: e.puck.x,
  13054. y: e.puck.y,
  13055. z: e.puck.z
  13056. },
  13057. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  13058. neighbours: e.visibles,
  13059. alignmentType: e.alignment_type
  13060. }
  13061. }).map(function(e) {
  13062. return e.position = s.convertVisionVector(e.position),
  13063. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13064. e.puck = s.convertVisionVector(e.puck),
  13065. e
  13066. });
  13067. return i.forEach(function(e) {
  13068. e.neighbours = e.neighbours.map(function(e) {
  13069. return i[e].uuid
  13070. })
  13071. }),
  13072. i
  13073. }
  13074. .bind(this), function() {
  13075. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13076. this.loadSweepLocationsCSV()
  13077. }
  13078. .bind(this))
  13079. }
  13080. ,
  13081. r.prototype.loadSweepLocationsCSV = function() {
  13082. return a.get(this.sweepLocationsPath).then(function(e) {
  13083. var t = e.split("\n").map(function(e) {
  13084. return e.split(", ")
  13085. }).filter(function(e) {
  13086. return e.length > 1
  13087. }).map(function(e) {
  13088. return {
  13089. uuid: e[0],
  13090. position: {
  13091. x: parseFloat(e[1]),
  13092. y: parseFloat(e[2]),
  13093. z: parseFloat(e[3])
  13094. },
  13095. quaternion: {
  13096. x: parseFloat(e[4]),
  13097. y: parseFloat(e[5]),
  13098. z: parseFloat(e[6]),
  13099. w: parseFloat(e[7])
  13100. }
  13101. }
  13102. }).map(function(e) {
  13103. return e.position = s.convertVisionVector(e.position),
  13104. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13105. e
  13106. });
  13107. return t
  13108. }).fail(function() {
  13109. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13110. })
  13111. }
  13112. ,
  13113. t.exports = r
  13114. }
  13115. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13116. }
  13117. , {
  13118. "../util/ajax": 181,
  13119. "../util/common": 185,
  13120. "../util/logger": 189,
  13121. "../util/math": 190,
  13122. buffer: 198,
  13123. protobufjs: 214
  13124. }],
  13125. 108: [function(e, t, i) {
  13126. (function(i) {
  13127. "use strict";
  13128. function n() {
  13129. this.locale = null
  13130. }
  13131. var r = e("../settings")
  13132. , o = e("../util/common")
  13133. , a = e("../util/logger")
  13134. , s = e("../enum/Locale")
  13135. , l = new a(i);
  13136. n.prototype.init = function() {
  13137. var t;
  13138. switch (r.languageTag) {
  13139. case null:
  13140. case "en":
  13141. case s.EN_US:
  13142. this.locale = s.EN_US,
  13143. t = e("./strings-en-US");
  13144. break;
  13145. case "es":
  13146. case s.ES_MX:
  13147. this.locale = s.ES_MX,
  13148. t = e("./strings-es-MX");
  13149. break;
  13150. case "fr":
  13151. case s.FR_FR:
  13152. this.locale = s.FR_FR,
  13153. t = e("./strings-fr-FR");
  13154. break;
  13155. case "de":
  13156. case s.DE_DE:
  13157. this.locale = s.DE_DE,
  13158. t = e("./strings-de-DE");
  13159. break;
  13160. case "ru":
  13161. case s.RU_RU:
  13162. this.locale = s.RU_RU,
  13163. t = e("./strings-ru-RU");
  13164. break;
  13165. case "cn":
  13166. case s.CN_CN:
  13167. this.locale = s.CN_CN,
  13168. t = e("./strings-cn-CN");
  13169. break;
  13170. case "jp":
  13171. case s.JP_JP:
  13172. this.locale = s.JP_JP,
  13173. t = e("./strings-jp-JP");
  13174. break;
  13175. default:
  13176. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13177. this.locale = s.EN_US,
  13178. t = e("./strings-en-US")
  13179. }
  13180. l.info("Using locale '" + this.locale + "'"),
  13181. o.extendObject(this, t)
  13182. }
  13183. ,
  13184. n.prototype.localizeGUI = function() {
  13185. var e = document.querySelector("#gui-parent");
  13186. this.localizeTree(e),
  13187. this.localizeLoadingText()
  13188. }
  13189. ,
  13190. n.prototype.localizeLoadingText = function() {
  13191. // var e = document.querySelector("#loader-cont")
  13192. // , t = e.getAttribute("title");
  13193. // e.removeAttribute("title"),
  13194. // e.setAttribute("data-status", t),
  13195. // e.classList.add(this.locale),
  13196. document.querySelector("#help-dialog").classList.add(this.locale),
  13197. document.querySelector("#interaction-modal").classList.add(this.locale),
  13198. document.querySelector("#gui").classList.add(this.locale);
  13199. }
  13200. ,
  13201. n.prototype.localizeTree = function(e) {
  13202. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13203. if (e.nodeType === Node.TEXT_NODE)
  13204. t = e.data.match(n),
  13205. t && (i = t[1],
  13206. e.data = this.localizeText(i) || i);
  13207. else if (e.nodeType === Node.ELEMENT_NODE) {
  13208. var r = e.getAttribute("title");
  13209. r && (t = r.match(n),
  13210. t && (i = t[1],
  13211. e.setAttribute("title", this.localizeText(i) || i)))
  13212. }
  13213. for (e = e.firstChild; e; )
  13214. this.localizeTree(e),
  13215. e = e.nextSibling
  13216. }
  13217. ,
  13218. n.prototype.localizeText = function(t) {
  13219. var i = this[t];
  13220. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13221. i = e("./strings-en-US")[t]),
  13222. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13223. i
  13224. }
  13225. ,
  13226. t.exports = new n
  13227. }
  13228. ).call(this, "/js/localization/localize.js")
  13229. }
  13230. , {
  13231. "../enum/Locale": 31,
  13232. "../settings": 166,
  13233. "../util/common": 185,
  13234. "../util/logger": 189,
  13235. "./strings-cn-CN": 109,
  13236. "./strings-de-DE": 110,
  13237. "./strings-en-US": 111,
  13238. "./strings-es-MX": 112,
  13239. "./strings-fr-FR": 113,
  13240. "./strings-jp-JP": 114,
  13241. "./strings-ru-RU": 115
  13242. }],
  13243. 109: [function(e, t, i) {
  13244. "use strict";
  13245. t.exports = {
  13246. PAGE_TITLE: "",
  13247. LOADING: "正在加载",
  13248. PRESENTED_BY_CAPS: "呈现者:",
  13249. POWERED_BY: "技术支持:",
  13250. POWERED_BY_CAPS: "技术支持:",
  13251. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13252. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13253. PRESENTED_BY: "呈现者:",
  13254. MORE: "更多 ",
  13255. LESS: "更少 ",
  13256. TAG_CONTENT: "tag™ 内容",
  13257. SHOW: "显示",
  13258. HIDE: "隐藏",
  13259. DOLLHOUSE: "场景屋",
  13260. FLOOR_PLAN: "楼层平面图",
  13261. OPEN_HIGHLIGHTS: "打开精彩片段",
  13262. CLOSE_HIGHLIGHTS: "关闭",
  13263. PREVIOUS: "上一个",
  13264. PLAY: "播放",
  13265. PAUSE: "暂停",
  13266. NEXT: "下一个",
  13267. EXPLORE_3D_SPACE: "探索 3D 空间",
  13268. VIEW_DOLLHOUSE: "观看场景屋",
  13269. SOCIAL_SHARING: "分享这个空间",
  13270. VIEW_IN_VR: "以 VR 观看",
  13271. VIEW_FULLSCREEN: "全屏观看",
  13272. EXIT_FULLSCREEN: " 退出全屏",
  13273. ZOOM_IN: "放大",
  13274. ZOOM_OUT: "缩小",
  13275. FLOOR_NAME: "楼层",
  13276. FLOOR_ALL: "ALL",
  13277. FLOOR_Lang: ["Floor",""],
  13278. TERMS: "条款",
  13279. PORT_TERMS: "port 条款",
  13280. TERMS_OF_USE: "使用条款",
  13281. CLOSE_TERMS: "关闭",
  13282. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13283. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13284. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13285. WEBVR_ENTER_WEBVR: "进入 VR",
  13286. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13287. WEBVR_LEARN_MORE: "了解更多",
  13288. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13289. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13290. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13291. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13292. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13293. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13294. VR_LEARN_MORE_CAPS: "了解更多",
  13295. VR_PREVIOUS_CAPS: "上一个’,",
  13296. VR_NEXT_CAPS: "下一个",
  13297. VR_GOT_IT_CAPS: "明白了",
  13298. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13299. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13300. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13301. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13302. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13303. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13304. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13305. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13306. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13307. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13308. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13309. VR_APP: "port VR 应用程序",
  13310. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13311. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13312. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13313. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13314. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13315. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13316. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13317. VR_ANDROID_DVICES: "Android 设备",
  13318. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13319. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13320. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13321. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13322. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13323. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13324. VR_DOWNLOAD_HERE: "在此下载",
  13325. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13326. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13327. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13328. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13329. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13330. SHARE_TO: "分享到",
  13331. SHARE_LINK: "直接链接",
  13332. SHARE_EXPLORE: "探索",
  13333. SHARE_AT: "在",
  13334. SHARE_WITH: "使用",
  13335. SHARE_3D: "以 3D",
  13336. SHARE_COPIED: "已复制!",
  13337. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13338. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13339. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13340. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13341. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13342. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13343. ERROR_GENERIC_ACTIONS_3: " 或",
  13344. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13345. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13346. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13347. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13348. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13349. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13350. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13351. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13352. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13353. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13354. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13355. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13356. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13357. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13358. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13359. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13360. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13361. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13362. LINK_TO_LOCATION: "地点链接",
  13363. MENU_COPY: "复制",
  13364. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13365. ROTATE: "旋转",
  13366. MOVE: "移动",
  13367. INSIDE: "内部",
  13368. ZOOM: "缩放",
  13369. HELP: "小帮手",
  13370. HELP_NAVIGATION_TAB: "导航",
  13371. HELP_MORE_HELP_TAB: "更多帮助",
  13372. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13373. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13374. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13375. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13376. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13377. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13378. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13379. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13380. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13381. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13382. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13383. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13384. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13385. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13386. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13387. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13388. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13389. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13390. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13391. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13392. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13393. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13394. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13395. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13396. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13397. HELP_MORE_HLR_A: "精彩片段集锦",
  13398. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13399. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13400. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13401. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13402. HELP_MORE_FLOORS_A: "楼层选择器",
  13403. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13404. HELP_MORE_TAG_A: "tag™ 贴文",
  13405. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13406. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13407. HELP_MORE_ZOOM_A: "缩放控件",
  13408. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13409. HELP_MORE_TOUR_A: "导览控件",
  13410. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13411. HELP_MORE_INSIDE_A: "内部视图",
  13412. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13413. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13414. HELP_MORE_VR_A: "VR 模式",
  13415. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13416. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13417. HELP_MORE_360_A: "360° 视图",
  13418. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13419. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13420. HELP_MORE_FULLSCREEN_A: "全屏",
  13421. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13422. CLOSE: "关闭"
  13423. }
  13424. }
  13425. , {}],
  13426. 110: [function(e, t, i) {
  13427. "use strict";
  13428. t.exports = {
  13429. PAGE_TITLE: "",
  13430. LOADING: "Lädt",
  13431. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13432. POWERED_BY: "Angetrieben von",
  13433. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13434. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13435. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13436. PRESENTED_BY: "Präsentiert von ",
  13437. MORE: "Mehr ",
  13438. LESS: "Weniger ",
  13439. TAG_CONTENT: "tag™ Inhalt",
  13440. SHOW: "Anzeigen",
  13441. HIDE: "Verbergen",
  13442. DOLLHOUSE: "Puppenhaus",
  13443. FLOOR_PLAN: "Grundriss",
  13444. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13445. CLOSE_HIGHLIGHTS: "Schließen",
  13446. PREVIOUS: "Vorheriges",
  13447. PLAY: "Abspielen",
  13448. PAUSE: "Pausieren",
  13449. NEXT: "Nächstes",
  13450. EXPLORE_3D_SPACE: "Innenraum betreten",
  13451. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13452. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13453. VIEW_IN_VR: "In VR ansehen",
  13454. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13455. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13456. ZOOM_IN: "Vergrößern",
  13457. ZOOM_OUT: "Verkleinern",
  13458. FLOOR_NAME: "Etage ",
  13459. FLOOR_ALL: "Alle",
  13460. TERMS: "Bedingungen",
  13461. PORT_TERMS: "port Bedingungen",
  13462. TERMS_OF_USE: "Nutzungsbedingungen",
  13463. TERMS_TEXT_FILE: "terms-de-DE.html",
  13464. CLOSE_TERMS: "Schließen",
  13465. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13466. HELP: "Hilfe",
  13467. HELP_NAVIGATION_TAB: "Navigation",
  13468. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13469. CLOSE: "Schließen",
  13470. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13471. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13472. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13473. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13474. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13475. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13476. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13477. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13478. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13479. 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.",
  13480. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13481. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13482. 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.",
  13483. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13484. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13485. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13486. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13487. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13488. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13489. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13490. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13491. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13492. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13493. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13494. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13495. HELP_MORE_HLR_A: "Liste das Highlight",
  13496. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13497. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13498. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13499. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13500. HELP_MORE_FLOORS_A: "Etage auswählen",
  13501. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13502. HELP_MORE_TAG_A: "tag™ Posts",
  13503. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13504. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13505. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13506. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13507. HELP_MORE_TOUR_A: "Tour Steuerung",
  13508. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13509. HELP_MORE_INSIDE_A: "Innenansicht",
  13510. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13511. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13512. HELP_MORE_VR_A: "VR Modus",
  13513. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13514. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13515. HELP_MORE_360_A: "360° Views Ansicht ",
  13516. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13517. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13518. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13519. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13520. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13521. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13522. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13523. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13524. WEBVR_LEARN_MORE: "Mehr Infos",
  13525. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13526. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13527. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13528. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13529. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13530. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13531. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13532. VR_APP: "port VR App",
  13533. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13534. 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",
  13535. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13536. VR_APP_FOR_ANDROID: "port VR app für Android",
  13537. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13538. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13539. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13540. VR_PREVIOUS_CAPS: "ZURÜCK",
  13541. VR_NEXT_CAPS: "WEITER",
  13542. VR_GOT_IT_CAPS: "VERSTANDEN",
  13543. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13544. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13545. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13546. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13547. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13548. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13549. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13550. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13551. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13552. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13553. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13554. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13555. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13556. VR_ANDROID_DVICES: "Android Geräte",
  13557. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13558. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13559. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13560. VR_DOWNLOAD_HERE: "Hier runterladen",
  13561. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13562. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13563. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13564. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13565. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13566. SHARE_TO: "Teilen auf",
  13567. SHARE_LINK: "Direkter Link",
  13568. SHARE_EXPLORE: "Umsehen",
  13569. SHARE_AT: "auf",
  13570. SHARE_WITH: "mit",
  13571. SHARE_3D: "in 3D",
  13572. SHARE_COPIED: "Kopiert!",
  13573. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13574. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13575. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13576. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13577. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13578. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13579. ERROR_GENERIC_ACTIONS_3: " oder ",
  13580. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13581. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13582. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13583. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13584. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13585. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13586. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13587. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13588. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13589. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13590. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13591. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13592. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13593. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13594. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13595. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13596. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13597. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13598. LINK_TO_LOCATION: "Link zu",
  13599. MENU_COPY: "Kopieren",
  13600. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13601. ROTATE: "Drehen",
  13602. INSIDE: "Drinnen",
  13603. MOVE: "Bewegen",
  13604. ZOOM: "Vergrößern"
  13605. }
  13606. }
  13607. , {}],
  13608. 111: [function(e, t, i) {
  13609. "use strict";
  13610. t.exports = {
  13611. PAGE_TITLE: "",
  13612. LOADING: "Loading",
  13613. PRESENTED_BY_CAPS: "PRESENTED BY",
  13614. POWERED_BY: "powered by ",
  13615. POWERED_BY_CAPS: "POWERED BY",
  13616. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13617. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13618. PRESENTED_BY: "Presented by ",
  13619. MORE: "More ",
  13620. LESS: "Less ",
  13621. TAG_CONTENT: "tag™ Content",
  13622. SHOW: "Show",
  13623. HIDE: "Hide",
  13624. DOLLHOUSE: "Dollhouse",
  13625. FLOOR_PLAN: "Floor plan",
  13626. OPEN_HIGHLIGHTS: "Open Highlights",
  13627. CLOSE_HIGHLIGHTS: "Close",
  13628. PREVIOUS: "Previous",
  13629. PLAY: "Play",
  13630. PAUSE: "Pause",
  13631. NEXT: "Next",
  13632. EXPLORE_3D_SPACE: "Explore 3D Space",
  13633. VIEW_DOLLHOUSE: "View dollhouse",
  13634. SOCIAL_SHARING: "Share this Space",
  13635. VIEW_IN_VR: "View in VR",
  13636. VIEW_FULLSCREEN: "全屏",
  13637. EXIT_FULLSCREEN: "退出全屏",
  13638. ZOOM_IN: "Zoom in",
  13639. ZOOM_OUT: "Zoom out",
  13640. FLOOR_NAME: "Floor ",
  13641. FLOOR_ALL: "全部",
  13642. TERMS: "Terms",
  13643. PORT_TERMS: "port terms",
  13644. TERMS_OF_USE: "Terms of Use",
  13645. TERMS_TEXT_FILE: "terms-en-US.html",
  13646. CLOSE_TERMS: "Close",
  13647. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13648. HELP: "Help",
  13649. HELP_NAVIGATION_TAB: "Navigation",
  13650. HELP_MORE_HELP_TAB: "More Help",
  13651. CLOSE: "Close",
  13652. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13653. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13654. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13655. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13656. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13657. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13658. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13659. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13660. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13661. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13662. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13663. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13664. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13665. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13666. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13667. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13668. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13669. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13670. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13671. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13672. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13673. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13674. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13675. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13676. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13677. HELP_MORE_HLR_A: "Highlight Reel",
  13678. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13679. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13680. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13681. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13682. HELP_MORE_FLOORS_A: "Floor Selector",
  13683. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13684. HELP_MORE_TAG_A: "tag™ Posts",
  13685. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13686. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13687. HELP_MORE_ZOOM_A: "Zoom Controls",
  13688. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13689. HELP_MORE_TOUR_A: "Tour Controls",
  13690. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13691. HELP_MORE_INSIDE_A: "Inside View",
  13692. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13693. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13694. HELP_MORE_VR_A: "VR Mode",
  13695. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13696. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13697. HELP_MORE_360_A: "360° Views",
  13698. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13699. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13700. HELP_MORE_FULLSCREEN_A: "Full screen",
  13701. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13702. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13703. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13704. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13705. WEBVR_ENTER_WEBVR: "ENTER VR",
  13706. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13707. WEBVR_LEARN_MORE: "Learn more",
  13708. WEBVR_VIEW_SPACE: "View Space in VR",
  13709. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13710. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13711. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13712. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13713. VR_PREVIOUS_CAPS: "PREVIOUS",
  13714. VR_NEXT_CAPS: "NEXT",
  13715. VR_GOT_IT_CAPS: "GOT IT",
  13716. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13717. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13718. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13719. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13720. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13721. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13722. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13723. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13724. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13725. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13726. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13727. VR_APP: "port VR App",
  13728. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13729. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13730. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13731. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13732. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13733. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13734. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13735. VR_ANDROID_DVICES: "Android Devices",
  13736. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13737. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13738. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13739. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13740. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13741. VR_APP_OPEN: "Open with the port VR app instead",
  13742. VR_DOWNLOAD_HERE: "Download here",
  13743. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13744. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13745. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13746. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13747. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13748. SHARE_TO: "Share to",
  13749. SHARE_LINK: "Direct Link",
  13750. SHARE_EXPLORE: "Explore ",
  13751. SHARE_AT: "at",
  13752. SHARE_WITH: "with",
  13753. SHARE_3D: " in 3D",
  13754. SHARE_COPIED: "Copied!",
  13755. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13756. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13757. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13758. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13759. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13760. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13761. ERROR_GENERIC_ACTIONS_3: " or ",
  13762. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13763. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13764. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13765. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13766. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13767. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13768. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13769. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13770. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13771. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13773. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13774. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13775. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13776. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13777. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13778. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13779. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13780. LINK_TO_LOCATION: "Link to location",
  13781. MENU_COPY: "Copy",
  13782. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13783. ROTATE: "Rotate",
  13784. INSIDE: "Inside",
  13785. MOVE: "Move",
  13786. ZOOM: "Zoom"
  13787. }
  13788. }
  13789. , {}],
  13790. 112: [function(e, t, i) {
  13791. "use strict";
  13792. t.exports = {
  13793. PAGE_TITLE: "",
  13794. LOADING: "Cargando",
  13795. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13796. POWERED_BY: "potenciando por ",
  13797. POWERED_BY_CAPS: "POTENCIADO POR ",
  13798. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13799. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13800. PRESENTED_BY: "Presentado por ",
  13801. MORE: "Más ",
  13802. LESS: "Menos ",
  13803. TAG_CONTENT: "Contenido de tag™",
  13804. SHOW: "Mostrar",
  13805. HIDE: "Ocultar",
  13806. DOLLHOUSE: "Dollhouse",
  13807. FLOOR_PLAN: "Planos",
  13808. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13809. CLOSE_HIGHLIGHTS: "Cerrar",
  13810. PREVIOUS: "Anterior",
  13811. PLAY: "Play",
  13812. PAUSE: "Pausa",
  13813. NEXT: "Siguiente",
  13814. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13815. VIEW_DOLLHOUSE: "Ver dollhouse",
  13816. SOCIAL_SHARING: "Compartir este espacio",
  13817. VIEW_IN_VR: "Ver en realidad virtual",
  13818. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13819. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13820. ZOOM_IN: "Acercar",
  13821. ZOOM_OUT: "Alejar",
  13822. FLOOR_NAME: "Piso ",
  13823. FLOOR_ALL: "Todas",
  13824. TERMS: "Condiciones",
  13825. PORT_TERMS: "port términos de uso",
  13826. TERMS_OF_USE: "Términos de uso",
  13827. TERMS_TEXT_FILE: "terms-es-MX.html",
  13828. CLOSE_TERMS: "Cerrar",
  13829. 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.",
  13830. HELP: "Ayuda",
  13831. HELP_NAVIGATION_TAB: "Navegación",
  13832. HELP_MORE_HELP_TAB: "Más Ayuda",
  13833. CLOSE: "Cerrar",
  13834. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13835. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13836. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13837. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13838. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13839. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13840. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13841. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13842. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13843. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13844. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13845. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13846. 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.",
  13847. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13848. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13849. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13850. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13851. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13852. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13853. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13854. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13855. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13856. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13857. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13858. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13859. HELP_MORE_HLR_A: "Galería destacada",
  13860. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13861. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13862. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13863. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13864. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13865. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13866. HELP_MORE_TAG_A: "tag™ Posts",
  13867. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13868. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13869. HELP_MORE_ZOOM_A: "Controles de zoom",
  13870. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13871. HELP_MORE_TOUR_A: "Controles de recorrido",
  13872. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13873. HELP_MORE_INSIDE_A: "Vista interior",
  13874. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13875. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13876. HELP_MORE_VR_A: "Modo de realidad virtual",
  13877. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13878. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13879. HELP_MORE_360_A: "360° Views",
  13880. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13881. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13882. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13883. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13884. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13885. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13886. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13887. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13888. WEBVR_LEARN_MORE: "Más información",
  13889. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13890. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13891. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13892. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13893. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13894. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13895. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13896. VR_APP: "port VR App",
  13897. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13898. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13899. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13900. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13901. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13902. VR_PREVIOUS_CAPS: "ANTERIOR",
  13903. VR_NEXT_CAPS: "SIGUIENTE",
  13904. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13905. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13906. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13907. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13908. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13909. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13910. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13911. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13912. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13913. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13914. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13915. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13916. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13917. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13918. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13919. VR_ANDROID_DVICES: "Dispositivos Android",
  13920. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13921. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13922. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13923. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13924. VR_DOWNLOAD_HERE: "Descargar aquí",
  13925. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13926. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13927. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13928. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13929. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13930. SHARE_TO: "Compartir en",
  13931. SHARE_LINK: "Enlace directo",
  13932. SHARE_EXPLORE: "Explorar ",
  13933. SHARE_AT: "en",
  13934. SHARE_WITH: "con",
  13935. SHARE_3D: " en 3D",
  13936. SHARE_COPIED: "¡Copiado!",
  13937. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13938. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13939. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13940. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13941. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13942. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13943. ERROR_GENERIC_ACTIONS_3: " o ",
  13944. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13945. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13946. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13947. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13948. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13949. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13950. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13951. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13952. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13953. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13954. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13955. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13956. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13957. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13958. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13959. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13960. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13961. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13962. LINK_TO_LOCATION: "Enlace a la ubicación",
  13963. MENU_COPY: "Copiar",
  13964. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13965. ROTATE: "Girar",
  13966. INSIDE: "Interior",
  13967. MOVE: "Moverse",
  13968. ZOOM: "Acercar o alejar"
  13969. }
  13970. }
  13971. , {}],
  13972. 113: [function(e, t, i) {
  13973. "use strict";
  13974. t.exports = {
  13975. PAGE_TITLE: "",
  13976. LOADING: "Chargement",
  13977. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13978. POWERED_BY: "alimenté par ",
  13979. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13980. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13981. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13982. PRESENTED_BY: "Présenté par ",
  13983. MORE: "Plus ",
  13984. LESS: "Moins ",
  13985. TAG_CONTENT: "Contenu tag™",
  13986. SHOW: "Montrer",
  13987. HIDE: "Cacher",
  13988. DOLLHOUSE: "Dollhouse",
  13989. FLOOR_PLAN: "Plan de sol",
  13990. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13991. CLOSE_HIGHLIGHTS: "Fermer",
  13992. PREVIOUS: "Précédent",
  13993. PLAY: "Lecture",
  13994. PAUSE: "Pause",
  13995. NEXT: "Suivant",
  13996. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13997. VIEW_DOLLHOUSE: "Voir dollhouse",
  13998. SOCIAL_SHARING: "Partager cet espace",
  13999. VIEW_IN_VR: "Voir en VR",
  14000. VIEW_FULLSCREEN: "Plein écran",
  14001. EXIT_FULLSCREEN: "Fermer plein écran",
  14002. ZOOM_IN: "Zoom avant",
  14003. ZOOM_OUT: "Zoom arrière",
  14004. FLOOR_NAME: "Étage ",
  14005. FLOOR_ALL: "Tous",
  14006. TERMS: "Mentions légales",
  14007. PORT_TERMS: "port mentions légales",
  14008. TERMS_OF_USE: "Conditions d'utilisation",
  14009. TERMS_TEXT_FILE: "terms-fr-FR.html",
  14010. CLOSE_TERMS: "Fermer",
  14011. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  14012. HELP: "Aide",
  14013. HELP_NAVIGATION_TAB: "Navigation",
  14014. HELP_MORE_HELP_TAB: "Aide",
  14015. CLOSE: "Fermer",
  14016. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  14017. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  14018. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  14019. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  14020. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  14021. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  14022. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14023. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  14024. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  14025. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  14026. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  14027. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  14028. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  14029. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  14030. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  14031. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  14032. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  14033. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  14034. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  14035. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  14036. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14037. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  14038. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  14039. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14040. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14041. HELP_MORE_HLR_A: "Carrousel",
  14042. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14043. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14044. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14045. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14046. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14047. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14048. HELP_MORE_TAG_A: "tag™ Posts",
  14049. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14050. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14051. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14052. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14053. HELP_MORE_TOUR_A: "Commandes de la visite",
  14054. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14055. HELP_MORE_INSIDE_A: "Vue intérieure",
  14056. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14057. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14058. HELP_MORE_VR_A: "Mode RV",
  14059. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14060. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14061. HELP_MORE_360_A: "Vues 360°",
  14062. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14063. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14064. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14065. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14066. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14067. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14068. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14069. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14070. WEBVR_LEARN_MORE: "En savoir plus",
  14071. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14072. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14073. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14074. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14075. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14076. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14077. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14078. VR_NEXT_CAPS: "SUIVANT",
  14079. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14080. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14081. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14082. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14083. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14084. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14085. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14086. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14087. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14088. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14089. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14090. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14091. VR_APP: "port VR App",
  14092. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14093. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14094. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14095. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14096. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14097. 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",
  14098. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14099. VR_ANDROID_DVICES: "Appareils Android",
  14100. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14101. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14102. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14103. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14104. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14105. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14106. VR_DOWNLOAD_HERE: "Télécharger ici",
  14107. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14108. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14109. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14110. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14111. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14112. SHARE_TO: "Partager sur",
  14113. SHARE_LINK: "Lien direct",
  14114. SHARE_EXPLORE: "Explorer ",
  14115. SHARE_AT: "à",
  14116. SHARE_WITH: "avec",
  14117. SHARE_3D: " en 3D",
  14118. SHARE_COPIED: "Copié!",
  14119. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14120. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14121. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14122. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14123. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14124. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14125. ERROR_GENERIC_ACTIONS_3: " ou ",
  14126. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14127. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14128. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14129. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14130. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14131. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14132. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14133. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14134. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14135. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14136. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14137. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14138. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14139. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14140. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14141. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14142. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14143. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14144. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14145. MENU_COPY: "Copie",
  14146. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14147. ROTATE: "Faire pivoter",
  14148. INSIDE: "Intérieure",
  14149. MOVE: "Se déplacer",
  14150. ZOOM: "Zoom"
  14151. }
  14152. }
  14153. , {}],
  14154. 114: [function(e, t, i) {
  14155. "use strict";
  14156. t.exports = {
  14157. PAGE_TITLE: "",
  14158. LOADING: "読み込み中",
  14159. PRESENTED_BY_CAPS: "PRESENTED BY",
  14160. POWERED_BY: "powered by",
  14161. POWERED_BY_CAPS: "POWERED BY",
  14162. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14163. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14164. PRESENTED_BY: "Presented by ",
  14165. MORE: "全て表示 ",
  14166. LESS: "閉じる ",
  14167. TAG_CONTENT: "tag™コンテンツ ",
  14168. SHOW: "表示",
  14169. HIDE: "非表示",
  14170. DOLLHOUSE: "ドールハウス",
  14171. FLOOR_PLAN: "フロアプラン",
  14172. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14173. CLOSE_HIGHLIGHTS: "閉じる",
  14174. PREVIOUS: "前へ",
  14175. PLAY: "再生",
  14176. PAUSE: "一時停止",
  14177. NEXT: "次へ",
  14178. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14179. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14180. SOCIAL_SHARING: "このSpaceを共有する",
  14181. VIEW_IN_VR: "VRで表示",
  14182. VIEW_FULLSCREEN: "フルスクリーン表示",
  14183. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14184. ZOOM_IN: "ズームイン",
  14185. ZOOM_OUT: "ズームアウト",
  14186. FLOOR_NAME: "フロア ",
  14187. FLOOR_ALL: "すべて",
  14188. TERMS: "規約",
  14189. PORT_TERMS: "port規約",
  14190. TERMS_OF_USE: "利用規約",
  14191. CLOSE_TERMS: "閉じる",
  14192. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14193. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14194. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14195. WEBVR_ENTER_WEBVR: "VRに入る",
  14196. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14197. WEBVR_LEARN_MORE: "もっと詳しく",
  14198. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14199. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14200. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14201. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14202. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14203. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14204. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14205. VR_PREVIOUS_CAPS: "前へ",
  14206. VR_NEXT_CAPS: "次へ",
  14207. VR_GOT_IT_CAPS: "了解",
  14208. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14209. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14210. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14211. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14212. VR_WHAT_YOU_NEED: "必要なもの",
  14213. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14214. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14215. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14216. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14217. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14218. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14219. VR_APP: "port VRアプリ",
  14220. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14221. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14222. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14223. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14224. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14225. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14226. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14227. VR_ANDROID_DVICES: "Androidデバイス",
  14228. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14229. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14230. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14231. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14232. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14233. VR_APP_OPEN: "port VRアプリで開く",
  14234. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14235. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14236. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14237. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14238. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14239. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14240. SHARE_TO: "共有先",
  14241. SHARE_LINK: "ダイレクトリンク",
  14242. SHARE_EXPLORE: "探索",
  14243. SHARE_AT: "場所",
  14244. SHARE_WITH: "使用アプリ",
  14245. SHARE_3D: "3Dで",
  14246. SHARE_COPIED: "コピーされました!",
  14247. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14248. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14249. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14250. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14251. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14252. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14253. ERROR_GENERIC_ACTIONS_3: "または",
  14254. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14255. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14256. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14257. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14258. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14259. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14260. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14261. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14262. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14263. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14264. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14265. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14266. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14267. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14268. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14269. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14270. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14271. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14272. LINK_TO_LOCATION: "ロケーションへのリンク",
  14273. MENU_COPY: "コピー",
  14274. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14275. ROTATE: "回転",
  14276. MOVE: "移動",
  14277. INSIDE: "内側",
  14278. ZOOM: "ズーム",
  14279. HELP: "ヘルプ",
  14280. HELP_NAVIGATION_TAB: "ナビゲーション",
  14281. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14282. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14283. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14284. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14285. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14286. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14287. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14288. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14289. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14290. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14291. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14292. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14293. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14294. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14295. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14296. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14297. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14298. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14299. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14300. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14301. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14302. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14303. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14304. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14305. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14306. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14307. HELP_MORE_HLR_A: "ハイライト",
  14308. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14309. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14310. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14311. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14312. HELP_MORE_FLOORS_A: "フロアセレクター",
  14313. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14314. HELP_MORE_TAG_A: "tag™ Posts",
  14315. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14316. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14317. HELP_MORE_ZOOM_A: "ズームコントロール",
  14318. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14319. HELP_MORE_TOUR_A: "ツアーコントロール",
  14320. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14321. HELP_MORE_INSIDE_A: "内側ビュー",
  14322. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14323. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14324. HELP_MORE_VR_A: "VRモード",
  14325. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14326. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14327. HELP_MORE_360_A: "360° Views",
  14328. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14329. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14330. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14331. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14332. CLOSE: "閉じる"
  14333. }
  14334. }
  14335. , {}],
  14336. 115: [function(e, t, i) {
  14337. "use strict";
  14338. t.exports = {
  14339. PAGE_TITLE: "",
  14340. LOADING: "Загрузка",
  14341. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14342. POWERED_BY: "разработано на платформе ",
  14343. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14344. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14345. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14346. PRESENTED_BY: "Представлено ",
  14347. MORE: "Больше ",
  14348. LESS: "Меньше ",
  14349. TAG_CONTENT: "tag™ Контент",
  14350. SHOW: "Показать",
  14351. HIDE: "Скрыть",
  14352. DOLLHOUSE: "Dollhouse",
  14353. FLOOR_PLAN: "Планировка",
  14354. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14355. CLOSE_HIGHLIGHTS: "Закрыть",
  14356. PREVIOUS: "Предыдущий",
  14357. PLAY: "Воспроизвести",
  14358. PAUSE: "Пауза",
  14359. NEXT: "Следующий",
  14360. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14361. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14362. SOCIAL_SHARING: "Поделиться этой моделью",
  14363. VIEW_IN_VR: "Посмотреть в VR",
  14364. VIEW_FULLSCREEN: "Полный экран",
  14365. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14366. ZOOM_IN: "Увеличить",
  14367. ZOOM_OUT: "Уменьшить",
  14368. FLOOR_NAME: "Этаж ",
  14369. FLOOR_ALL: "Все",
  14370. TERMS: "Условия",
  14371. PORT_TERMS: "Правила пользования",
  14372. TERMS_OF_USE: "Условия использования",
  14373. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14374. CLOSE_TERMS: "Закрыть",
  14375. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14376. HELP: "Помощь",
  14377. HELP_NAVIGATION_TAB: "Навигация",
  14378. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14379. CLOSE: "Закрыть",
  14380. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14381. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14382. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14383. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14384. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14385. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14386. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14387. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14388. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14389. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14390. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14391. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14392. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14393. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14394. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14395. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14396. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14397. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14398. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14399. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14400. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14401. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14402. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14403. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14404. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14405. HELP_MORE_HLR_A: "Фотоколлаж",
  14406. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14407. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14408. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14409. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14410. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14411. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14412. HELP_MORE_TAG_A: "tag™ Posts",
  14413. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14414. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14415. HELP_MORE_ZOOM_A: "Масштаб",
  14416. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14417. HELP_MORE_TOUR_A: "Управление Туром",
  14418. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14419. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14420. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14421. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14422. HELP_MORE_VR_A: "Режим VR",
  14423. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14424. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14425. HELP_MORE_360_A: "360° Views",
  14426. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14427. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14428. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14429. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14430. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14431. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14432. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14433. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14434. WEBVR_LEARN_MORE: "Узнать больше",
  14435. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14436. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14437. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14438. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14439. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14440. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14441. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14442. VR_APP: "port VR App",
  14443. VR_APP_OPEN: "Или открыть через приложение port VR",
  14444. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14445. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14446. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14447. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14448. VR_VIEW_SPACE: "Запустить модель в VR",
  14449. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14450. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14451. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14452. VR_GOT_IT_CAPS: "ЯСНО",
  14453. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14454. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14455. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14456. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14457. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14458. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14459. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14460. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14461. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14462. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14463. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14464. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14465. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14466. VR_ANDROID_DVICES: "Android устройства",
  14467. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14468. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14469. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14470. VR_DOWNLOAD_HERE: "Скачать здесь",
  14471. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14472. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14473. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14474. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14475. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14476. SHARE_TO: "Поделиться",
  14477. SHARE_LINK: "Прямая ссылка",
  14478. SHARE_EXPLORE: "просмотреть",
  14479. SHARE_AT: "на",
  14480. SHARE_WITH: "с",
  14481. SHARE_3D: "в 3D",
  14482. SHARE_COPIED: "Скопировано!",
  14483. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14484. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14485. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14486. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14487. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14488. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14489. ERROR_GENERIC_ACTIONS_3: " или ",
  14490. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14491. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14492. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14493. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14494. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14495. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14496. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14497. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14498. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14499. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14500. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14501. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14502. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14503. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14504. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14505. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14506. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14507. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14508. LINK_TO_LOCATION: "Ссылка на местоположение",
  14509. MENU_COPY: "Копировать",
  14510. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14511. ROTATE: "Вращать",
  14512. MOVE: "Передвигаться",
  14513. INSIDE: "Вид изнутри",
  14514. ZOOM: "Масштаб"
  14515. }
  14516. }
  14517. , {}],
  14518. 116: [function(e, t, i) {//main.js
  14519. (function(t) {
  14520. "use strict";
  14521. var modelProgressBase = 0.4;
  14522. var progressUpdate = function(e){ // 0 <= e <= 1
  14523. console.log('e1:'+e)
  14524. e = Math.round(modelProgressBase * e * 100);
  14525. console.log('e2:'+e)
  14526. var t = $('.progressbar');
  14527. t.find('.bar').css('width',e+'%');
  14528. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14529. t.find('.perc').text(e +'%'); //具体数字的百分比
  14530. }
  14531. $('#gui-loading').fadeIn(200);
  14532. progressUpdate(0.1)
  14533. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14534. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14535. var data = matcher(e);
  14536. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14537. data.user = {
  14538. "is_authenticated": false,
  14539. "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"]
  14540. }
  14541. try{//处理一下导览数据
  14542. data.model.images = data.model.images.filter(e=>{
  14543. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14544. if(e.locations)e.locations = e.locations.filter(e=>e)
  14545. if(e.locations && e.locations.length == 0)return;
  14546. return e
  14547. })
  14548. }catch(e){console.log(e) }
  14549. window.DATA = data;
  14550. data.model.summary = data.summary
  14551. data.model.name = data.name
  14552. for(let i in data){
  14553. data[i] == "false" && (data[i] = false)
  14554. }
  14555. progressUpdate(0.7);
  14556. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14557. if(data.weixinDesc){
  14558. g_weixinObj.desc = data.weixinDesc;
  14559. }
  14560. if(data.shareImgUrl){
  14561. g_weixinObj.imgUrl = data.shareImgUrl
  14562. }
  14563. window.wx && manage.weixinShare();
  14564. //初始画面
  14565. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14566. function E(e) {
  14567. $("<img/>").attr("src", e).on("load", function() {
  14568. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14569. $(this).remove()
  14570. })
  14571. }
  14572. //背景
  14573. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14574. settings.bgImg = settings.bgImg || data.bgImg || null
  14575. if(settings.bgImg){
  14576. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14577. "background-position": "center center"
  14578. })
  14579. }
  14580. {//初始化导览时间
  14581. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14582. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14583. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14584. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14585. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14586. }
  14587. settings.playTourNearBy = !DATA.tourFromStart
  14588. }
  14589. {//其他
  14590. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14591. _settings.angleShift2d = DATA.angleShift2d || 0
  14592. if(DATA.insideLookLimit){
  14593. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14594. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14595. }
  14596. }
  14597. }).fail(e=>{
  14598. alert("缺少someData文件,请检查场景码是否正确。")
  14599. })
  14600. function StartLoad(){//当加载完data后
  14601. function i() {
  14602. var e = window.number//Y.getModelIDFromQueryString();
  14603. if (!e)
  14604. return b(null, "loading-failed");
  14605. var t = Y.parseSidUrl(e)
  14606. , i = l()
  14607. , a = c()
  14608. , s = o()
  14609. , u = V.quickstart.enabled
  14610. , g = null
  14611. , m = null
  14612. , v = null
  14613. , w = null
  14614. , T = null
  14615. , x = null
  14616. , S = null
  14617. , M = null
  14618. , R = null
  14619. , P = null
  14620. , O = null
  14621. , L = null
  14622. , N = new ue;
  14623. r(s);
  14624. h({ //MP开头写法
  14625. urlBase: t.urlBase
  14626. }).then(function() {
  14627. return re.init(),
  14628. d(t, e) //getModel and load
  14629. }).then(function(e) {
  14630. progressUpdate(0.9)
  14631. return P = e,
  14632. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14633. startSource: i,
  14634. autoplay: V.autoplay,
  14635. quickstart: u
  14636. }),
  14637. P.urls.init()
  14638. }).then(function() {
  14639. return P.loadPanos()
  14640. }).then(function() {
  14641. m = X.getStartCameraOptions(P, P.panos),
  14642. S = A(P),
  14643. O = y(u, m.mode),
  14644. v = O.controls,
  14645. w = O.player,
  14646. T = O.director,
  14647. x = O.tagManager,
  14648. M = O.tileDownloader,
  14649. R = O.qualityManager,
  14650. L = O.panoRenderer,
  14651. C(P, S, O, s),
  14652. w.director = T,//xzw add
  14653. P.supportsTiles && M.start(),
  14654. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14655. u = !1);
  14656. var e = null;
  14657. if (u) {
  14658. de.warn("Quickstart engaged. Hold on to your knickers.");
  14659. var t = v.controls[D.PANORAMA];
  14660. g = new ie(R,S.scene,S.camera,t,s),
  14661. _(S, s, P),
  14662. e = g.load(m).then(function() {
  14663. S.addComponent(g),
  14664. S.once(le.AfterRender, function() {
  14665. de.warn("First render after quickstart load finished.")
  14666. })
  14667. })
  14668. }
  14669. window.flyToFirst = function(){//xzw add
  14670. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14671. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14672. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14673. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14674. };
  14675. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14676. }).then(function() {
  14677. return f(P, U.onProgress, i, !u, a)
  14678. }).then(function() {
  14679. if (m.quickstart = u,
  14680. I(P, S, O, s),
  14681. S.started || _(S, s, P),
  14682. H.modelLoaded(P, w, v, V.autoplay),
  14683. E(w, P, m, V.autoplay).done(function() {
  14684. T.autoTour()
  14685. }),
  14686. !P.supportsTiles) {
  14687. var e = new Z(P,w);
  14688. e.start()
  14689. }
  14690. u && (S.removeComponent(g),
  14691. g.destroy(),
  14692. m.pano.enter()),
  14693. U.init(P, T, w, v, S, m, H.getSessionId()),
  14694. U.endLoading(P, T, x),
  14695. S.once(le.AfterRender, function() {
  14696. N.setAppReadyTime();
  14697. var e = N.calcFullLoadingTime();
  14698. de.warn("Total load time: " + e / 1e3),
  14699. H.loadComplete(e),
  14700. $('.jumpvideo').fadeIn()
  14701. de.warn("First render after model load finished.")
  14702. }),
  14703. S.on(le.MemoryUsageUpdated, n)
  14704. }).fail(b.bind(this, e))
  14705. }
  14706. function n(e) {
  14707. ce.update(e)
  14708. }
  14709. function r(e) {
  14710. de.info("Version", "2.25.6-0-gd87e5b1"),
  14711. q.defaultMaxListeners = 1e3,
  14712. a(e),
  14713. s()
  14714. }
  14715. function o() {
  14716. return document.getElementById("player")
  14717. }
  14718. function a(e) {
  14719. e.addEventListener("dragenter", T, !1),
  14720. e.addEventListener("dragover", T, !1)
  14721. }
  14722. function s() {
  14723. F.valueFromHash("title", !0) || $(document).ready(function() {
  14724. var e = $(".model-title");
  14725. e.hide()
  14726. })
  14727. }
  14728. function l() {
  14729. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14730. }
  14731. function c() {
  14732. return {
  14733. panoElementsToLoad: 6,
  14734. modelElementsToLoad: 0,
  14735. totalElementsLoaded: 0,
  14736. totalElementsToLoad: 0,
  14737. totalPercentageLoaded: 0,
  14738. progressCallback: null
  14739. }
  14740. }
  14741. function h(e) {
  14742. return K.loadFeatureFlags(e).done(function(e) {
  14743. K.updateDependentSettings(e, V)
  14744. })
  14745. }
  14746. // function u(e) {
  14747. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14748. // responseType: "json",
  14749. // prefetchFrom: "config"
  14750. // }).then(function(e) {
  14751. // return e ? void j.extendObject(V.appConfig, e) : {}
  14752. // }, function(e) {
  14753. // return de.warn("Failed loading runtime config, using defaults."),
  14754. // $.when({})
  14755. // })
  14756. // }
  14757. function d(e, t) {
  14758. var i = B.getModel({
  14759. url: t,
  14760. floors: F.valueFromHash("f", !0),
  14761. autoload: !1
  14762. })
  14763. ;
  14764. return $.when(i, n).then(null, function(e) {
  14765. return this
  14766. })
  14767. }
  14768. function p(e, t, i, n, r) {
  14769. de.info("Model data loaded"),
  14770. de.debug("UUID: " + e.data.job.uuid),
  14771. J.init(K.getFlags()),
  14772. i && H.initKeen({
  14773. token: i,
  14774. appId: n
  14775. }),
  14776. H.initSegment({
  14777. model: e.sid,
  14778. version: "2.25.6-0-gd87e5b1",
  14779. startSource: r.startSource,
  14780. token: t,
  14781. autoplay: r.autoplay,
  14782. quickstart: r.quickstart
  14783. })
  14784. }
  14785. function f(e, t, i, n, r) {
  14786. return r.progressCallback = t,
  14787. H.sessionStart(),
  14788. e.load(n).progress(g.bind(this, r))
  14789. }
  14790. function g(e, t) {
  14791. e.modelElementsToLoad = t[1],
  14792. v(e),
  14793. m(e)
  14794. }
  14795. function m(e) {
  14796. e.totalElementsLoaded++,
  14797. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14798. //----许钟文-----------------模型进度条向后调整
  14799. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14800. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14801. //console.log('pro:'+e.totalPercentageLoaded)
  14802. //---------------------------
  14803. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14804. }
  14805. function v(e) {
  14806. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14807. }
  14808. function A(e) {
  14809. var t = new x.PerspectiveCamera;
  14810. t.layers.enable(he.PANOMARKERS),
  14811. t.layers.enable(he.RETICULE),
  14812. t.layers.enable(he.TAG);
  14813. var i = new x.Scene
  14814. , n = new x.AmbientLight(16777215);
  14815. i.add(n),
  14816. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14817. side: x.DoubleSide
  14818. })),
  14819. i.plane.position.y = 0,
  14820. i.plane.rotateX(-Math.PI / 2),
  14821. i.plane.material.visible = !1,
  14822. i.add(i.plane),
  14823. i.updateMatrixWorld(),
  14824. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14825. if (e.metadata && e.metadata.camera_position) {
  14826. var t = e.metadata.camera_position
  14827. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14828. n.position = t.clone(),
  14829. i.add(n);
  14830. var r = e.metadata.camera_quaternion
  14831. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14832. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14833. }
  14834. }),
  14835. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14836. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14837. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14838. //背景
  14839. if(!settings.transparentBg && !settings.bgImg){
  14840. i.skybox = new W
  14841. i.add(i.skybox)
  14842. }
  14843. var r = new te(i,t,z);
  14844. return r
  14845. }
  14846. function y(e, t) {
  14847. var i = e ? 1 : 1e3
  14848. , n = J.tilegen || J.imgopt ? 6 : 2;
  14849. n = F.valueFromHash("tileconc", n);
  14850. var r = new ne
  14851. , o = new ae({
  14852. concurrentDownloads: n
  14853. })
  14854. , a = new se
  14855. , s = new P
  14856. , l = new M
  14857. , c = new S(t)
  14858. , h = new R
  14859. , u = new O(i)
  14860. , d = new L
  14861. , p = new oe;
  14862. return {
  14863. qualityManager: r,
  14864. panoRenderer: a,
  14865. tileDownloader: o,
  14866. player: c,
  14867. director: l,
  14868. modelManager: s,
  14869. tagManager: p,
  14870. displayController: u,
  14871. labelDisplayController: d,
  14872. controls: h
  14873. }
  14874. }
  14875. function C(e, t, i, n) {
  14876. var r = i.controls
  14877. , o = i.qualityManager
  14878. , a = i.panoRenderer
  14879. , s = i.tileDownloader
  14880. , l = i.modelManager;
  14881. r.init(n, l),
  14882. ee.init(i.director, r, i.player, l, t),
  14883. o.init(l),
  14884. s.init(o),
  14885. a.init(t, s, o),
  14886. l.init(s, a, o),
  14887. l.addModel(e),
  14888. t.addComponent(G)
  14889. }
  14890. function I(e, t, i, n) {
  14891. var r = i.qualityManager
  14892. , o = i.panoRenderer
  14893. , a = i.tileDownloader
  14894. , s = i.modelManager
  14895. , l = i.player
  14896. , c = i.director
  14897. , h = i.tagManager
  14898. , u = i.displayController
  14899. , d = i.labelDisplayController
  14900. , p = i.controls;
  14901. t.scene.add(e),
  14902. t.qualityManager = r;
  14903. var f = {
  14904. camera: t.camera,
  14905. director: c,
  14906. modelManager: s,
  14907. tileDownloader: a,
  14908. panoRenderer: o,
  14909. qualityManager: r,
  14910. tagManager: h,
  14911. container: n,
  14912. controls: p
  14913. };
  14914. l.init(f),
  14915. l.setScene(t.scene),
  14916. h.init(s, l),
  14917. c.init(l, s),
  14918. u.init(c, l, s, h, n),
  14919. d.init(l, s, n),
  14920. z.bindEvents(l),
  14921. t.addComponent(h),
  14922. t.addComponent(l),
  14923. t.addComponent(o),
  14924. l.sceneRenderer = t; //xzw add 方便resize
  14925. }
  14926. function E(e, t, i, n) {
  14927. return de.info("Starting player in " + i.mode),
  14928. H.report(t.sid, "started-playing", n, i.quickstart),
  14929. e.start(i)
  14930. }
  14931. function b(e, t) {
  14932. de.error(t),
  14933. k.error(t),
  14934. H.report(e, "error-" + t)
  14935. }
  14936. function w(e) {
  14937. var t = F.details();
  14938. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14939. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14940. H.report(e, "error-webgl-generic"))
  14941. }
  14942. function _(e, t, i) {
  14943. try {
  14944. e.start(t)
  14945. } catch (e) {
  14946. throw de.warn(e.message),
  14947. w(i.sid),
  14948. e
  14949. }
  14950. }
  14951. function T(e) {
  14952. e.stopPropagation(),
  14953. e.preventDefault()
  14954. }
  14955. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14956. /* if (window.DATA.hoticon){
  14957. g_HotImage = {
  14958. point: ('static/'+ window.DATA.hoticon.default )|| "https://super.4dage.com/static/images/4dagePoint2.png",
  14959. point2: ('static/'+ window.DATA.hoticon.higt) || "https://super.4dage.com/static/images/4dagePoint.png"
  14960. } ;
  14961. } */
  14962. //czj 判断someData 有没有backgroundMusic 添加音乐
  14963. if (window.DATA.backgroundMusic) {
  14964. if(window.isLocal){
  14965. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14966. }else{
  14967. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14968. }
  14969. $("#bgm").show();
  14970. }else if (g_version === "one"){
  14971. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14972. $("#bgm").show();
  14973. }
  14974. //隐藏公司logo
  14975. if(window.DATA.loadlogo){
  14976. showLogo();
  14977. }
  14978. e("./lib/three75-shim"),
  14979. e("./lib/array-polyfill"),
  14980. e("./lib/performance-polyfill"),
  14981. e("./lib/shaders/CopyShader.js"),
  14982. e("./lib/shaders/HorizontalBlurShader.js"),
  14983. e("./lib/shaders/VerticalBlurShader.js"),
  14984. e("./lib/postprocessing/EffectComposer.js"),
  14985. e("./lib/postprocessing/RenderPass.js"),
  14986. e("./lib/postprocessing/MaskPass.js"),
  14987. e("./lib/postprocessing/ShaderPass.js"),
  14988. window.Promise || (window.Promise = e("promise-polyfill"));
  14989. var x = e("three")
  14990. , _x = e("three")
  14991. , S = (e("./util/sentry"),
  14992. e("./player"))
  14993. , M = e("./director")
  14994. , R = e("./controls/CameraControls")
  14995. , P = e("./model/ModelManager")
  14996. , O = e("./DisplayController")
  14997. , L = e("./label/LabelDisplayController")
  14998. , D = e("./enum/Viewmode")
  14999. , N = e("./util/logger")
  15000. , B = e("./showcase")
  15001. , F = e("./util/browser")
  15002. , V = e("./settings")
  15003. , U = e("./gui/gui")
  15004. , k = e("./gui/error")
  15005. , H = e("./analytics")
  15006. , G = e("./util/transitions")
  15007. , z = e("./effects")
  15008. , W = e("./objects/Skybox")
  15009. , j = e("./util/common")
  15010. , Y = (e("./util/PanoramaCollection"),
  15011. e("./util/math"),
  15012. e("./util/showcase"))
  15013. , X = e("./util/camera")
  15014. , Z = (e("./objects/Panorama"),
  15015. e("./cameras/PanoramaCamera"),
  15016. e("./preloaders"))
  15017. , q = e("events").EventEmitter
  15018. , K = e("./featureflags")
  15019. , Q = (e("./util/lerp"),
  15020. e("./util/ajax"))
  15021. , J = e("./ab")
  15022. , ee = e("./sdk/automation.js")
  15023. , te = e("./scene/SceneRenderer")
  15024. , ie = e("./scene/QuickstartManager")
  15025. , ne = e("./tile/QualityManager.js")
  15026. , re = e("./localization/localize")
  15027. , oe = e("./tag/tagManager")
  15028. , ae = e("./tile/TileDownloader")
  15029. , se = e("./tile/PanoRenderer")
  15030. , le = (e("./enum/PanoSizeClass"),
  15031. e("./enum/PanoramaEvents"),
  15032. e("./enum/SceneRendererEvents"))
  15033. , ce = e("./gui/memoryUsage")
  15034. , he = e("./enum/RenderLayers")
  15035. , ue = e("./TimingData")
  15036. , de = new N(t);
  15037. N.level = V.logLevel,
  15038. N.consoleEnabled = V.console,
  15039. i()
  15040. }
  15041. }
  15042. ).call(this, "/js/main.js")
  15043. }
  15044. , {
  15045. "./DisplayController": 1,
  15046. "./TimingData": 2,
  15047. "./ab": 3,
  15048. "./analytics": 4,
  15049. "./cameras/PanoramaCamera": 7,
  15050. "./controls/CameraControls": 9,
  15051. "./director": 15,
  15052. "./effects": 16,
  15053. "./enum/PanoSizeClass": 36,
  15054. "./enum/PanoramaEvents": 37,
  15055. "./enum/RenderLayers": 41,
  15056. "./enum/SceneRendererEvents": 43,
  15057. "./enum/Viewmode": 51,
  15058. "./featureflags": 59,
  15059. "./gui/error": 64,
  15060. "./gui/gui": 65,
  15061. "./gui/memoryUsage": 73,
  15062. "./label/LabelDisplayController": 91,
  15063. "./lib/array-polyfill": 92,
  15064. "./lib/performance-polyfill": 95,
  15065. "./lib/postprocessing/EffectComposer.js": 96,
  15066. "./lib/postprocessing/MaskPass.js": 97,
  15067. "./lib/postprocessing/RenderPass.js": 98,
  15068. "./lib/postprocessing/ShaderPass.js": 99,
  15069. "./lib/shaders/CopyShader.js": 100,
  15070. "./lib/shaders/HorizontalBlurShader.js": 101,
  15071. "./lib/shaders/VerticalBlurShader.js": 102,
  15072. "./lib/three75-shim": 103,
  15073. "./localization/localize": 108,
  15074. "./tag/tagManager": 124,
  15075. "./model/ModelManager": 140,
  15076. "./objects/Panorama": 148,
  15077. "./objects/Skybox": 152,
  15078. "./player": 155,
  15079. "./preloaders": 156,
  15080. "./scene/QuickstartManager": 157,
  15081. "./scene/SceneRenderer": 158,
  15082. "./sdk/automation.js": 164,
  15083. "./settings": 166,
  15084. "./showcase": 168,
  15085. "./tile/PanoRenderer": 169,
  15086. "./tile/QualityManager.js": 170,
  15087. "./tile/TileDownloader": 171,
  15088. "./util/PanoramaCollection": 178,
  15089. "./util/ajax": 181,
  15090. "./util/browser": 182,
  15091. "./util/camera": 183,
  15092. "./util/common": 185,
  15093. "./util/lerp": 188,
  15094. "./util/logger": 189,
  15095. "./util/math": 190,
  15096. "./util/sentry": 192,
  15097. "./util/showcase": 193,
  15098. "./util/transitions": 195,
  15099. events: 202,
  15100. "promise-polyfill": 213,
  15101. three: 217
  15102. }],
  15103. 117: [function(e, t, i) {
  15104. "use strict";
  15105. function n(e) {
  15106. e = e || {}
  15107. r.RawShaderMaterial.call(this, a.extendObject({
  15108. fragmentShader: o.cube.fragmentShader,
  15109. vertexShader: o.cube.vertexShader,
  15110. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15111. name: "CubemapMaterial",
  15112. }, e))
  15113. }
  15114. var r = e("three")
  15115. , o = e("../shaders")
  15116. , a = e("../util/common");
  15117. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15118. n.prototype.constructor = n,
  15119. t.exports = n
  15120. }
  15121. , {
  15122. "../shaders": 167,
  15123. "../util/common": 185,
  15124. three: 217
  15125. }],
  15126. 118: [function(e, t, i) {
  15127. "use strict";
  15128. function n(e) {
  15129. e = e || {}
  15130. r.RawShaderMaterial.call(this, a.extendObject({
  15131. fragmentShader: o.model.fragmentShader,
  15132. vertexShader: o.model.vertexShader,
  15133. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15134. name: "ModelTextureMaterial",
  15135. }, e))
  15136. }
  15137. var r = e("three")
  15138. , o = e("../shaders")
  15139. , a = e("../util/common");
  15140. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15141. n.prototype.constructor = n,
  15142. n.prototype.setProjectedPanos = function(e, t, i) {
  15143. i && (this.uniforms.progress.value = 0),
  15144. e.ensureSkyboxReadyForRender(),
  15145. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15146. this.uniforms.pano0Position.value.copy(e.position),
  15147. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15148. t.ensureSkyboxReadyForRender(),
  15149. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15150. this.uniforms.pano1Position.value.copy(t.position),
  15151. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15152. }
  15153. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15154. this.uniforms.eyeDir.value.copy(dir)
  15155. this.uniforms.eyePos.value.copy(pos)
  15156. }
  15157. n.prototype.setBendCameraQua = function(matrix) {//加
  15158. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15159. } */
  15160. ,
  15161. t.exports = n
  15162. }
  15163. , {
  15164. "../shaders": 167,
  15165. "../util/common": 185,
  15166. three: 217
  15167. }],
  15168. 119: [function(e, t, i) {
  15169. (function(i) {
  15170. "use strict";
  15171. function n(e, t, i, n) {
  15172. this.div = null,
  15173. this.body = null,
  15174. this.label = e,
  15175. this.description = t,
  15176. this.parsedDescription = [],
  15177. this.media = i || {
  15178. type: null
  15179. },
  15180. this.loadingSpinner = null,
  15181. this.parser = new r({
  15182. supportLinks: !u.valueFromHash("mls"),
  15183. keepLinkLabels: !0
  15184. }),
  15185. this.state = I.CLOSED,
  15186. this.orientation = "",
  15187. this.initialTransform = "",
  15188. this.hovering = !1,
  15189. this.openTransition = null,
  15190. this.closeTransition = null,
  15191. this.openPromise = null,
  15192. this.closePromise = null,
  15193. this.animationTransition = null,
  15194. this.animationScale = 0
  15195. }
  15196. var r = e("../Parser/DescriptionParser")
  15197. , o = e("../Media/Link")
  15198. , a = e("../Media/Image")
  15199. , s = e("../Media/EmbedlyPlayer")
  15200. , l = e("../Media/EmbedlyEmbed")
  15201. , c = e("../../util/transitions")
  15202. , h = e("../../util/lerp")
  15203. , u = e("../../util/browser")
  15204. , d = e("./BillboardEvent")
  15205. , p = e("../Media/MediaEvent")
  15206. , f = e("../Parser/DescriptionChunkType")
  15207. , g = e("events").EventEmitter
  15208. , m = e("./billboardSettings")
  15209. , v = e("./overlaySettings")
  15210. , A = e("../../util/logger")
  15211. , y = new A(i)
  15212. , C = document.getElementById("tag-billboards");
  15213. C.addEventListener("touchend", function(e) {
  15214. C.style.pointerEvents = "none"
  15215. }),
  15216. C.addEventListener("touchcancel", function(e) {
  15217. C.style.pointerEvents = "none"
  15218. });
  15219. var I = {
  15220. CLOSED: "closed",
  15221. OPENING: "opening",
  15222. OPEN: "open",
  15223. CLOSING: "closing",
  15224. ACTIVE: "active"
  15225. };
  15226. n.prototype = Object.create(g.prototype),
  15227. n.prototype.build = function(e) {
  15228. this.parsedDescription = this.parser.parse(this.description);
  15229. var t = document.createElement("div");
  15230. t.className = "tag-container has-hotzone",
  15231. this.div = t,
  15232. this.body = document.createElement("div"),
  15233. this.body.className = "tag-body";
  15234. var i = document.createElement("div");
  15235. i.classList.add("tag-content");
  15236. var n = document.createElement("div");
  15237. n.classList.add("tag-text-content");
  15238. var r = document.createElement("div");
  15239. r.className = "tag-label",
  15240. r.textContent = this.label,
  15241. n.appendChild(r);
  15242. var o = document.createElement("div");
  15243. o.className = "tag-desc",
  15244. n.appendChild(o),
  15245. i.appendChild(n),
  15246. this.body.appendChild(i),
  15247. this.appendDescriptionElements(this.parsedDescription, o),
  15248. this.appendMedia(),
  15249. t.appendChild(this.body),
  15250. C.appendChild(t),
  15251. this.bindEvents(t, this.body)
  15252. }
  15253. ,
  15254. n.prototype.bindEvents = function(e, t) {
  15255. var i = function(e) {
  15256. return function(t) {
  15257. if (!this.div.classList.contains("overlay")) {
  15258. var i, n = document.getElementById("player");
  15259. try {
  15260. i = new MouseEvent(e,t)
  15261. } catch (n) {
  15262. i = document.createEvent("MouseEvents"),
  15263. 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)
  15264. }
  15265. n.dispatchEvent(i)
  15266. }
  15267. }
  15268. };
  15269. t.addEventListener("mousedown", function(e) {
  15270. e.stopPropagation()
  15271. }),
  15272. t.addEventListener("mouseup", function(e) {
  15273. e.stopPropagation()
  15274. }),
  15275. e.addEventListener("touchstart", function(e) {
  15276. C.style.pointerEvents = "auto"
  15277. }),
  15278. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15279. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15280. t.addEventListener("mouseover", function(t) {
  15281. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15282. }
  15283. .bind(this)),
  15284. e.addEventListener("mouseenter", function(e) {
  15285. this.state !== I.CLOSING && (this.hovering = !0,
  15286. this.emit(d.ENTER))
  15287. }
  15288. .bind(this)),
  15289. e.addEventListener("mouseleave", function(e) {
  15290. this.hovering = !1,
  15291. this.emit(d.LEAVE)
  15292. }
  15293. .bind(this)),
  15294. e.addEventListener("gesturestart", function(e) {
  15295. e.preventDefault()
  15296. });
  15297. var n = e.querySelector(".tag-text-content")
  15298. , r = 0;
  15299. n.addEventListener("touchstart", function(e) {
  15300. r = e.changedTouches[0].clientY
  15301. }),
  15302. n.addEventListener("touchmove", function(t) {
  15303. function i(e) {
  15304. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15305. }
  15306. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15307. }),
  15308. e.addEventListener("touchmove", function(e) {
  15309. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15310. })
  15311. }
  15312. ,
  15313. n.prototype.appendDescriptionElements = function(e, t) {
  15314. e.length > 0 && this.div.classList.add("has-text"),
  15315. e.forEach(function(e, i) {
  15316. switch (e.type) {
  15317. case f.TEXT:
  15318. t.appendChild(this.createTextElement(e.text));
  15319. break;
  15320. case f.LINK:
  15321. t.appendChild(this.createLinkElement(e.link))
  15322. }
  15323. }
  15324. .bind(this))
  15325. }
  15326. ,
  15327. n.prototype.appendLoadingSpinner = function() {
  15328. this.loadingSpinner = document.createElement("div"),
  15329. this.loadingSpinner.classList.add("loading-spinner");
  15330. var e = document.createElement("div");
  15331. e.classList.add("gui-spinner-icon"),
  15332. this.loadingSpinner.appendChild(e),
  15333. this.body.appendChild(this.loadingSpinner)
  15334. }
  15335. ,
  15336. n.prototype.onMediaLoadFinished = function() {
  15337. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15338. this.applyOrientation(this.orientation),
  15339. this.loadingSpinner = null)
  15340. }
  15341. ,
  15342. n.prototype.appendMedia = function() {
  15343. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15344. this.appendLoadingSpinner();
  15345. var e = document.createElement("div");
  15346. e.classList.add("tag-media-content");
  15347. var t = document.createElement("i");
  15348. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15349. t.classList.add(e)
  15350. }),
  15351. this.body.appendChild(t),
  15352. this.body.appendChild(e),
  15353. this.media.type) {
  15354. case f.IMAGE:
  15355. e.appendChild(this.createImageElement(this.media, this.body));
  15356. break;
  15357. case f.VIDEO:
  15358. e.appendChild(this.createVideoElement(this.media, this.body));
  15359. break;
  15360. case f.RICH:
  15361. e.appendChild(this.createEmbedElement(this.media, this.body))
  15362. }
  15363. }
  15364. }
  15365. ,
  15366. n.prototype.createTextElement = function(e) {
  15367. var t = document.createElement("span");
  15368. return t.textContent = e,
  15369. t
  15370. }
  15371. ;
  15372. n.prototype.createLinkElement = function(e) {
  15373. var t = new o(e);
  15374. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15375. t.createDomElement()
  15376. }
  15377. ,
  15378. n.prototype.createImageElement = function(e, t) {
  15379. function i() {
  15380. function e() {
  15381. m || (r.classList.remove("view-image"),
  15382. c.classList.add("overlay"),
  15383. i(),
  15384. window.addEventListener("resize", b),
  15385. c.addEventListener("click", a),
  15386. g.addEventListener("click", l),
  15387. f.addEventListener("click", s),
  15388. m = !0,
  15389. o.emit(p.IMAGE_OPENED))
  15390. }
  15391. function i() {
  15392. t.classList.add("show-info"),
  15393. h.classList.remove("collapsible"),
  15394. h.style.height = "";
  15395. var e = parseFloat(getComputedStyle(I).lineHeight)
  15396. , i = y + e
  15397. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15398. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15399. , s = a
  15400. , l = s * n.aspect;
  15401. l > r && (l = r,
  15402. s = l / n.aspect),
  15403. s > a && (s = a,
  15404. l = s * n.aspect),
  15405. l += C,
  15406. s += C + i,
  15407. t.style.width = l + "px",
  15408. t.style.height = s + "px",
  15409. u.style.paddingTop = e + C + "px",
  15410. o.description.length > 0 && (h.classList.add("collapsible"),
  15411. h.style.height = h.clientHeight + 12 + "px",
  15412. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15413. }
  15414. function a(e) {
  15415. e.target === c && s()
  15416. }
  15417. function s() {
  15418. m && (m = !1,
  15419. r.classList.add("view-image"),
  15420. c.classList.remove("overlay"),
  15421. h.style.height = "",
  15422. u.style.paddingTop = "",
  15423. t.style.width = "",
  15424. t.style.height = "",
  15425. window.removeEventListener("resize", b),
  15426. c.removeEventListener("click", a),
  15427. g.removeEventListener("click", l),
  15428. f.removeEventListener("click", s),
  15429. o.emit(p.IMAGE_CLOSED),
  15430. o.close(!0))
  15431. }
  15432. function l(e) {
  15433. t.classList.toggle("show-info")
  15434. }
  15435. var c = o.div
  15436. , h = c.getElementsByClassName("tag-content")[0]
  15437. , u = c.getElementsByClassName("tag-media-content")[0]
  15438. , f = t.getElementsByClassName("close")[0]
  15439. , g = h.getElementsByClassName("tag-label")[0];
  15440. c.classList.add("has-image"),
  15441. r.classList.add("view-image"),
  15442. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15443. o.applyOrientation(o.orientation);
  15444. var m = !1
  15445. , A = getComputedStyle(h)
  15446. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15447. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15448. , I = h.querySelector(".tag-label")
  15449. , E = h.querySelector(".tag-desc")
  15450. , b = function() {
  15451. var e, t, n = 0;
  15452. return function() {
  15453. clearInterval(e),
  15454. clearTimeout(t),
  15455. e = setInterval(function() {
  15456. var e = c.clientHeight;
  15457. n !== e && (i(),
  15458. n = e)
  15459. }, 100),
  15460. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15461. }
  15462. }();
  15463. n.on(p.IMAGE_OPENING, e),
  15464. o.on(d.ACTIVATE, e),
  15465. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15466. o.on(d.CLOSING, s)
  15467. }
  15468. var n = new a
  15469. , r = n.createDomElement();
  15470. this.once(d.OPENED, function() {
  15471. n.load(e.src).then(i).catch(function(t) {
  15472. y.warn("Failed to load image:", e.src),
  15473. y.warn("with error:", t)
  15474. }).then(this.onMediaLoadFinished.bind(this))
  15475. });
  15476. var o = this;
  15477. return r
  15478. }
  15479. ,
  15480. n.prototype.createVideoElement = function(e, t) {
  15481. var i = new s({
  15482. autoPlay: !0,
  15483. autoResume: !0,
  15484. startMuted: !1,
  15485. loop: !1
  15486. })
  15487. , n = i.createDomElement();
  15488. return this.once(d.OPENED, function() {
  15489. i.load(e.src).then(function() {
  15490. this.div.classList.add("has-video"),
  15491. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15492. i.play()),
  15493. this.on(d.OPENING, i.show.bind(i)),
  15494. this.on(d.OPENED, i.play.bind(i)),
  15495. this.on(d.CLOSING, i.pause.bind(i)),
  15496. this.on(d.CLOSED, i.hide.bind(i))
  15497. }
  15498. .bind(this)).catch(function(t) {
  15499. y.warn("Failed to embed video:", e.src),
  15500. y.warn("with error:", t)
  15501. }).then(this.onMediaLoadFinished.bind(this))
  15502. }
  15503. .bind(this)),
  15504. n
  15505. }
  15506. ,
  15507. n.prototype.createEmbedElement = function(e, t) {
  15508. var i = new l
  15509. , n = i.createDomElement();
  15510. return this.once(d.OPENED, function() {
  15511. i.load(e.src).then(function() {
  15512. this.div.classList.add("has-embed"),
  15513. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15514. this.applyOrientation(this.orientation),
  15515. this.on(d.OPENING, i.show.bind(i)),
  15516. this.on(d.CLOSED, i.hide.bind(i))
  15517. }
  15518. .bind(this)).catch(function(t) {
  15519. y.warn("Failed to embed:", e.src),
  15520. y.warn("with error:", t)
  15521. }).then(this.onMediaLoadFinished.bind(this))
  15522. }
  15523. .bind(this)),
  15524. n
  15525. }
  15526. ,
  15527. n.prototype.open = function(e) {
  15528. return this.openPromise = $.Deferred(),
  15529. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15530. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15531. this.state !== I.OPEN && (this.emit(d.OPENING),
  15532. e && this.emit(d.ACTIVATING),
  15533. this.state = I.OPENING,
  15534. this.animateOpen(function() {
  15535. e && this.setActiveState(),
  15536. this.openPromise.resolve()
  15537. }
  15538. .bind(this)))
  15539. }
  15540. .bind(this), m.animation.openDelay),
  15541. c.cancel(this.closeTransition),
  15542. this.closePromise && this.closePromise.reject(),
  15543. this.closeTransition = void 0,
  15544. this.openPromise.promise())
  15545. }
  15546. ,
  15547. n.prototype.close = function(e) {
  15548. return this.closePromise = $.Deferred(),
  15549. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15550. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15551. this.state = I.CLOSING,
  15552. this.animateClose())
  15553. }
  15554. .bind(this), m.animation.closeDelay)),
  15555. c.cancel(this.openTransition),
  15556. this.openPromise && this.openPromise.reject(),
  15557. this.openTransition = void 0,
  15558. this.closePromise.resolve(),
  15559. this.closePromise.promise())
  15560. }
  15561. ,
  15562. n.prototype.setActiveState = function() {
  15563. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15564. this.emit(d.ACTIVATE),
  15565. this.div.classList.remove("has-hotzone"))
  15566. }
  15567. ,
  15568. n.prototype.animateOpen = function(e) {
  15569. if (this.state === I.OPENING) {
  15570. if (c.cancel(this.animationTransition),
  15571. u.detectSamsungNative())
  15572. return this.boardOrientation = null,
  15573. this.div.style.visibility = "visible",
  15574. this.emit(d.OPENED),
  15575. this.state = I.OPEN,
  15576. void (e && e());
  15577. this.div.style.webkitTransform = "scale(0)",
  15578. this.div.style.transform = "scale(0)",
  15579. this.div.style.visibility = "visible",
  15580. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15581. this.emit(d.OPENED),
  15582. this.state = I.OPEN,
  15583. e && e()
  15584. }
  15585. .bind(this))
  15586. }
  15587. }
  15588. ,
  15589. n.prototype.animateClose = function(e) {
  15590. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15591. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15592. this.emit(d.CLOSED),
  15593. this.state = I.CLOSED,
  15594. this.div.style.visibility = "hidden",
  15595. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15596. e && e()
  15597. }
  15598. .bind(this)))
  15599. }
  15600. ,
  15601. n.prototype.needsUpdate = function() {
  15602. return this.state !== I.CLOSED
  15603. }
  15604. ,
  15605. n.prototype.update = function(e, t) {
  15606. if (this.needsUpdate()) {
  15607. var i = (this.updateOrientation(e),
  15608. this.calcScale(t))
  15609. , n = {
  15610. x: (e.x + 1) * $("#player").width() / 2,
  15611. y: (e.y + 1) * $("#player").height() / 2
  15612. };
  15613. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15614. this.div.style.webkitTransform = this.div.screenTransform,
  15615. this.div.style.transform = this.div.screenTransform
  15616. }
  15617. }
  15618. ,
  15619. n.prototype.getDimensions = function() {
  15620. return this.div.getBoundingClientRect()
  15621. }
  15622. ,
  15623. n.prototype.calcScale = function(e) {
  15624. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15625. }
  15626. ,
  15627. n.prototype.updateOrientation = function(e) {
  15628. if (this.state !== I.ACTIVE) {
  15629. var t = 1 / 3
  15630. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15631. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15632. , r = "";
  15633. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15634. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15635. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15636. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15637. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15638. }
  15639. }
  15640. ,
  15641. n.prototype.applyOrientation = function(e) {
  15642. this.div.style.transform = this.div.style.webkitTransform = "",
  15643. this.div.classList.remove("tag-container-" + this.orientation),
  15644. this.div.classList.add("tag-container-" + e);
  15645. var t = window.getComputedStyle(this.div);
  15646. this.initialTransform = t.transform || t.webkitTransform,
  15647. "none" === this.initialTransform && (this.initialTransform = "");
  15648. var i = t.transform.slice(7, -1).split(",")
  15649. , n = -i[4]
  15650. , r = -i[5];
  15651. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15652. this.div.style.transformOrigin = n + "px " + r + "px",
  15653. this.orientation = e
  15654. }
  15655. ,
  15656. t.exports = n
  15657. }
  15658. ).call(this, "/js/tag/Billboard/Billboard.js")
  15659. }
  15660. , {
  15661. "../../util/browser": 182,
  15662. "../../util/lerp": 188,
  15663. "../../util/logger": 189,
  15664. "../../util/transitions": 195,
  15665. "../Media/EmbedlyEmbed": 125,
  15666. "../Media/EmbedlyPlayer": 126,
  15667. "../Media/Image": 128,
  15668. "../Media/Link": 129,
  15669. "../Media/MediaEvent": 131,
  15670. "../Parser/DescriptionChunkType": 133,
  15671. "../Parser/DescriptionParser": 134,
  15672. "./BillboardEvent": 120,
  15673. "./billboardSettings": 121,
  15674. "./overlaySettings": 122,
  15675. events: 202
  15676. }],
  15677. 120: [function(e, t, i) {
  15678. "use strict";
  15679. t.exports = Object.freeze({
  15680. ENTER: "billboard.enter",
  15681. LEAVE: "billboard.leave",
  15682. OPENING: "billboard.opening",
  15683. OPENED: "billboard.open",
  15684. CLOSING: "billboard.closing",
  15685. CLOSED: "billboard.closed",
  15686. ACTIVATING: "billboard.activating",
  15687. ACTIVATE: "billboard.activate"
  15688. })
  15689. }
  15690. , {}],
  15691. 121: [function(e, t, i) {
  15692. "use strict";
  15693. t.exports = Object.freeze({
  15694. animation: Object.freeze({
  15695. hoverOnClosing: !1,
  15696. openDelay: 100,
  15697. closeDelay: 50,
  15698. openDuration: 200,
  15699. closeDuration: 100
  15700. }),
  15701. boardToDiscRatio: 1.2
  15702. })
  15703. }
  15704. , {}],
  15705. 122: [function(e, t, i) {
  15706. "use strict";
  15707. t.exports = Object.freeze({
  15708. boundaryWidth: 30,
  15709. boundaryHeight: 0
  15710. })
  15711. }
  15712. , {}],
  15713. 123: [function(e, t, i) {//tag
  15714. (function(i) {
  15715. "use strict";
  15716. function n(e, t, i) {
  15717. var n = i.version || "0";
  15718. "0" !== n && I.info("tag defined using version " + n),
  15719. this.model = e,
  15720. this.sid = t,
  15721. this.color = (new r.Color).set(i.color || l.tagDefault),
  15722. this.hoverColor = l._darken(this.color, .2),
  15723. this.floor = null,
  15724. this.floorIndex = i.floor,
  15725. this.mode = s.PANORAMA,
  15726. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15727. this.obj3d = null,
  15728. this.disc = null,
  15729. this.materials = {
  15730. disc: null,
  15731. pole: null
  15732. },
  15733. this.position = (new r.Vector3).copy(i.position),
  15734. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15735. this.discWorldPosition = null,
  15736. this.discScale = .05,
  15737. this.poleEnabled = i.stem.enabled,
  15738. this.billboard = new o(i.label,i.description,i.media,this),
  15739. this.visibleTransition = null,
  15740. this.hoveringDisc = !1
  15741. }
  15742. var r = e("three")
  15743. , o = e("./Billboard/Billboard")
  15744. , a = e("../settings")
  15745. , s = e("../enum/Viewmode")
  15746. , l = e("../enum/Colors")
  15747. , c = e("../enum/RenderLayers")
  15748. , h = e("../enum/RenderOrder")
  15749. , u = (e("../util/common"),
  15750. e("../util/math"))
  15751. , d = e("../util/texture")
  15752. , p = e("../objects/Panorama")
  15753. , f = e("../shaders")
  15754. , g = e("../util/transitions")
  15755. , m = e("../util/lerp")
  15756. , v = e("../util/easing")
  15757. , A = e("./Billboard/BillboardEvent")
  15758. , y = e("events").EventEmitter
  15759. , C = e("../util/logger")
  15760. , I = new C(i)
  15761. , 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==")
  15762. , 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")
  15763. , w = new r.PlaneBufferGeometry(1,1);
  15764. n.prototype = Object.create(y.prototype),
  15765. n.raycaster = new r.Raycaster,
  15766. n.prototype.bindEvents = function() {
  15767. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15768. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15769. }
  15770. ,
  15771. n.prototype.build = function() {
  15772. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15773. this.floor && (this.billboard.build(this.model.sid),
  15774. this.obj3d = this.buildObject3D(),
  15775. this.floor.add(this.obj3d)),
  15776. this
  15777. }
  15778. ,
  15779. n.prototype.buildObject3D = function() {
  15780. var e = new r.Object3D;
  15781. e.position.copy(this.position);
  15782. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15783. t.bg.value = b,
  15784. t.mask.value = E,
  15785. t.color.value.copy(this.color),
  15786. this.materials.disc = new r.RawShaderMaterial({
  15787. transparent: !0,
  15788. vertexShader: f.tagDisc.vertexShader,
  15789. fragmentShader: f.tagDisc.fragmentShader,
  15790. uniforms: t
  15791. }),
  15792. this.disc = new r.Mesh(w,this.materials.disc),
  15793. this.disc.layers.set(c.TAG),
  15794. this.disc.position.copy(this.discPosition),
  15795. this.disc.renderOrder = h.tagDisc,
  15796. this.disc.tag = this;
  15797. var i = this.buildPole();
  15798. return i.layers.set(c.TAG),
  15799. i.renderOrder = h.tagStem,
  15800. e.add(i),
  15801. e.layers.set(c.TAG),
  15802. e.add(this.disc)
  15803. }
  15804. ,
  15805. n.prototype.buildPole = function() {
  15806. var e = new r.BufferGeometry
  15807. , t = new Float32Array(6);
  15808. return t[0] = t[1] = t[2] = 0,
  15809. t[3] = this.discPosition.x,
  15810. t[4] = this.discPosition.y,
  15811. t[5] = this.discPosition.z,
  15812. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15813. this.materials.pole = new r.LineBasicMaterial({
  15814. linewidth: a.tags.pole.width,
  15815. color: a.tags.pole.color,
  15816. opacity: 0,
  15817. visible: this.poleEnabled,
  15818. transparent: !0,
  15819. depthWrite: !1
  15820. }),
  15821. new r.Line(e,this.materials.pole)
  15822. }
  15823. ,
  15824. n.prototype.setFreeState = function(e) {
  15825. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15826. this.materials.disc.uniforms.color.value = this.color
  15827. }
  15828. .bind(this))
  15829. }
  15830. ,
  15831. n.prototype.setHoverState = function(e) {
  15832. this.billboard.open(e),
  15833. this.materials.disc.uniforms.color.value = this.hoverColor
  15834. }
  15835. ,
  15836. n.prototype.hide = function(e, t) {
  15837. var i = $.Deferred();
  15838. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15839. return i.resolve().promise();
  15840. e = e || 0,
  15841. t = t || 0,
  15842. g.cancel(this.visibleTransition);
  15843. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15844. , r = t + e
  15845. , o = t / r;
  15846. return this.visibleTransition = g.start(function(e) {
  15847. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15848. , i = m.property(e.materials.pole, "opacity", 0);
  15849. return function(n) {
  15850. t(n),
  15851. e.materials.pole && i(n)
  15852. }
  15853. }(this), r * n, function() {
  15854. i.resolve()
  15855. }, o, v[a.warp.blendEasing]),
  15856. i.promise()
  15857. }
  15858. ,
  15859. n.prototype.show = function(e, t) {
  15860. var i = $.Deferred();
  15861. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15862. return i.resolve().promise();
  15863. e = e || 0,
  15864. t = t || 0,
  15865. g.cancel(this.visibleTransition);
  15866. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15867. , r = t + e
  15868. , o = t / r;
  15869. return this.visibleTransition = g.start(function(e) {
  15870. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15871. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15872. return function(n) {
  15873. t(n),
  15874. e.materials.pole && i(n)
  15875. }
  15876. }(this), r * n, function() {
  15877. i.resolve()
  15878. }, o, v[a.warp.blendEasing]),
  15879. i.promise()
  15880. }
  15881. ,
  15882. n.prototype.closestPanoTowardTag = function(e, t) {
  15883. var i = []
  15884. , o = []
  15885. , l = this.disc.getWorldPosition();
  15886. if (e === s.PANORAMA) {
  15887. var c = .5
  15888. , h = t.position.clone().sub(l).normalize();
  15889. i.push(p.filters.isPanoAligned()),
  15890. i.push(p.filters.isNeighbourPanoTo(t)),
  15891. i.push(p.filters.inPanoDirection(l, h, c)),
  15892. o.push(p.scoreFunctions.direction(l, h))
  15893. }
  15894. var u = new r.Vector3
  15895. , d = function(e) {
  15896. u.copy(l).sub(e.position);
  15897. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15898. , i = a.tags.navigate.tiltTolerance;
  15899. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15900. }
  15901. , f = function(e) {
  15902. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15903. };
  15904. i.push(f, d),
  15905. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15906. var g = this.model.panos.sortByScore(i, o);
  15907. if (a.tags.navigate.lineOfSight) {
  15908. for (var m = 0; m < g.length; m++) {
  15909. var v = g[m].item
  15910. , A = v.position.distanceTo(l);
  15911. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15912. return null;
  15913. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15914. var y = n.raycaster.intersectObjects(this.model.colliders);
  15915. if (0 === y.length || y[0].distance > A)
  15916. return v
  15917. }
  15918. return null
  15919. }
  15920. return g.length > 0 && g[0].item
  15921. }
  15922. ,
  15923. n.prototype.examine = function(e) {
  15924. var t = e.mode
  15925. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15926. , n = this.disc.getWorldPosition();
  15927. this.billboard.setActiveState();
  15928. var o = function() {
  15929. var t = this.billboard.getDimensions()
  15930. , n = new r.Vector3;
  15931. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15932. n.unproject(e.camera),
  15933. e.flyToPano({
  15934. pano: i,
  15935. lookAtPoint: n
  15936. })
  15937. }
  15938. .bind(this);
  15939. if (t === s.PANORAMA)
  15940. if (i !== e.currentPano) {
  15941. var l = {
  15942. pano: i,
  15943. lookAtPoint: n,
  15944. duration: null,
  15945. maxDistanceOverride: null,
  15946. skipWarpingCheck: !1
  15947. };
  15948. e.flyToPano(l, o)
  15949. } else
  15950. setTimeout(function() {
  15951. this.billboard.open().then(function() {
  15952. o()
  15953. })
  15954. }
  15955. .bind(this), 0);
  15956. else {
  15957. var c = {
  15958. pano: i
  15959. };
  15960. if (n) {
  15961. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15962. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15963. }
  15964. c.callback = o,
  15965. c.duration = 1500,
  15966. c.mode = s.PANORAMA,
  15967. e.flyToNewMode(c)
  15968. }
  15969. }
  15970. ,
  15971. n.prototype.update = function(e, t) {
  15972. var i = new r.Vector3;
  15973. return function(e, t) {
  15974. this.discWorldPosition = this.disc.getWorldPosition(),
  15975. this.updateDisc(e, t),
  15976. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15977. i.z < 1 && (i.y *= -1,
  15978. this.billboard.update(i, this.getDiscRadius(i, t))))
  15979. }
  15980. }(),
  15981. n.prototype.updateDisc = function(e, t) {
  15982. var i = new r.Vector3
  15983. , o = new r.Vector3
  15984. , l = new r.Vector3
  15985. , c = new r.Vector3
  15986. , h = new r.Vector3;
  15987. return function(e, t) {
  15988. var u = a.tags.visibility
  15989. , d = a.tags.disc.scale
  15990. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15991. 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)),
  15992. this.obj3d.visible) {
  15993. this.disc.quaternion.copy(t.quaternion);
  15994. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15995. i.copy(this.discWorldPosition).project(t),
  15996. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15997. l.set(f / 2, 0, 0).add(o),
  15998. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15999. h.copy(c).unproject(t);
  16000. var g = h.distanceTo(this.discWorldPosition)
  16001. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16002. this.discScale = g * m,
  16003. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16004. }
  16005. }
  16006. }(),
  16007. n.prototype.getDiscRadius = function(e, t) {
  16008. var i = new r.Vector3;
  16009. return function(e, t) {
  16010. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16011. Math.abs(e.x - i.x) * $("#player").width()
  16012. }
  16013. }(),
  16014. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16015. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16016. }
  16017. ,
  16018. n.prototype.offScreen = function(e, t) {
  16019. var i = e.getWorldPosition().project(t);
  16020. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16021. }
  16022. ,
  16023. n.viewportScale = function() {
  16024. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16025. n.viewportHeight = $("#player").height(),
  16026. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16027. n.currentViewportScale
  16028. }
  16029. ,
  16030. t.exports = n
  16031. }
  16032. ).call(this, "/js/tag/tag.js")
  16033. }
  16034. , {
  16035. "../enum/Colors": 19,
  16036. "../enum/RenderLayers": 41,
  16037. "../enum/RenderOrder": 42,
  16038. "../enum/Viewmode": 51,
  16039. "../objects/Panorama": 148,
  16040. "../settings": 166,
  16041. "../shaders": 167,
  16042. "../util/common": 185,
  16043. "../util/easing": 186,
  16044. "../util/lerp": 188,
  16045. "../util/logger": 189,
  16046. "../util/math": 190,
  16047. "../util/texture": 194,
  16048. "../util/transitions": 195,
  16049. "./Billboard/Billboard": 119,
  16050. "./Billboard/BillboardEvent": 120,
  16051. events: 202,
  16052. three: 217
  16053. }],
  16054. 124: [function(e, t, i) {
  16055. (function(i) {
  16056. "use strict";
  16057. function n() {
  16058. this.tagState = y.IDLE,
  16059. this.intersectTag = null,
  16060. this.hoveredTag = null,
  16061. this.activeTag = null,
  16062. this.tagDiscs = [],
  16063. this.raycaster = new r.Raycaster,
  16064. this.modelManager = null,
  16065. this.player = null,
  16066. this.totaltags = 0,
  16067. this.navigatingViaTag = !1,
  16068. this.enabled = !1
  16069. }
  16070. var r = e("three")
  16071. , o = e("../util/logger")
  16072. , a = e("../util/common")
  16073. , s = e("../controls/serializer")
  16074. , l = e("../objects/Snapshot")
  16075. , c = e("../settings")
  16076. , h = e("./Billboard/BillboardEvent")
  16077. , u = e("./Media/MediaEvent")
  16078. , d = e("./Media/LinkType")
  16079. , p = e("../enum/Viewmode")
  16080. , f = e("../enum/WarpStyle")
  16081. , g = e("../enum/BlackoutStyle")
  16082. , m = e("../enum/ModelManagerEvents")
  16083. , v = e("../enum/tagEvents")
  16084. , A = e("../enum/PlayerEvents")
  16085. , y = (e("../util/lerp"),
  16086. e("../enum/TagStates"))
  16087. , C = e("events").EventEmitter
  16088. , I = new o(i);
  16089. a.extend(n, C),
  16090. n.prototype.init = function(e, t) {
  16091. this.modelManager = e,
  16092. this.player = t,
  16093. this.updateModel(),
  16094. this.bindEvents()
  16095. }
  16096. ,
  16097. n.prototype.update = function(e) {
  16098. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16099. }
  16100. ,
  16101. n.prototype.updateTags = function(e, t, i, n) {
  16102. for (var r in this.model.tags)
  16103. this.model.tags[r].update(e, t, i, n)
  16104. }
  16105. ,
  16106. n.prototype.updateModel = function() {
  16107. this.model = this.modelManager.getActiveModel(),
  16108. this.gettagsFromModel(),
  16109. this.totaltags = Object.keys(this.model.tags).length
  16110. }
  16111. ,
  16112. n.prototype.gettagsFromModel = function() {
  16113. this.tagDiscs = [];
  16114. for (var e in this.model.tags) {
  16115. var t = this.model.tags[e].disc;
  16116. t && this.tagDiscs.push(t)
  16117. }
  16118. }
  16119. ,
  16120. n.prototype.bindEvents = function() {
  16121. function e() {
  16122. Object.keys(this.model.tags).forEach(function(e) {
  16123. var t = this.model.tags[e];
  16124. t.bindEvents(),
  16125. t.billboard.on(u.LINK_CLICK, function(e) {
  16126. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16127. }
  16128. .bind(this)),
  16129. t.billboard.on(u.IMAGE_OPENED, function() {
  16130. this.tagState = y.EXAMINE,
  16131. this.emit(u.IMAGE_OPENED)
  16132. }
  16133. .bind(this)),
  16134. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16135. }
  16136. .bind(this))
  16137. }
  16138. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16139. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16140. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16141. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16142. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16143. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16144. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16145. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16146. e.call(this)
  16147. }
  16148. ,
  16149. n.prototype.navigateViaLink = function(e) {
  16150. var t = s.deserialize(e);
  16151. if (t)
  16152. if (t.mode === p.PANORAMA) {
  16153. try {
  16154. this.player.model.panos.get(t.panoId)
  16155. } catch (e) {
  16156. return void I.warn("Unable to find panorama location", t.panoId)
  16157. }
  16158. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16159. } else {
  16160. var i = {
  16161. cameraMode: t.mode,
  16162. position: t.position,
  16163. quaternion: t.quaternion,
  16164. scanId: t.panoId,
  16165. orthoZoom: t.zoom,
  16166. floorVisibility: t.floorVisibility,
  16167. thumbUrl: null,
  16168. name: null
  16169. };
  16170. this.player.flyToNewMode({
  16171. mode: t.mode,
  16172. duration: c.warp.outsideTime,
  16173. warpDest: new l(i),
  16174. force: !0
  16175. })
  16176. }
  16177. }
  16178. ,
  16179. n.prototype.handleWarpStart = function(e, t, i, n) {
  16180. this.dismissExaminedTag(),
  16181. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16182. e && (i = g.END),
  16183. this.hideShowTagsForBlackoutStyle(i, n))
  16184. }
  16185. ,
  16186. n.prototype.handleWarpInterruption = function(e, t, i) {
  16187. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16188. this.hideShowTagsForBlackoutStyle(t, i)
  16189. }
  16190. ,
  16191. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16192. var i = 0
  16193. , n = 0
  16194. , r = t / 2;
  16195. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16196. e) {
  16197. case g.END:
  16198. this.hideAlltags(r);
  16199. break;
  16200. case g.BEGINNING:
  16201. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16202. break;
  16203. case g.NONE:
  16204. break;
  16205. case g.MIDDLE:
  16206. i = r,
  16207. n = r,
  16208. this.hideAlltags(n),
  16209. setTimeout(function() {
  16210. this.showAlltags(i)
  16211. }
  16212. .bind(this), n);
  16213. break;
  16214. case g.FADEIN:
  16215. setTimeout(function() {
  16216. this.showAlltags(r)
  16217. }
  16218. .bind(this), r)
  16219. }
  16220. }
  16221. ,
  16222. n.prototype.onPlayerModeChanging = function(e, t) {
  16223. t !== p.PANORAMA && this.dismissExaminedTag(),
  16224. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16225. var i = t !== p.OUTDOOR;
  16226. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16227. }
  16228. ,
  16229. n.prototype.onPanoChange = function(e, t) {
  16230. var i = this.navigatingViaTag;
  16231. if (this.navigatingViaTag = !1,
  16232. !i) {
  16233. this.dismissExaminedTag();
  16234. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16235. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16236. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16237. }
  16238. }
  16239. ,
  16240. n.prototype.onPlayerReady = function(e, t, i) {
  16241. this.startAlltags(e, t ? i : null)
  16242. }
  16243. ,
  16244. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16245. this.updateClosestTags(e)
  16246. }
  16247. ,
  16248. n.prototype.dismissExaminedTag = function() {
  16249. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16250. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16251. this.hoveredTag = null)
  16252. }
  16253. ,
  16254. n.prototype.startAlltags = function(e, t) {
  16255. this.model.shouldShowtags = c.tags.enabled,
  16256. this.enabled = !0,
  16257. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16258. t && setTimeout(function() {
  16259. this.activateTag(this.model.getTagBySid(t))
  16260. }
  16261. .bind(this), c.tags.startup.fadeInDuration / 2))
  16262. }
  16263. ,
  16264. n.prototype.showAlltags = function(e, t, i) {
  16265. function n() {
  16266. o++,
  16267. o === this.totaltags && (this.model.tagsShown = !0,
  16268. r.resolve())
  16269. }
  16270. var r = $.Deferred();
  16271. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16272. return r.resolve().promise();
  16273. var o = 0;
  16274. for (var a in this.model.tags) {
  16275. var s = this.model.tags[a];
  16276. s.show(e, t).done(n.bind(this))
  16277. }
  16278. return r.promise()
  16279. }
  16280. ,
  16281. n.prototype.hideAlltags = function(e, t) {
  16282. function i() {
  16283. r++,
  16284. r === this.totaltags && (this.model.tagsShown = !1,
  16285. n.resolve())
  16286. }
  16287. var n = $.Deferred()
  16288. , r = 0;
  16289. for (var o in this.model.tags) {
  16290. var a = this.model.tags[o];
  16291. a.hide(e, t).done(i.bind(this)),
  16292. a === this.activeTag && this.dismissActiveTag()
  16293. }
  16294. return n.promise()
  16295. }
  16296. ,
  16297. n.prototype.enableHovering = function() {
  16298. this.enabled = !0
  16299. }
  16300. ,
  16301. n.prototype.disableHovering = function() {
  16302. this.enabled = !1
  16303. }
  16304. ,
  16305. n.prototype.activateTag = function(e, t) {
  16306. t = t || y.EXAMINE,
  16307. this.activeTag = e,
  16308. this.activeTag.hoveringDisc = !0,
  16309. this.activeTag.setHoverState(t === y.EXAMINE),
  16310. this.tagState = t,
  16311. this.emit(v.TagActivated, e)
  16312. }
  16313. ,
  16314. n.prototype.dismissActiveTag = function() {
  16315. this.activeTag.hoveringDisc = !1,
  16316. this.activeTag.setFreeState(!0);
  16317. var e = this.activeTag;
  16318. this.activeTag = null,
  16319. this.tagState = y.IDLE,
  16320. this.emit(v.TagDismissed, e)
  16321. }
  16322. ,
  16323. n.prototype.clickedOnTag = function(e) {
  16324. var t = function() {
  16325. this.navigatingViaTag = !0,
  16326. this.activeTag.examine(this.player),
  16327. this.emit(v.TagNavigation, this.activeTag)
  16328. }
  16329. .bind(this);
  16330. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16331. this.activeTag = this.intersectTag,
  16332. t(),
  16333. !0) : (this.dismissActiveTag(),
  16334. !1)
  16335. }
  16336. ,
  16337. n.prototype.intersecttag = function() {
  16338. var e = new r.Vector3
  16339. , t = new r.Vector3
  16340. , i = new r.Vector3;
  16341. return function(n, r, o) {
  16342. if (!this.enabled)
  16343. return null;
  16344. var a = null
  16345. , s = this.tagDiscs.filter(function(e) {
  16346. return e.parent.visible
  16347. });
  16348. if (s.length > 0) {
  16349. var l = this.model.floors.reduce(function(e, t) {
  16350. return t.hidden ? e : e.concat(t.collider.children)
  16351. }, s);
  16352. e.set(n.x, n.y, -1).unproject(o),
  16353. t.set(n.x, n.y, 1).unproject(o),
  16354. i.copy(t).sub(e).normalize(),
  16355. this.raycaster.set(e, i);
  16356. var c = this.raycaster.intersectObjects(l);
  16357. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16358. }
  16359. return this.intersectTag = a,
  16360. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16361. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16362. this.hoveredTag = a
  16363. }
  16364. .bind(this)),
  16365. a.billboard.on(h.LEAVE, function() {
  16366. this.hoveredTag = null
  16367. }
  16368. .bind(this))),
  16369. this.activateTag(a, y.BROWSE))),
  16370. a
  16371. }
  16372. }(),
  16373. n.prototype.rankedtagInDirection = function() {
  16374. var e = []
  16375. , t = []
  16376. , i = new r.Vector3
  16377. , n = new r.Vector3
  16378. , o = new r.Vector3;
  16379. return function(r, a, s, l) {
  16380. var c = 0;
  16381. t.length = 0;
  16382. for (var h = 0; h < this.closesttags.length; h++) {
  16383. var u = this.closesttags[h];
  16384. n.copy(u.position),
  16385. n.add(u.discPosition),
  16386. i.copy(a),
  16387. i.sub(n).negate(),
  16388. i.normalize();
  16389. var d = i.dot(l);
  16390. if (d >= 0) {
  16391. o.copy(n),
  16392. o.project(s);
  16393. var p = this.intersecttag(o, !1, s);
  16394. if (p) {
  16395. if (c >= e.length)
  16396. for (var f = 0; f < 64; f++)
  16397. e.push({
  16398. tag: u,
  16399. dot: d
  16400. });
  16401. var g = e[c];
  16402. g.tag = u,
  16403. g.dot = d,
  16404. g.position = math.projectPositionToCanvas(n, s),
  16405. t.push(g),
  16406. c++
  16407. }
  16408. }
  16409. }
  16410. return t.sort(function(e, t) {
  16411. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16412. }),
  16413. r < t.length ? t[r].tag : null
  16414. }
  16415. }(),
  16416. n.prototype.updateClosestTags = function() {
  16417. var e = new r.Vector3
  16418. , t = 30;
  16419. return function(i) {
  16420. this.closesttags || (this.closesttags = []),
  16421. this.closesttags.length = 0;
  16422. var n = this.model.tags;
  16423. if (n)
  16424. for (var r in n)
  16425. if (n.hasOwnProperty(r)) {
  16426. var o = n[r]
  16427. , a = o.position;
  16428. e.copy(i),
  16429. e.sub(a).negate();
  16430. var s = e.lengthSq();
  16431. s < t && this.closesttags.push(o)
  16432. }
  16433. }
  16434. }(),
  16435. t.exports = n
  16436. }
  16437. ).call(this, "/js/tag/tagManager.js")
  16438. }
  16439. , {
  16440. "../controls/serializer": 14,
  16441. "../enum/BlackoutStyle": 18,
  16442. "../enum/tagEvents": 32,
  16443. "../enum/ModelManagerEvents": 33,
  16444. "../enum/PlayerEvents": 40,
  16445. "../enum/TagStates": 44,
  16446. "../enum/Viewmode": 51,
  16447. "../enum/WarpStyle": 52,
  16448. "../objects/Snapshot": 153,
  16449. "../settings": 166,
  16450. "../util/common": 185,
  16451. "../util/lerp": 188,
  16452. "../util/logger": 189,
  16453. "./Billboard/BillboardEvent": 120,
  16454. "./Media/LinkType": 130,
  16455. "./Media/MediaEvent": 131,
  16456. events: 202,
  16457. three: 217
  16458. }],
  16459. 125: [function(e, t, i) {
  16460. (function(i) {
  16461. "use strict";
  16462. function n() {
  16463. this.embedWrapper = null,
  16464. this.embedElement = null
  16465. }
  16466. var r = e("../../util/ajax")
  16467. , o = e("./mediaSettings")
  16468. , a = e("../../settings")
  16469. , s = e("../../util/logger")
  16470. , l = new s(i);
  16471. n.prototype.createDomElement = function() {
  16472. return this.embedWrapper = document.createElement("div"),
  16473. this.embedWrapper.classList.add("tag-embed"),
  16474. this.embedWrapper.classList.add("hidden"),
  16475. this.embedWrapper
  16476. }
  16477. ,
  16478. n.prototype.load = function(e) {
  16479. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16480. return new Promise(function(e, i) {
  16481. r.get(t).then(function(t) {
  16482. if (t = JSON.parse(t),
  16483. t.html && t.html.indexOf("<script") === -1) {
  16484. this.embedWrapper.innerHTML = t.html;
  16485. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16486. if (this.embedWrapper.style.width = n + "px",
  16487. t.height) {
  16488. var r = t.height / t.width;
  16489. this.embedWrapper.style.height = n * r + "px"
  16490. }
  16491. this.embedElement = this.embedWrapper.firstChild;
  16492. var a = [];
  16493. try {
  16494. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16495. } catch (e) {
  16496. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16497. }
  16498. a.forEach(function(e) {
  16499. e.setAttribute("target", "_blank")
  16500. }),
  16501. this.embedElement.classList.add("hidden"),
  16502. this.embedWrapper.classList.remove("hidden"),
  16503. e()
  16504. } else
  16505. i("Not a valid embed")
  16506. }
  16507. .bind(this), function(e) {
  16508. i(e.response)
  16509. })
  16510. }
  16511. .bind(this))
  16512. }
  16513. ,
  16514. n.prototype.show = function() {
  16515. this.embedElement && this.embedElement.classList.remove("hidden")
  16516. }
  16517. ,
  16518. n.prototype.hide = function() {
  16519. this.embedElement && this.embedElement.classList.add("hidden")
  16520. }
  16521. ,
  16522. t.exports = n
  16523. }
  16524. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16525. }
  16526. , {
  16527. "../../settings": 166,
  16528. "../../util/ajax": 181,
  16529. "../../util/logger": 189,
  16530. "./mediaSettings": 132
  16531. }],
  16532. 126: [function(e, t, i) {
  16533. (function(i) {
  16534. "use strict";
  16535. function n(e) {
  16536. o.call(this),
  16537. this.options = e,
  16538. this.playerControls = null,
  16539. this.state = s.NOT_READY
  16540. }
  16541. var r = e("../../util/browser")
  16542. , o = e("./EmbedlyEmbed")
  16543. , a = e("../../util/logger")
  16544. , s = (new a(i),
  16545. Object.freeze({
  16546. NOT_READY: "player.not.ready",
  16547. CUED: "player.cued",
  16548. PLAYING: "player.playing",
  16549. PAUSED: "player.paused"
  16550. }));
  16551. n.prototype = Object.create(o.prototype),
  16552. n.prototype.createDomElement = function() {
  16553. return this.embedWrapper = document.createElement("div"),
  16554. this.embedWrapper.classList.add("tag-video"),
  16555. this.embedWrapper.classList.add("hidden"),
  16556. this.embedWrapper
  16557. }
  16558. ,
  16559. n.prototype.load = function(e) {
  16560. var t = function() {
  16561. function e(e) {
  16562. this.playerState = s.CUED,
  16563. this.options.startMuted && this.playerControls.mute()
  16564. }
  16565. function t(e) {
  16566. this.playerState = e
  16567. }
  16568. function i(e) {
  16569. this.playerControls.setCurrentTime(0),
  16570. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16571. }
  16572. this.playerControls = new playerjs.Player(this.embedElement),
  16573. this.playerControls.on("ready", e.bind(this)),
  16574. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16575. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16576. this.playerControls.on("ended", i.bind(this))
  16577. }
  16578. .bind(this);
  16579. return o.prototype.load.call(this, e).then(t.bind(this))
  16580. }
  16581. ,
  16582. n.prototype.play = function() {
  16583. var e = r.isMobile();
  16584. return function() {
  16585. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16586. }
  16587. }(),
  16588. n.prototype.pause = function() {
  16589. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16590. }
  16591. ,
  16592. t.exports = n
  16593. }
  16594. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16595. }
  16596. , {
  16597. "../../util/browser": 182,
  16598. "../../util/logger": 189,
  16599. "./EmbedlyEmbed": 125
  16600. }],
  16601. 127: [function(e, t, i) {
  16602. (function(i) {
  16603. "use strict";
  16604. function n(e) {
  16605. function t() {
  16606. return a.debug("requesting file from embedly:", e.href),
  16607. r.get(e.href, {
  16608. responseType: e.responseType
  16609. }).then(function(t) {
  16610. return a.debug("requesting file finished:", e.href),
  16611. t
  16612. })
  16613. }
  16614. function i() {}
  16615. return s = new Promise(function(e, n) {
  16616. s.catch(i).then(function() {
  16617. t().then(e, n)
  16618. })
  16619. }
  16620. )
  16621. }
  16622. var r = e("../../util/ajax")
  16623. , o = (e("./mediaSettings"),
  16624. e("../../util/logger"))
  16625. , a = new o(i)
  16626. , s = Promise.resolve();
  16627. t.exports.enqueue = n
  16628. }
  16629. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16630. }
  16631. , {
  16632. "../../util/ajax": 181,
  16633. "../../util/logger": 189,
  16634. "./mediaSettings": 132
  16635. }],
  16636. 128: [function(e, t, i) {
  16637. (function(i) {
  16638. "use strict";
  16639. function n() {
  16640. this.imageWrapper = null,
  16641. this.width = 0,
  16642. this.height = 0,
  16643. this.aspect = 1
  16644. }
  16645. var r = e("./MediaEvent")
  16646. , o = e("./EmbedlyQueue")
  16647. , a = e("events").EventEmitter
  16648. , s = e("../../util/logger")
  16649. , l = e("../../settings");
  16650. new s(i);
  16651. n.prototype = Object.create(a.prototype),
  16652. n.prototype.createDomElement = function() {
  16653. return this.imageWrapper = document.createElement("div"),
  16654. this.imageWrapper.classList.add("tag-image"),
  16655. this.imageWrapper.classList.add("hidden"),
  16656. this.imageWrapper.addEventListener("click", function(e) {
  16657. e.stopPropagation(),
  16658. this.emit(r.IMAGE_OPENING),
  16659. this.imageWrapper.style.pointerEvents = "none"
  16660. }
  16661. .bind(this)),
  16662. this.imageWrapper
  16663. }
  16664. ,
  16665. n.prototype.onClosed = function() {
  16666. this.imageWrapper.style.pointerEvents = "auto"
  16667. }
  16668. ,
  16669. n.prototype.load = function(e) {
  16670. var t = Math.max(window.screen.height, window.screen.width)
  16671. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16672. return new Promise(function(e, t) {
  16673. function n(t) {
  16674. var i = t.target;
  16675. this.width = i.naturalWidth,
  16676. this.height = i.naturalHeight,
  16677. this.aspect = this.width / this.height;
  16678. var n = t.target.src;
  16679. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16680. this.imageWrapper.style.width = this.width + "px",
  16681. this.imageWrapper.style.height = this.height + "px",
  16682. this.imageWrapper.classList.remove("hidden"),
  16683. e()
  16684. }
  16685. o.enqueue({
  16686. href: i,
  16687. responseType: "arraybuffer"
  16688. }).then(function(e) {
  16689. var t = new Uint8Array(e)
  16690. , i = new Blob([t])
  16691. , r = new window.Image;
  16692. r.addEventListener("load", n.bind(this));
  16693. var o = URL.createObjectURL(i);
  16694. r.src = o
  16695. }
  16696. .bind(this), t)
  16697. }
  16698. .bind(this))
  16699. }
  16700. ,
  16701. t.exports = n
  16702. }
  16703. ).call(this, "/js/tag/Media/Image.js")
  16704. }
  16705. , {
  16706. "../../settings": 166,
  16707. "../../util/logger": 189,
  16708. "./EmbedlyQueue": 127,
  16709. "./MediaEvent": 131,
  16710. events: 202
  16711. }],
  16712. 129: [function(e, t, i) {
  16713. "use strict";
  16714. function n(e) {
  16715. this.label = e.label,
  16716. this.href = e.url,
  16717. this.type = this.updateLinkForType(),
  16718. this.domElement = null,
  16719. this.id = c++
  16720. }
  16721. var r = e("./LinkType")
  16722. , o = e("./MediaEvent")
  16723. , a = e("../../util/browser")
  16724. , s = e("../../analytics")
  16725. , l = e("events").EventEmitter
  16726. , c = 0;
  16727. n.prototype = Object.create(l.prototype),
  16728. n.prototype.updateLinkForType = function() {
  16729. function e(e) {
  16730. var t = new RegExp("[#&?]start=([^#&?]*)")
  16731. , i = t.exec(e);
  16732. return i[1]
  16733. }
  16734. function t(e) {
  16735. return e + "&play=1"
  16736. }
  16737. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16738. 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),
  16739. r.NAVIGATION) : (this.href = t(this.href),
  16740. r.MODEL) : r.EXT_LINK
  16741. }
  16742. ;
  16743. var h = {};
  16744. n.prototype.createDomElement = function() {
  16745. function e(e) {
  16746. switch (e.stopPropagation(),
  16747. h[this.id] = !0,
  16748. s.trackAlways("click_tag_link", {
  16749. link_type: this.type,
  16750. link_count: c,
  16751. links_clicked: Object.keys(h).length
  16752. }),
  16753. this.type) {
  16754. case r.MODEL:
  16755. window.location.replace(this.href);
  16756. break;
  16757. case r.EXT_LINK:
  16758. window.open(this.href, "_blank")
  16759. }
  16760. this.emit(o.LINK_CLICK, {
  16761. type: this.type,
  16762. url: this.href
  16763. })
  16764. }
  16765. if (this.domElement = document.createElement("a"),
  16766. this.domElement.classList.add("tag-link"),
  16767. this.domElement.textContent = this.label,
  16768. this.type === r.EXT_LINK) {
  16769. this.domElement.textContent += " ";
  16770. var t = document.createElement("i");
  16771. t.classList.add("icon-ext-link"),
  16772. t.title = "Link to external web site",
  16773. this.domElement.appendChild(t)
  16774. }
  16775. return this.domElement.addEventListener("click", e.bind(this)),
  16776. this.domElement
  16777. }
  16778. ,
  16779. t.exports = n
  16780. }
  16781. , {
  16782. "../../analytics": 4,
  16783. "../../util/browser": 182,
  16784. "./LinkType": 130,
  16785. "./MediaEvent": 131,
  16786. events: 202
  16787. }],
  16788. 130: [function(e, t, i) {
  16789. "use strict";
  16790. t.exports = {
  16791. NAVIGATION: "navigation",
  16792. MODEL: "model",
  16793. EXT_LINK: "ext-link"
  16794. }
  16795. }
  16796. , {}],
  16797. 131: [function(e, t, i) {
  16798. "use strict";
  16799. t.exports = Object.freeze({
  16800. LINK_CLICK: "mtmedia.link",
  16801. IMAGE_LOADED: "mtmedia.image.loaded",
  16802. IMAGE_OPENING: "mtmedia.image.opening",
  16803. IMAGE_OPENED: "mtmedia.image.opened",
  16804. IMAGE_CLOSING: "mtmedia.image.closing",
  16805. IMAGE_CLOSED: "mtmedia.image.closed",
  16806. VIDEO_START: "mtmedia.video.start",
  16807. VIDEO_PAUSE: "mtmedia.video.pause",
  16808. VIDEO_ENDED: "mtmedia.video.end"
  16809. })
  16810. }
  16811. , {}],
  16812. 132: [function(e, t, i) {
  16813. "use strict";
  16814. t.exports = Object.freeze({
  16815. maxEmbedWidth: 350,
  16816. defaultAspectRatio: .75
  16817. })
  16818. }
  16819. , {}],
  16820. 133: [function(e, t, i) {
  16821. "use strict";
  16822. t.exports = Object.freeze({
  16823. TEXT: "text",
  16824. LINK: "link",
  16825. IMAGE: "photo",
  16826. VIDEO: "video",
  16827. RICH: "rich"
  16828. })
  16829. }
  16830. , {}],
  16831. 134: [function(e, t, i) {
  16832. "use strict";
  16833. function n(e) {
  16834. this.capabilities = {
  16835. links: {
  16836. enable: e.supportLinks,
  16837. keepLabels: e.keepLinkLabels
  16838. }
  16839. }
  16840. }
  16841. var r = e("./DescriptionChunkType");
  16842. n.prototype.parse = function(e, t) {
  16843. var i = []
  16844. , n = e.split("[").map(function(e, t) {
  16845. return 0 === t ? e : "[" + e
  16846. });
  16847. return n.forEach(function(e) {
  16848. var n = this.findMarkdown(e);
  16849. if (n) {
  16850. if (n.url.indexOf("javascript:") !== -1)
  16851. return;
  16852. this.addLinkChunk(i, n, t),
  16853. this.addTextChunk(i, e.slice(n.markdown.length))
  16854. } else
  16855. this.addTextChunk(i, e)
  16856. }
  16857. .bind(this)),
  16858. i
  16859. }
  16860. ,
  16861. n.prototype.findMarkdown = function(e) {
  16862. var t = /\[([^\]]*)\]\((.*)\)/
  16863. , i = e.match(t);
  16864. if (i) {
  16865. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16866. 0 !== r); )
  16867. o++;
  16868. var a = n.length - o;
  16869. return {
  16870. markdown: i[0].substring(0, i[0].length - a),
  16871. label: i[1],
  16872. url: i[2].substring(0, o)
  16873. }
  16874. }
  16875. }
  16876. ,
  16877. n.prototype.addTextChunk = function(e, t) {
  16878. 0 !== t.length && e.push({
  16879. type: r.TEXT,
  16880. text: t
  16881. })
  16882. }
  16883. ,
  16884. n.prototype.addLinkChunk = function(e, t) {
  16885. if (!this.capabilities.links.enable)
  16886. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16887. var i = {
  16888. label: t.label,
  16889. url: t.url
  16890. };
  16891. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16892. e.push({
  16893. type: r.LINK,
  16894. link: i
  16895. })
  16896. }
  16897. ,
  16898. t.exports = n
  16899. }
  16900. , {
  16901. "./DescriptionChunkType": 133
  16902. }],
  16903. 135: [function(e, t, i) {
  16904. (function(i) {
  16905. "use strict";
  16906. var n = e("../util/logger")
  16907. , r = new n(i)
  16908. , o = {
  16909. parseIdsFromChunkName: function(e, t) {
  16910. t.floorId = o.parseFloor(e),
  16911. t.roomId = o.parseRoom(e)
  16912. },
  16913. parseFloor: function(e) {
  16914. var t = e.match(/_group([0-9]+)/);
  16915. if (!t)
  16916. return 0;
  16917. try {
  16918. return parseInt(t[1], 10)
  16919. } catch (e) {
  16920. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16921. 0
  16922. }
  16923. },
  16924. parseRoom: function(e) {
  16925. var t = e.match(/_sub([0-9]+)/);
  16926. if (!t)
  16927. return -1;
  16928. try {
  16929. return parseInt(t[1], 10)
  16930. } catch (e) {
  16931. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16932. 0
  16933. }
  16934. }
  16935. };
  16936. t.exports = o
  16937. }
  16938. ).call(this, "/js/model/Chunks.js")
  16939. }
  16940. , {
  16941. "../util/logger": 189
  16942. }],
  16943. 136: [function(e, t, i) {
  16944. (function(i) {
  16945. "use strict";
  16946. function n(e) {
  16947. s.call(this),
  16948. this.model = e,
  16949. this.exploded = !1
  16950. }
  16951. var r = e("../objects/Floor")
  16952. , o = (e("../settings"),
  16953. e("../util/logger"))
  16954. , a = e("../util/transitions")
  16955. , s = e("../util/IndexedCollection")
  16956. , l = e("../util/common")
  16957. , c = e("../util/easing");
  16958. new o(i);
  16959. l.inherit(n, s),
  16960. n.prototype.add = function(e) {
  16961. s.prototype.add.call(this, e),
  16962. this.model.add(e)
  16963. }
  16964. ,
  16965. n.prototype.getIndex = function(e) {
  16966. return e.floorIndex
  16967. }
  16968. ,
  16969. n.prototype.build = function() {
  16970. this.list.forEach(function(e) {
  16971. e.build()
  16972. })
  16973. }
  16974. ,
  16975. n.prototype.size = function() {
  16976. return this.length
  16977. }
  16978. ,
  16979. n.prototype.sort = function() {
  16980. s.prototype.sort.call(this, function(e, t) {
  16981. return e.floorIndex - t.floorIndex
  16982. })
  16983. }
  16984. ,
  16985. n.prototype.nextFloor = function(e, t) {
  16986. return this.index[e.floorIndex + t] || null
  16987. }
  16988. ,
  16989. n.prototype.getFloorAtPoint = function(e) {
  16990. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16991. var r = this.list[n]
  16992. , o = r.distanceToPoint(e);
  16993. (!t || i > o) && (i = o,
  16994. t = r)
  16995. }
  16996. return t
  16997. }
  16998. ,
  16999. n.prototype.getOrMakeFloor = function(e) {
  17000. var t = this.index[e];
  17001. return t || (t = new r(this.model,e),
  17002. this.add(t)),
  17003. t
  17004. }
  17005. ,
  17006. n.prototype.hide = function() {
  17007. this.list.forEach(function(e) {
  17008. e.hide()
  17009. })
  17010. }
  17011. ,
  17012. n.prototype.show = function() {
  17013. this.list.forEach(function(e) {
  17014. e.show()
  17015. })
  17016. }
  17017. ,
  17018. n.prototype.names = function() {
  17019. return this.list.reduce(function(e, t) {
  17020. return e.concat(t.name)
  17021. }, [])
  17022. }
  17023. ,
  17024. n.prototype.toggleExplodeHorizontal = function() {
  17025. function e(e, t) {
  17026. r.copy(e.position),
  17027. e.position.x = i[e.floorIndex] * t,
  17028. e.position.y = 1 * e.floorIndex * t,
  17029. r.sub(e.position).multiplyScalar(-1),
  17030. e.panos.forEach(function(e) {
  17031. e.translate(r)
  17032. })
  17033. }
  17034. var t, i = [], n = 0;
  17035. this.list.forEach(function(e, r, o) {
  17036. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17037. n += t,
  17038. i[r] = n
  17039. }),
  17040. i = i.map(function(e) {
  17041. return e - n / 2
  17042. });
  17043. var r = this.list[0].position.clone();
  17044. this.exploded ? this.list.forEach(function(t) {
  17045. a.start(function(i) {
  17046. e(t, 1 - i)
  17047. }, 1500, null, 0, c.easeOutExpo)
  17048. }) : this.list.forEach(function(t) {
  17049. a.start(function(i) {
  17050. e(t, i)
  17051. }, 1500, null, 0, c.easeOutExpo)
  17052. }),
  17053. this.exploded = !this.exploded
  17054. }
  17055. ,
  17056. n.prototype.toggleExplodeVertical = function() {
  17057. function e(e, i) {
  17058. var n = n.copy(e.position);
  17059. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17060. n.sub(e.position).multiplyScalar(-1),
  17061. e.panos.forEach(function(e) {
  17062. e.translate(n)
  17063. })
  17064. }
  17065. var t = this.model.size;
  17066. this.list[0].position.clone();
  17067. this.exploded ? this.list.forEach(function(t) {
  17068. a.start(function(i) {
  17069. e(t, 1 - i)
  17070. }, 1500, null, 0, c.easeOutExpo)
  17071. }) : this.list.forEach(function(t) {
  17072. a.start(function(i) {
  17073. e(t, i)
  17074. }, 1500, null, 0, c.easeOutExpo)
  17075. }),
  17076. this.exploded = !this.exploded
  17077. }
  17078. ,
  17079. t.exports = n
  17080. }
  17081. ).call(this, "/js/model/FloorCollection.js")
  17082. }
  17083. , {
  17084. "../objects/Floor": 146,
  17085. "../settings": 166,
  17086. "../util/IndexedCollection": 175,
  17087. "../util/common": 185,
  17088. "../util/easing": 186,
  17089. "../util/logger": 189,
  17090. "../util/transitions": 195
  17091. }],
  17092. 137: [function(e, t, i) {
  17093. (function(i) {
  17094. "use strict";
  17095. function n() {
  17096. c.call(this)
  17097. }
  17098. var r = e("../settings")
  17099. , o = e("../util/logger")
  17100. , a = e("../enum/Viewmode")
  17101. , s = e("../objects/Snapshot")
  17102. , l = (e("../util/math"),
  17103. e("../util/common"))
  17104. , c = e("../util/IndexedCollection")
  17105. , h = new o(i);
  17106. l.inherit(n, c),
  17107. n.prototype.getImage = function(e) {
  17108. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17109. }
  17110. ,
  17111. n.prototype.filterByModesAndReel = function(e, t) {
  17112. for (var i = [], n = 0; n < t.length; n += 1) {
  17113. var r = t[n]
  17114. , o = this.index[r.sid];
  17115. o && i.push(o)
  17116. }
  17117. var s = e[a.DOLLHOUSE]
  17118. , l = e[a.FLOORPLAN];
  17119. i = i.filter(function(e) {
  17120. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17121. return !0;
  17122. var t;
  17123. try {
  17124. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17125. } catch (e) {
  17126. return h.debug(e.message),
  17127. !1
  17128. }
  17129. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17130. }),
  17131. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17132. this.list = i,
  17133. this.reIndex()
  17134. }
  17135. ,
  17136. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17137. if (0 === this.list.length)
  17138. return [];
  17139. var locations = [];
  17140. var deal = (info, container)=>{
  17141. var src = info.thumbnail_signed_src,
  17142. o = info.name || "";
  17143. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17144. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17145. let a = panos.get(info.metadata.scan_id);
  17146. if (a && !a.isAligned()) return
  17147. }
  17148. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17149. if (cameraMode === a.MESH) return
  17150. if(window.isLocal)src = manage.dealURL(src)
  17151. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17152. var l = {
  17153. cameraMode: cameraMode,
  17154. position: info.metadata.camera_position,
  17155. quaternion: info.metadata.camera_quaternion,
  17156. zoom: info.metadata.zoom,
  17157. panoId: info.metadata.scan_id,
  17158. orthoZoom: info.metadata.ortho_zoom,
  17159. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17160. thumbUrl: src,
  17161. name: n.filterImageName(o),
  17162. sid: info.sid
  17163. }
  17164. var item = new s(l);
  17165. item.momentTour = info.momentTour
  17166. item.dontRot = info.dontRot
  17167. item.rotTime = info.rotTime
  17168. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17169. container.push(item)
  17170. return item
  17171. }
  17172. }
  17173. this.list.forEach(image=>{
  17174. if(image.images){
  17175. var folder = $.extend({}, image )
  17176. folder.heroLocations = [];
  17177. image.images.list.forEach(child=>{
  17178. deal(child, folder.heroLocations);
  17179. })
  17180. folder.musicInfo = folder.musicInfo || {}
  17181. locations.push(folder)
  17182. delete folder.images;
  17183. delete folder.locations;
  17184. }else{
  17185. var item = deal(image, locations);
  17186. }
  17187. })
  17188. return locations
  17189. }
  17190. ,
  17191. n.prototype.getIndex = function(e) {
  17192. return e.sid
  17193. }
  17194. ,
  17195. n.filterImageName = function(e) {
  17196. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17197. }
  17198. ,
  17199. t.exports = n
  17200. }
  17201. ).call(this, "/js/model/ImageCollection.js")
  17202. }
  17203. , {
  17204. "../enum/Viewmode": 51,
  17205. "../objects/Snapshot": 153,
  17206. "../settings": 166,
  17207. "../util/IndexedCollection": 175,
  17208. "../util/common": 185,
  17209. "../util/logger": 189,
  17210. "../util/math": 190
  17211. }],
  17212. 138: [function(e, t, i) {
  17213. (function(i) {
  17214. "use strict";
  17215. function n() {
  17216. u.call(this)
  17217. }
  17218. var r = e("../label/Label")
  17219. , o = e("../settings")
  17220. , a = e("../util/logger")
  17221. , s = e("../util/math")
  17222. , l = e("../util/ajax")
  17223. , c = e("./RoomCollection")
  17224. , h = e("../util/common")
  17225. , u = e("../util/IndexedCollection");
  17226. new a(i);
  17227. h.inherit(n, u),
  17228. n.prototype.getIndex = function(e) {
  17229. return e.labelId
  17230. }
  17231. ,
  17232. n.prototype.associateWithRooms = function(e) {
  17233. this.forEach(function(t) {
  17234. e.forEach(function(e) {
  17235. e.roomId === t.roomId && (t.room = e)
  17236. })
  17237. })
  17238. }
  17239. ,
  17240. n.prototype.createFromLabelData = function(e) {
  17241. e.forEach(function(e) {
  17242. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17243. t = c.generateRoomId(e.floorId, t);
  17244. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17245. i.position = s.convertWorkshopVector(i.position),
  17246. this.add(i),
  17247. i.build()
  17248. }
  17249. .bind(this))
  17250. }
  17251. ,
  17252. n.prototype.load = function(e, t) {
  17253. return l.get(e, {
  17254. responseType: "json",
  17255. auth: t ? o.authorizationHeader : null
  17256. }).done(function(e) {
  17257. var t = [];
  17258. for (var i in e) {
  17259. var n = e[i];
  17260. t.push(n)
  17261. }
  17262. this.createFromLabelData(t)
  17263. }
  17264. .bind(this))
  17265. }
  17266. ,
  17267. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17268. var t = -1;
  17269. if (e) {
  17270. if(typeof e == 'number'){//add
  17271. t = parseInt(e)
  17272. }else{
  17273. var i = e.split("_");
  17274. t = parseInt(i[0])
  17275. }
  17276. }
  17277. return t
  17278. },
  17279. t.exports = n
  17280. }
  17281. ).call(this, "/js/model/LabelCollection.js")
  17282. }
  17283. , {
  17284. "../label/Label": 90,
  17285. "../settings": 166,
  17286. "../util/IndexedCollection": 175,
  17287. "../util/ajax": 181,
  17288. "../util/common": 185,
  17289. "../util/logger": 189,
  17290. "../util/math": 190,
  17291. "./RoomCollection": 141
  17292. }],
  17293. 139: [function(e, t, i) {
  17294. (function(i) {
  17295. "use strict";
  17296. function n(e, t) {
  17297. o.Object3D.call(this)
  17298. this.sid = window.number;//t.sid,
  17299. this.data = t,
  17300. this.options = e,
  17301. this.urls = new s(e.urlFiles),
  17302. this.isPublic = void 0 !== t.is_public && t.is_public,
  17303. //创建heroLocations
  17304. this.images = new _(this),
  17305. this.images.extend(t.images),
  17306. this.images.forEach((info)=>{
  17307. if(info.locations){
  17308. info.images = new _(this);
  17309. info.images.extend(info.locations)
  17310. }
  17311. })
  17312. this.heroLocations = []
  17313. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17314. this.outdoorPanoLocations = [],
  17315. this.floors = new d(this),
  17316. this.floorsEnabled = void 0 === e.floors || e.floors,
  17317. this.changingFloor = !1,
  17318. this.chunks = [],
  17319. this.panos = new A,
  17320. this.colliders = [],
  17321. this.loadPanosPromise = null,
  17322. this.loadMeshTexturesPromise = null,
  17323. this.auxDataPromise = null,
  17324. this.meshTexturesLoaded = !1,
  17325. this.meshTextures = [],
  17326. this.tags = {},
  17327. this.tagsShown = !1,
  17328. this.shouldShowtags = !1,
  17329. this.has360Views = !1,
  17330. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17331. this.supportedModes = {},
  17332. this.supportedModes[c.PANORAMA] = !0,
  17333. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17334. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17335. this.supportedModes[c.TRANSITIONING] = !0,
  17336. this.supportsTiles = this.configureTiling(),
  17337. // this.supportsVR = t.is_vr,
  17338. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17339. this.mode = c.DOLLHOUSE,
  17340. this.size = null,
  17341. this.center = null,
  17342. this.boundingBox = new o.Box3,
  17343. this.currentFloor = null,
  17344. this.allFloorsVisible = !0,
  17345. this.projectedPano0 = null,
  17346. this.projectedPano1 = null,
  17347. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17348. this.addFloor(new u(this,t,e.trim()))
  17349. }
  17350. .bind(this)),
  17351. this.waitQueue = [],
  17352. this.on("load", function(e) {
  17353. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17354. return !e.isLoadedCallback()
  17355. }),
  17356. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17357. }
  17358. .bind(this)),
  17359. this.setupCustomProperties()
  17360. this.hots = {};
  17361. }
  17362. function r() {
  17363. try {
  17364. var e = document.createElement("canvas")
  17365. , t = e.getContext("webgl");
  17366. t || (t = e.getContext("experimental-webgl"));
  17367. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17368. return i
  17369. } catch (e) {
  17370. return 0
  17371. }
  17372. }
  17373. var o = e("three")
  17374. , a = e("../util/ajax")
  17375. , s = e("../util/ModelUrls")
  17376. , l = e("../objects/BoundingTextureSkybox")
  17377. , c = e("../enum/Viewmode")
  17378. , h = e("../enum/RenderOrder")
  17379. , u = (e("../enum/AlignmentType"),
  17380. e("../objects/Floor"))
  17381. , d = e("./FloorCollection")
  17382. , p = e("../objects/Chunk")
  17383. , f = (e("../objects/Room"),
  17384. e("../objects/Snapshot"),
  17385. e("../label/Label"),
  17386. e("../util/math"),
  17387. e("../settings"))
  17388. ,ss = e("../shaders")
  17389. , g = e("../util/logger")
  17390. , m = e("../tag/tag")
  17391. , v = (e("../tag/tagManager"),
  17392. e("../objects/Panorama"))
  17393. , A = e("../util/PanoramaCollection")
  17394. , y = e("../loaders/ModelLoader")
  17395. , C = e("../loaders/ModelTextureLoader")
  17396. , I = e("../loaders/SweepDataLoader")
  17397. , E = e("../util/transitions")
  17398. , b = e("../util/common")
  17399. , es = e("../util/easing")
  17400. ,lerp = e("../util/lerp")
  17401. ,tex = e("../util/texture")
  17402. , w = e("./../util/browser")
  17403. , _ = e("./ImageCollection")
  17404. , T = e("./RoomCollection")
  17405. , x = e("./LabelCollection")
  17406. , S = e("./Chunks")
  17407. , cameraLight = e("./util/cameraLight")
  17408. , M = e("./../util/showcase")
  17409. , R = e("../exception/BasicException")
  17410. , P = (e("../constants")
  17411. ,e("events").EventEmitter)
  17412. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17413. //,Hot = e("hot")
  17414. , O = new g(i);
  17415. n.prototype = Object.create(o.Object3D.prototype),
  17416. b.extend(n, P),
  17417. n.prototype.setupCustomProperties = function() {
  17418. var e = f.modelAlpha;
  17419. Object.defineProperty(this, "alpha", {
  17420. get: function() {
  17421. return e
  17422. },
  17423. set: function(t) {
  17424. e = t,
  17425. this.chunks.forEach(function(t) {
  17426. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17427. })
  17428. }
  17429. })
  17430. }
  17431. ,
  17432. n.prototype.configureTiling = function() {
  17433. var e = r();
  17434. if (e < 2048)
  17435. return !1;
  17436. O.warn("Max cube texture size: " + e);
  17437. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17438. var i = f.tiling.tilingFlagNames[t];
  17439. if ("1" === w.valueFromHash(i, null))
  17440. return !0;
  17441. if ("0" === w.valueFromHash(i, null))
  17442. return !1
  17443. }
  17444. //--------------------------------------------许钟文-------------------------------------------
  17445. //return true;
  17446. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17447. //--------------------------------------------e n d -------------------------------------------
  17448. }
  17449. ,
  17450. n.prototype.toggleAlpha = function() {
  17451. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17452. }
  17453. ,
  17454. n.prototype.load = function(e) {
  17455. var t = function() {
  17456. return $.when(this.loadPanos(), this.loadMesh())
  17457. }
  17458. , i = this.urls.init().then(t.bind(this));
  17459. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17460. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17461. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17462. }
  17463. ,
  17464. n.prototype.loadMesh = function() {
  17465. function e(e) {
  17466. O.error(e),
  17467. n.reject("loading-failed")
  17468. }
  17469. function t(e, t) {
  17470. n.notify(e, t)
  17471. }
  17472. function i(e, t) {
  17473. if (0 === e.length) {
  17474. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17475. r.supportedModes[c.DOLLHOUSE] = !1,
  17476. r.supportedModes[c.FLOORPLAN] = !1;
  17477. var i = new p({
  17478. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17479. });
  17480. i.material.visible = !1,
  17481. i.rotateX(-Math.PI / 2),
  17482. i.geometry.computeBoundingBox(),
  17483. e = [i]
  17484. }
  17485. e.forEach(function(e) {
  17486. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17487. r.addChunk(t, e)
  17488. }),
  17489. r.floors.sort(),
  17490. n.resolve(r)
  17491. }
  17492. var n = $.Deferred()
  17493. , r = this;
  17494. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17495. n.promise()
  17496. }
  17497. ,
  17498. n.prototype.loadMeshTextures = function() {
  17499. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17500. this.meshTexturesLoaded = !0
  17501. }
  17502. .bind(this)),
  17503. this.loadTexturesPromise)
  17504. }
  17505. ,
  17506. /* n.prototype.loadtags = function() {//xzw改
  17507. var e = $.Deferred();
  17508. if (!f.tags.enabled)
  17509. return e.resolve();
  17510. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17511. t = "data/" + this.sid + "/tags.json"
  17512. return a.get(t, {
  17513. responseType: "json",
  17514. auth: this.isPublic ? null : f.authorizationHeader
  17515. }).done(function(t) {
  17516. var i = 0
  17517. , n = 0;
  17518. for (var r in t) {
  17519. var o = t[r];
  17520. o.enabled && (n++,
  17521. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17522. i++))
  17523. }
  17524. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17525. e.resolve()
  17526. }
  17527. .bind(this)).fail(function() {
  17528. O.warn("Getting tags failed, not displaying tags."),
  17529. e.resolve()
  17530. }),
  17531. e
  17532. } */
  17533. n.prototype.shineHots = function(){ //xzw
  17534. E.trigger({
  17535. func: function(e) {
  17536. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17537. for(var i in this.hots){
  17538. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17539. }
  17540. }.bind(this),
  17541. cycling: true,
  17542. duration: 3000,
  17543. //easing: "easeInOutQuad",
  17544. name: "hotShine"
  17545. })
  17546. },
  17547. /* n.prototype.createHotItem = function() {
  17548. // console.log(99999,this.hotGroup.children)
  17549. this.hotGroup.children.forEach((hot,index)=>{
  17550. // console.log(99999,index,hot.info.title)
  17551. if(hot.info.actionType.openHot){
  17552. let ul = document.createElement('ul');
  17553. let li = document.createElement('li');
  17554. let span = document.createElement('span');
  17555. span.innerHTML = hot.info.title || '热点';
  17556. // console.log(span.innerHTML);
  17557. li.hot = hot; // 列表每一项对应一个热点
  17558. li.appendChild(span);
  17559. ul.appendChild(li);
  17560. // docFragment.appendChild(li);
  17561. }
  17562. })
  17563. }
  17564. */
  17565. /* n.prototype.loadOverlays = function(overlays){
  17566. var overlays = window.data2 && window.data2.overlays
  17567. overlays && overlays.forEach((info)=>{
  17568. new Overlay(info)
  17569. })
  17570. Overlay.load()
  17571. }
  17572. */
  17573. n.prototype.loadhots = function() {//xzw
  17574. initHot(this)
  17575. var r = $.Deferred();
  17576. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17577. return a.get(t, {
  17578. responseType: "json",
  17579. auth: this.isPublic ? null : f.authorizationHeader
  17580. }).done(function(e) {
  17581. // 更换热点图片地址
  17582. // const tempArr =['1262']
  17583. // if(tempArr.includes(this.sid)) {
  17584. // console.log('-------------111',e);
  17585. // }
  17586. window.data2 = e;
  17587. this.roomLabels = []
  17588. if(!e){
  17589. console.error("data2 is null")
  17590. }else{
  17591. g_data2 = hotMatcher(e);
  17592. this.hotsCount = 0;
  17593. let create = ()=>{
  17594. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17595. if(e.hots){
  17596. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17597. sids.forEach((sid)=>{
  17598. e.hots[sid].sid = sid
  17599. if(e.hots[sid].texType == 'shine'){
  17600. e.hots[sid].texType = "photo"
  17601. e.hots[sid].texSrc = "https://super.4dage.com/data/KJ-t-tHpdpKvb0ew/edit/20250221_123045407.png?"
  17602. e.hots[sid].animateInfo = {
  17603. "duration": 2000,
  17604. "cellXcount": 48,
  17605. "cellYcount": 1,
  17606. "loop": true,
  17607. "voidCount": 0
  17608. }
  17609. }
  17610. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17611. })
  17612. }
  17613. if(e.overlays){
  17614. e.overlays.forEach((info)=>{
  17615. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17616. new Hot(info, 'byOverlay')
  17617. })
  17618. }
  17619. Hot.createHotList();
  17620. Hot.startLoad()
  17621. {
  17622. let maxCount = browser.isMobile() ? 200000 : 400000
  17623. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17624. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17625. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17626. if(c > maxCount){ //防止加载时间过长,分批计算
  17627. console.log('hot分批setVisiblePanos')
  17628. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17629. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17630. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17631. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17632. if(noVisiHots.length){
  17633. let i = 0
  17634. let hotVisiInterval = setInterval(()=>{
  17635. noVisiHots[i].setVisiblePanos();
  17636. i++;
  17637. if(i>=noVisiHots.length){
  17638. clearInterval(hotVisiInterval)
  17639. }
  17640. }, dur)
  17641. }
  17642. }
  17643. }
  17644. if(DATA.roomLabels){
  17645. DATA.roomLabels.forEach((data)=>{
  17646. this.roomLabels.push(new RoomLabel(data))
  17647. })
  17648. }
  17649. }
  17650. if(player.currentPano){
  17651. create()
  17652. }else{
  17653. let f = ()=>{
  17654. window.bus.removeEventListener('playerAndModelReady',f)
  17655. create()
  17656. }
  17657. window.bus.addEventListener('playerAndModelReady',f)
  17658. }
  17659. g_index = w.valueFromHash("m");
  17660. }
  17661. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17662. /* var dataJsPromise = $.Deferred();
  17663. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17664. a.get(dataJsUrl,{
  17665. responseType: "json",
  17666. auth: this.isPublic ? null : f.authorizationHeader
  17667. }).done(function(data) {
  17668. window.hotData = data;
  17669. this.createHotItem(data, this.hots);
  17670. for(let i in this.hots){//add
  17671. data[i] && this.hots[i].initStyleImg(data[i]);
  17672. }
  17673. dataJsPromise.resolve();
  17674. }.bind(this)).fail(function(){
  17675. console.log('Data.js is empty');
  17676. dataJsPromise.resolve();
  17677. }) */
  17678. r.resolve();
  17679. }.bind(this)).fail(function() {
  17680. console.log('没有热点');
  17681. r.resolve()
  17682. }),
  17683. r
  17684. }
  17685. ,
  17686. n.prototype.loadPanos = function() {
  17687. if (this.loadPanosPromise)
  17688. return this.loadPanosPromise;
  17689. var e = new I(this);
  17690. return this.loadPanosPromise = e.load().then(function(e) {
  17691. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17692. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17693. else console.log(e.uuid)
  17694. }
  17695. .bind(this))),
  17696. this.panos.extend(e.map(function(e) {
  17697. return new v(this,e.uuid,e,this.supportsTiles)
  17698. }
  17699. .bind(this))),
  17700. this.panos.forEach(function(e) {
  17701. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17702. var i = this.panos.get(t);
  17703. i && this.panos.setNeighbour(e, i, !0)
  17704. }
  17705. .bind(this)),
  17706. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17707. }
  17708. .bind(this)),
  17709. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17710. this.supportedModes[c.PANORAMA] = !1),
  17711. $.when(this)
  17712. }
  17713. .bind(this)),
  17714. this.loadPanosPromise
  17715. }
  17716. ,
  17717. n.prototype.loadHighlightReel = function() {//xzw
  17718. var e = $.Deferred()
  17719. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17720. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17721. return a.get(t, {
  17722. responseType: "json",
  17723. auth: this.isPublic ? null : f.authorizationHeader
  17724. }).done(function(t) {
  17725. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17726. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17727. e.resolve()
  17728. }
  17729. .bind(this)).fail(function() {
  17730. O.warn("Getting highlight reel failed, no highlights available"),
  17731. e.resolve()
  17732. }),
  17733. e
  17734. }
  17735. ,
  17736. n.prototype.waitForLoad = function(e, t) {
  17737. t() || (this.waitQueue.push({
  17738. object: e,
  17739. isLoadedCallback: t
  17740. }),
  17741. 1 === this.waitQueue.length && this.emit("waiting"))
  17742. }
  17743. ,
  17744. n.prototype.hide = function() {
  17745. this.floors.hide()
  17746. }
  17747. ,
  17748. n.prototype.show = function() {
  17749. this.floors.show()
  17750. }
  17751. ,
  17752. n.prototype.floorNames = function() {
  17753. return this.floors.names()
  17754. }
  17755. ,
  17756. n.prototype.warpDestFloors = function(e, t) {
  17757. if (!e || this.floors.length !== e.length)
  17758. return void this.toggleAllFloors(!0);
  17759. var i = e.findIndex(function(e) {
  17760. return e
  17761. }
  17762. .bind(this));
  17763. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17764. }
  17765. ,
  17766. n.prototype.setFloor = function(e, t, i) {
  17767. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17768. this.allFloorsVisible = !1,
  17769. this._setFloor(e, t, i)
  17770. }
  17771. ,
  17772. n.prototype.toggleAllFloors = function(e) {
  17773. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17774. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17775. this._setFloor(this.currentFloor)
  17776. }
  17777. ,
  17778. n.prototype._setFloor = function(e, t, i) {
  17779. t = t || this.mode,
  17780. this.emit("floor.changed", e, t, this.currentFloor),
  17781. this.currentFloor = e;
  17782. var n;
  17783. if (t === c.PANORAMA) {
  17784. if (this.show(),
  17785. this.shouldShowtags && this.tagsShown)
  17786. for (n in this.tags)
  17787. this.tags[n].show(f.showFloorDuration)
  17788. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17789. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17790. }
  17791. .bind(this)),
  17792. this.shouldShowtags && this.tagsShown))
  17793. for (n in this.tags) {
  17794. var r = this.tags[n];
  17795. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17796. }
  17797. var o = this
  17798. , a = e;
  17799. E.start(function() {}, f.showFloorDelay, function() {
  17800. o.floors.forEach(function(e) {
  17801. e.chunks.forEach(function(t) {
  17802. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17803. })
  17804. })
  17805. }
  17806. .bind(this))
  17807. }
  17808. ,
  17809. n.prototype.toggleExplode = function() {
  17810. this.floors.toggleExplodeHorizontal()
  17811. }
  17812. ,
  17813. n.prototype.toggleExplodeUp = function() {
  17814. this.floors.toggleExplodeVertical()
  17815. }
  17816. ,
  17817. n.prototype.nextFloor = function(e) {
  17818. return this.floors.nextFloor(this.currentFloor, e)
  17819. }
  17820. ,
  17821. n.prototype.addFloor = function(e) {
  17822. this.floors.add(e)
  17823. }
  17824. ,
  17825. n.prototype.getFloorAtPoint = function(e) {
  17826. return this.floors.getFloorAtPoint(e)
  17827. }
  17828. ,
  17829. n.prototype.getTagBySid = function(e) {
  17830. return this.tags[e]
  17831. }
  17832. ,
  17833. n.prototype.addChunk = function(e, t) {
  17834. this.floors.getOrMakeFloor(e).addChunk(t),
  17835. this.chunks.push(t)
  17836. }
  17837. ,
  17838. n.prototype.setMode = function(e) {
  17839. if (!this.supportedModes[e])
  17840. throw new R("Mode not supported for this model: " + e);
  17841. this.mode = e;
  17842. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17843. this.chunks.forEach(function(t) {
  17844. t.setMode(e)
  17845. })
  17846. }
  17847. ,
  17848. n.prototype.build = function() {
  17849. this.heroLocations = this.images.getHeroLocations(this.panos);
  17850. //重点展位:
  17851. let index = this.heroLocations.findIndex(e=>e.name == '沉浸看展')
  17852. this.heroLocations2 = this.heroLocations.splice(0,index) //提取沉浸看展之前的
  17853. var e = function() {
  17854. 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()
  17855. }
  17856. .bind(this)();
  17857. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17858. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17859. }
  17860. .bind(this)) || e,
  17861. null === this.heroImage && O.warn("No hero image defined."),
  17862. this.currentFloor = this.floors.last(),
  17863. this.floors.build(),
  17864. this.colliders = this.floors.reduce(function(e, t) {
  17865. return e.concat(t.collider.children)
  17866. }, []),
  17867. this.panos.forEach(function(e) {
  17868. e.build1(),
  17869. e.on("enter", function() {
  17870. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17871. }
  17872. .bind(this))
  17873. }
  17874. .bind(this))
  17875. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17876. let time1 = performance.now()
  17877. let downVec = new THREE.Vector3(0,-1,0)
  17878. this.panos.forEach((pano)=>{
  17879. player.raycaster.set(pano.position, downVec);
  17880. let collider = pano.floor.collider.children
  17881. let n = player.raycaster.intersectObjects(collider , true );//add true
  17882. if(n && n[0]){
  17883. if(n[0].point.y - pano.floorPosition.y > 0.03){
  17884. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17885. pano.originFloorY = pano.floorPosition.y
  17886. pano.floorPosition.y = n[0].point.y
  17887. }
  17888. }
  17889. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17890. })
  17891. let time2 = performance.now()
  17892. console.log('探测时间',time2-time1)
  17893. this.panos.forEach(function(e) {
  17894. e.build2()
  17895. }),
  17896. this.floors.forEach(function(e) {
  17897. this.boundingBox.union(e.boundingBox)
  17898. }
  17899. .bind(this)),
  17900. this.size = this.boundingBox.size(),
  17901. this.center = this.boundingBox.center(),
  17902. this.floors.forEach(function(e) {
  17903. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17904. }
  17905. .bind(this)),
  17906. this.panos.populate_path_graph(),
  17907. this.skybox = new l(this.boundingBox),
  17908. this.skybox.matrixWorldNeedsUpdate = !0,
  17909. this.add(this.skybox);
  17910. /* setTimeout(function() {
  17911. //this.hotsCount && this.shineHots()
  17912. Hot.beginShineHot()
  17913. }
  17914. .bind(this), 1300) */
  17915. this.createFloorLogo()
  17916. return O.debug("Done building model"),
  17917. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17918. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17919. this.buildRooms(),
  17920. this.labels.associateWithRooms(this.rooms),
  17921. $.when(this)
  17922. }
  17923. ,
  17924. n.prototype.createFloorLogo = function(){
  17925. console.log('createFloorLogo')
  17926. if(this.floorLogos || !settings.floorlogoURL)return;
  17927. var url = settings.floorlogoURL
  17928. var map = tex.load(url);//可以追加done
  17929. this.floorLogos = [];
  17930. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17931. var material = new o.MeshBasicMaterial({
  17932. opacity:0,
  17933. map:map,
  17934. side: o.DoubleSide,
  17935. transparent: !0,
  17936. depthWrite: !1,
  17937. depthTest:false//改 在chunk\skybox外也可看到
  17938. });
  17939. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17940. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17941. //logo.scale.set(s,s,s);
  17942. logo.position.set(0,-1.5,0);
  17943. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17944. logo.renderOrder = 100;//cover the videoSkybox
  17945. //logo.layers.set(0)
  17946. this.add(logo);
  17947. this.floorLogos.push(logo);
  17948. }
  17949. this.floorLogos[1].visible = false;
  17950. }
  17951. n.prototype.adjustfloorLogoHeight = function(o){
  17952. var h = player.currentPano.floorPosition.y + 0.01;
  17953. this.floorLogos[1].position.setY(h);
  17954. this.floorLogos[0].position.setY(h);
  17955. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17956. },
  17957. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17958. if(!this.floorLogos) return;
  17959. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17960. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17961. if(!o.dur){//立刻
  17962. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17963. this.floorLogos[o.index].material.opacity = o.opa;
  17964. }else{
  17965. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17966. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17967. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17968. }
  17969. },
  17970. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17971. var lastQ, lastP;
  17972. var equals = function(v1, v2, min){
  17973. return Math.abs(v1-v2) < min
  17974. }
  17975. var isSame = function(now, last, k){//如果和上次相同就不改变
  17976. if(!last)return false;
  17977. var R = k.sceneRenderer;
  17978. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17979. //暂时:
  17980. var min = 0.0008
  17981. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17982. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17983. return same;
  17984. }
  17985. return function(Q, k){
  17986. if(!Q)return;
  17987. /* if(Config.ifFish && window.lowFPS){
  17988. this.fLCompute++;
  17989. if(R.AFPS < 38){
  17990. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17991. else if(k.flying && k.fLCompute%2 !=1) return;
  17992. k.fLCompute %= 4;
  17993. }else if(R.AFPS < 45){
  17994. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17995. else if(k.flying && k.fLCompute%2 !=1) return;
  17996. k.fLCompute %= 6;
  17997. }else{
  17998. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17999. //else if(k.flying && k.fLCompute%2 !=1) return;
  18000. k.fLCompute %= 2;
  18001. }
  18002. } */
  18003. var sameQ, sameP, quaternion, visible;
  18004. for(var i=0;i<2;i++){
  18005. var logo = this.floorLogos[i];
  18006. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18007. visible = true;
  18008. }
  18009. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18010. var c = k.cameraControls.activeControl;
  18011. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18012. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18013. for(var i=0;i<2;i++){
  18014. var logo = this.floorLogos[i];
  18015. if(!sameQ){
  18016. if(!quaternion){
  18017. var a = new THREE.Vector3(0,0,-1);
  18018. a.applyQuaternion(Q);
  18019. a.setY(0);
  18020. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18021. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18022. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18023. quaternion.multiply(a);
  18024. }
  18025. logo.quaternion.copy(quaternion);
  18026. }
  18027. }
  18028. }
  18029. }()
  18030. n.prototype.loadLabels = function() {//xzw
  18031. this.labels = new x(this);
  18032. var e = $.Deferred();
  18033. //加载俯视图的标签 注释这个备注就会加载
  18034. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18035. window.DATA.showingLabels ? this.showingLabels = true : '';
  18036. if (!this.showingLabels)
  18037. return e.resolve();
  18038. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18039. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18040. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18041. O.warn("Getting labels failed, not displaying labels."),
  18042. e.resolve()
  18043. }),
  18044. e
  18045. }
  18046. ,
  18047. n.prototype.buildRooms = function() {
  18048. this.rooms = new T(this),
  18049. this.rooms.createFromChunks(this.chunks),
  18050. this.rooms.calcRoomBoundaries()
  18051. }
  18052. ,
  18053. n.prototype.updateProjectedPanos = function() {
  18054. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18055. }
  18056. ,
  18057. n.prototype.setProjectedPanos = function(e, t, i) {
  18058. void 0 !== i && null !== i || (i = !0),
  18059. i = !!i,
  18060. this.projectedPano0 = e,
  18061. this.projectedPano1 = t,
  18062. this.skybox.material.setProjectedPanos(e, t, i),
  18063. this.chunks.forEach(function(n) {
  18064. n.materialInside.setProjectedPanos(e, t, i)
  18065. })
  18066. }
  18067. ,
  18068. n.prototype.setSide = function(e) {
  18069. this.floors.forEach(function(t) {
  18070. t.collider.material.side = e
  18071. })
  18072. }
  18073. ,
  18074. n.prototype.heroCount = function() {
  18075. return this.heroLocations ? this.heroLocations.length : 0
  18076. }
  18077. ,
  18078. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18079. if (e[0] < 0)
  18080. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18081. null;
  18082. if (this.heroCount() < 1)
  18083. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18084. null;
  18085. var t = this.heroLocations[e[0]];
  18086. if(t.heroLocations && e[1]!=void 0){
  18087. t = t.heroLocations[e[1]];
  18088. }
  18089. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18090. null) : t
  18091. }
  18092. ,
  18093. n.prototype.findPanoramicHero = function() {
  18094. for (var e in this.heroLocations)
  18095. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18096. return this.heroLocations[e];
  18097. return null
  18098. }
  18099. ,
  18100. n.prototype.listImagePanos = function() {
  18101. var e = []
  18102. , t = this;
  18103. return this.images.forEach(function(i) {
  18104. if (i.metadata && i.metadata.scan_id) {
  18105. var n = t.panos.get(i.metadata.scan_id);
  18106. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18107. }
  18108. }),
  18109. e
  18110. }
  18111. ,
  18112. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  18113. //this.panos.fadeMarkerOpacity(e, t)
  18114. if(window.DATA.hideFloorMarker)return
  18115. var currentPano = player.currentPano
  18116. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18117. var hideWhenFlyOut = () => {
  18118. var shows = [],
  18119. hides = []
  18120. player.model.panos.forEach(pano => {
  18121. hides.push(pano)
  18122. })
  18123. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18124. }
  18125. if (opacity == 0) {
  18126. hideWhenFlyOut()
  18127. } else {
  18128. if (player.mode == 'panorama' && currentPano) {
  18129. var shows = [], hides = []
  18130. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  18131. if (currentPano.neighbourPanos[pano.id]) {
  18132. shows.push(pano)
  18133. } else {
  18134. hides.push(pano)
  18135. }
  18136. })
  18137. this.panos.fadeMarkerOpacity(opacity, dur, [
  18138. { toOp: opacity, member: shows },
  18139. { toOp: 0, member: hides },
  18140. ])
  18141. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18142. //飞出后marker隐藏
  18143. hideWhenFlyOut()
  18144. }
  18145. }
  18146. }
  18147. ,
  18148. n.prototype.setSweepVisibility = function(e) {
  18149. this.panos.forEach(function(t) {
  18150. t.marker && (t.marker.visible = e)
  18151. })
  18152. }
  18153. ,
  18154. n.prototype.outsideAllowed = function() {
  18155. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18156. }
  18157. ,
  18158. n.prototype.addHighMapCube = function() {
  18159. //创建8*8的tile cube
  18160. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18161. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18162. var cube = new THREE.Object3D()
  18163. cube.tiles = []
  18164. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18165. var face = new THREE.Object3D()
  18166. for (var i = 0; i < 8; i++) {
  18167. for (var j = 0; j < 8; j++) {
  18168. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18169. tile.position.set(i - 3.5, j - 3.5, -4)
  18170. if (highMapAddColor) {
  18171. tile.material.opacity = 0.4
  18172. var colorHue = Math.random()
  18173. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18174. }
  18175. tile.material.transparent = true
  18176. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18177. tile.visible = false
  18178. tile.tileX = i
  18179. tile.tileY = j
  18180. tile.cubeFace = cubeIndex
  18181. tile.renderOrder = 2//RenderOrder.highTileCube
  18182. cube.tiles.push(tile)
  18183. face.add(tile)
  18184. }
  18185. }
  18186. switch (cubeIndex) {
  18187. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18188. face.rotation.set(0, Math.PI / 2, 0)
  18189. break
  18190. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18191. face.rotation.set(0, -Math.PI / 2, 0)
  18192. break
  18193. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18194. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18195. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18196. face.quaternion.copy(rot1).multiply(rot2)
  18197. //face.rotation.set(Math.PI/2,0,0);
  18198. break
  18199. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18200. //face.rotation.set(-Math.PI/2,0,0);
  18201. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18202. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18203. face.quaternion.copy(rot1).multiply(rot2)
  18204. break
  18205. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18206. face.rotation.set(0, Math.PI, 0)
  18207. break
  18208. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18209. face.rotation.set(0, 0, 0)
  18210. }
  18211. face.scale.set(1, -1, 1)
  18212. cube.add(face)
  18213. }
  18214. cube.name = 'highMapCube'
  18215. this.highMapCube = cube
  18216. this.add(cube)
  18217. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18218. this.highMapCube.visible = false
  18219. this.highMapCube.texLoadedCount = 0
  18220. player.once("pano.chosen",()=>{//wait sceneRenderer
  18221. player.sceneRenderer.on('after-render', e => {
  18222. if (this.highMapCube.visibleTiles) {
  18223. this.updateTiles()
  18224. }
  18225. if (player && player.lastFrameChanged) {
  18226. common.intervalTool.isWaiting(
  18227. 'update4kTiles',
  18228. () => {
  18229. let vectorForward = player.getDirection()
  18230. this.updateTiles(vectorForward)
  18231. },
  18232. 500
  18233. )
  18234. }
  18235. })
  18236. })
  18237. }
  18238. }
  18239. /*
  18240. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18241. */
  18242. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  18243. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18244. return !!tile.material.map
  18245. }
  18246. n.prototype.updateTiles = function(direction) {
  18247. if (!this.highMapCube || !this.highMapCube.visible) return
  18248. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18249. //performance.mark('updateTiles-start')
  18250. if (direction) {
  18251. let camera = player.cameraControls.cameras.panorama
  18252. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  18253. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18254. /* let hcos = Math.cos(hfov / 2)
  18255. let vcos = Math.cos(vfov / 2) */
  18256. let list = this.highMapCube.tiles
  18257. list.forEach(e => {
  18258. //屏幕外的不显示
  18259. let pos = e.getWorldPosition(new THREE.Vector3())
  18260. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18261. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18262. let hRad = Math.acos(hcos_)
  18263. let vRad = -200
  18264. if (hRad > hfov + 0.08) {
  18265. e.score = -100
  18266. } else {
  18267. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18268. if (vRad > vfov + 0.08) {
  18269. e.score = -100
  18270. } else {
  18271. e.score = -(hRad / hfov + vRad / vfov)
  18272. }
  18273. }
  18274. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18275. if (e.score == -100) {
  18276. this.resetTile(e)
  18277. }
  18278. })
  18279. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18280. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18281. }
  18282. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18283. if (needRecover.length) {
  18284. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18285. let count = 0
  18286. needRecover.forEach((e, i) => {
  18287. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18288. if (count >= maxCount) return
  18289. let r = this.recoverTile(e)
  18290. if (r) count++
  18291. })
  18292. }
  18293. }
  18294. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18295. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18296. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18297. tile.image = image //先记录下来
  18298. }
  18299. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18300. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18301. if (image) tile.image = image //先记录下来
  18302. if (tile.material.map) return
  18303. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) ) {
  18304. return
  18305. }
  18306. //简易创建贴图
  18307. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18308. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18309. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18310. */
  18311. var tex = new THREE.Texture()
  18312. tex.image = image
  18313. tex.flipY = false
  18314. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18315. tex.generateMipmaps = false
  18316. tex.minFilter = THREE.LinearFilter
  18317. tex.needsUpdate = true
  18318. tile.material.map = tex
  18319. if (highMapAddColor) {
  18320. tile.material.opacity = 1
  18321. }
  18322. tile.visible = true
  18323. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18324. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18325. }
  18326. n.prototype.recoverTile = function(tile) {
  18327. if (tile.material.map) return
  18328. if (tile.image) {
  18329. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18330. return true
  18331. } else {
  18332. //console.log('no image')
  18333. }
  18334. }
  18335. n.prototype.resetTile = function(tile, kill) {
  18336. if (kill) {
  18337. //完全消灭
  18338. tile.image = null
  18339. }
  18340. let map = tile.material.map
  18341. if (map) {
  18342. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18343. map.loaded = !1
  18344. map.version = 0
  18345. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18346. var h = player.sceneRenderer.renderer.properties.get(map)
  18347. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18348. tile.material.map = null
  18349. if (highMapAddColor) {
  18350. tile.material.opacity = 0.4
  18351. }
  18352. tile.material.needsUpdate = true
  18353. tile.visible = false
  18354. //this.highMapCube.texLoadedCount --
  18355. //console.log('resetTile' , tile.cubeFace, tile.tileX, tile.tileY )
  18356. }
  18357. }
  18358. n.prototype.resetHighMap = function() {
  18359. if (!this.highMapCube) return
  18360. this.highMapCube.children.forEach(e =>
  18361. e.children.forEach(tile => {
  18362. this.resetTile(tile, true)
  18363. })
  18364. )
  18365. //this.highMapCube.texLoadedCount = 0
  18366. this.highMapCube.visibleTiles = null
  18367. this.hideHighMap()
  18368. }
  18369. n.prototype.setHighMap = function(pano) {
  18370. if (!this.highMapCube) return
  18371. this.highMapCube.position.copy(pano.position)
  18372. this.highMapCube.quaternion.copy(pano.quaternion)
  18373. }
  18374. n.prototype.showHighMap = function() {
  18375. if (!this.highMapCube) return
  18376. this.highMapCube.visible = true
  18377. this.dispatchEvent({type:'highMapCubeShow',state:true})
  18378. }
  18379. n.prototype.hideHighMap = function() {
  18380. if (!this.highMapCube) return
  18381. this.highMapCube.visible = false
  18382. this.dispatchEvent({type:'highMapCubeShow',state:false})
  18383. }
  18384. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18385. t.exports = n
  18386. }
  18387. ).call(this, "/js/model/Model.js")
  18388. }
  18389. , {
  18390. "../constants": 8,
  18391. "../enum/AlignmentType": 17,
  18392. "../enum/RenderOrder": 42,
  18393. "../enum/Viewmode": 51,
  18394. "../exception/BasicException": 55,
  18395. "../label/Label": 90,
  18396. "../loaders/ModelLoader": 105,
  18397. "../loaders/ModelTextureLoader": 106,
  18398. "../loaders/SweepDataLoader": 107,
  18399. "../tag/tag": 123,
  18400. "./util/cameraLight": 184,
  18401. "../tag/tagManager": 124,
  18402. "../objects/BoundingTextureSkybox": 143,
  18403. "../objects/Chunk": 144,
  18404. "../objects/Floor": 146,
  18405. "../objects/Panorama": 148,
  18406. "../objects/Room": 150,
  18407. "../objects/Snapshot": 153,
  18408. "../settings": 166,
  18409. "../shaders": 167,
  18410. "../util/ModelUrls": 177,
  18411. "../util/PanoramaCollection": 178,
  18412. "../util/ajax": 181,
  18413. "../util/common": 185,
  18414. "../util/easing": 186,
  18415. "../util/lerp": 188,
  18416. "../util/logger": 189,
  18417. "../util/math": 190,
  18418. "../util/texture": 194,
  18419. "../util/transitions": 195,
  18420. "./../util/browser": 182,
  18421. "./../util/showcase": 193,
  18422. "./Chunks": 135,
  18423. "./FloorCollection": 136,
  18424. "./ImageCollection": 137,
  18425. "./LabelCollection": 138,
  18426. "./RoomCollection": 141,
  18427. events: 202,
  18428. three: 217,
  18429. "hot": "hot" ,
  18430. "../enum/GLCubeFaces":25 ,
  18431. }],
  18432. 140: [function(e, t, i) {
  18433. "use strict";
  18434. function n() {
  18435. this.modelMap = {},
  18436. this.activeModel = null,
  18437. this.modelCount = 0,
  18438. this.tileDownloader = null,
  18439. this.panoRenderer = null
  18440. }
  18441. var r = (e("three"),
  18442. e("../util/common"))
  18443. , o = e("../exception/BasicException")
  18444. , a = e("../enum/ModelManagerEvents")
  18445. , s = e("../enum/PanoRendererEvents")
  18446. , l = e("events").EventEmitter;
  18447. n.prototype.init = function(e, t, i) {
  18448. this.tileDownloader = e,
  18449. this.panoRenderer = t,
  18450. this.qualityManager = i,
  18451. this.bindEvents()
  18452. }
  18453. ,
  18454. n.prototype.bindEvents = function() {
  18455. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18456. }
  18457. ,
  18458. n.prototype.onTileRendered = function(e, t, i, n) {}
  18459. ,
  18460. n.prototype.addModel = function(e) {
  18461. this.modelMap[e.sid] = e,
  18462. 0 === this.modelCount && this.activateModel(e.sid),
  18463. this.modelCount++,
  18464. this.emit(a.ModelAdded)
  18465. }
  18466. ,
  18467. n.prototype.getModel = function(e) {
  18468. return this.modelMap[e]
  18469. }
  18470. ,
  18471. n.prototype.activateModel = function(e) {
  18472. var t = this.modelMap[e];
  18473. if (!t)
  18474. throw new o("Tried to activate invalid model!");
  18475. var i = this.activeModel;
  18476. this.activeModel = t,
  18477. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18478. this.tileDownloader.setUrls(t.urls),
  18479. t.panos.forEach(function(e) {
  18480. e.attachToPanoRenderer(this.panoRenderer),
  18481. e.tileDownloader = this.tileDownloader,
  18482. e.qualityManager = this.qualityManager
  18483. }
  18484. .bind(this)),
  18485. this.emit(a.ActiveModelChanged, {
  18486. oldModel: i,
  18487. model: t
  18488. })
  18489. }
  18490. ,
  18491. n.prototype.getActiveModel = function() {
  18492. return this.activeModel
  18493. }
  18494. ,
  18495. r.extend(n, l),
  18496. t.exports = n
  18497. }
  18498. , {
  18499. "../enum/ModelManagerEvents": 33,
  18500. "../enum/PanoRendererEvents": 35,
  18501. "../exception/BasicException": 55,
  18502. "../util/common": 185,
  18503. events: 202,
  18504. three: 217
  18505. }],
  18506. 141: [function(e, t, i) {
  18507. (function(i) {
  18508. "use strict";
  18509. function n() {
  18510. s.call(this)
  18511. }
  18512. var r = e("../objects/Room")
  18513. , o = (e("../settings"),
  18514. e("../util/logger"))
  18515. , a = (e("../util/transitions"),
  18516. e("../util/easing"),
  18517. e("../util/common"))
  18518. , s = e("../util/IndexedCollection")
  18519. , l = e("./Chunks");
  18520. new o(i);
  18521. a.inherit(n, s),
  18522. n.prototype.getIndex = function(e) {
  18523. return e.roomId
  18524. }
  18525. ,
  18526. n.prototype.calcRoomBoundaries = function() {
  18527. this.forEach(function(e) {
  18528. e.calcBoundaries()
  18529. })
  18530. }
  18531. ,
  18532. n.prototype.createFromChunks = function(e) {
  18533. var t = {
  18534. floorId: -1,
  18535. roomId: -1
  18536. }
  18537. , i = {};
  18538. e.forEach(function(e) {
  18539. l.parseIdsFromChunkName(e.name, t);
  18540. var o = i[t.roomId];
  18541. if (!o) {
  18542. var a = n.generateRoomId(t.floorId, t.roomId);
  18543. o = new r(t.floorId,a),
  18544. this.add(o),
  18545. i[t.roomId] = o
  18546. }
  18547. o.addChunk(e)
  18548. }
  18549. .bind(this)),
  18550. this.calcRoomBoundaries()
  18551. }
  18552. ,
  18553. n.generateRoomId = function(e, t) {
  18554. return e + "_" + t
  18555. }
  18556. ,
  18557. t.exports = n
  18558. }
  18559. ).call(this, "/js/model/RoomCollection.js")
  18560. }
  18561. , {
  18562. "../objects/Room": 150,
  18563. "../settings": 166,
  18564. "../util/IndexedCollection": 175,
  18565. "../util/common": 185,
  18566. "../util/easing": 186,
  18567. "../util/logger": 189,
  18568. "../util/transitions": 195,
  18569. "./Chunks": 135
  18570. }],
  18571. 142: [function(e, t, i) {
  18572. "use strict";
  18573. function n(e, t, i) {
  18574. e = e.clone().expandByScalar(0.01);//改
  18575. var n = e.size()
  18576. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18577. o.boundingBox = e,
  18578. r.Mesh.call(this, o, t),
  18579. this.position.copy(e.center()),
  18580. this.frustumCulled = !1,
  18581. i && this.add(new r.WireframeHelper(this))
  18582. }
  18583. var r = e("three");
  18584. n.prototype = Object.create(r.Mesh.prototype),
  18585. n.prototype.constructor = n,
  18586. t.exports = n
  18587. }
  18588. , {
  18589. three: 217
  18590. }],
  18591. 143: [function(e, t, i) {
  18592. (function(i) {
  18593. "use strict";
  18594. function n(e) {
  18595. h.time("Computing a nice bounding cubemap");
  18596. var t = new a({
  18597. side: r.BackSide,
  18598. transparent: !0
  18599. });
  18600. t.uniforms.modelAlpha.value = 0,
  18601. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18602. this.renderOrder = l.boundingSkybox,
  18603. o.call(this, e, t),
  18604. h.timeEnd("Computing a nice bounding cubemap")
  18605. }
  18606. var r = e("three")
  18607. , o = (e("../enum/Viewmode"),
  18608. e("../shaders"),
  18609. e("./BoundingMesh"))
  18610. , a = e("../materials/ModelTextureMaterial")
  18611. , s = e("../settings")
  18612. , l = e("../enum/RenderOrder")
  18613. , c = e("../util/logger")
  18614. , h = new c(i);
  18615. n.prototype = Object.create(o.prototype),
  18616. n.prototype.constructor = n,
  18617. t.exports = n
  18618. }
  18619. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18620. }
  18621. , {
  18622. "../enum/RenderOrder": 42,
  18623. "../enum/Viewmode": 51,
  18624. "../materials/ModelTextureMaterial": 118,
  18625. "../settings": 166,
  18626. "../shaders": 167,
  18627. "../util/logger": 189,
  18628. "./BoundingMesh": 142,
  18629. three: 217
  18630. }],
  18631. 144: [function(e, t, i) {
  18632. "use strict";
  18633. function n(e) {
  18634. this.materialInside = new s({
  18635. side: r.DoubleSide
  18636. });
  18637. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18638. this.materialOutside = new r.RawShaderMaterial({
  18639. fragmentShader: o.modelOutside.fragmentShader,
  18640. vertexShader: o.modelOutside.vertexShader,
  18641. uniforms: t,
  18642. side: r.FrontSide,
  18643. name: "chunkOut"
  18644. }),
  18645. r.Mesh.call(this, e.geometry, this.materialInside),
  18646. this.name = e.name || "",
  18647. this.textureName = e.textureName,
  18648. this.meshUrl = e.meshUrl
  18649. }
  18650. var r = e("three")
  18651. , o = e("../shaders")
  18652. , a = e("../enum/Viewmode")
  18653. , s = e("../materials/ModelTextureMaterial");
  18654. n.prototype = Object.create(r.Mesh.prototype),
  18655. n.prototype.setTextureMap = function(e) {
  18656. this.materialInside.uniforms.map.value = e,
  18657. this.materialOutside.uniforms.map.value = e
  18658. }
  18659. ,
  18660. n.prototype.setMode = function(e) {
  18661. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18662. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18663. t.transparent = this.material.transparent,
  18664. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18665. this.material = t
  18666. }
  18667. ,
  18668. t.exports = n
  18669. }
  18670. , {
  18671. "../enum/Viewmode": 51,
  18672. "../materials/ModelTextureMaterial": 118,
  18673. "../shaders": 167,
  18674. three: 217
  18675. }],
  18676. 145: [function(e, t, i) {
  18677. "use strict";
  18678. function n(e) {
  18679. this.chunksize = e || 10,
  18680. this.chunks = {},
  18681. this.boundingBoxes = {},
  18682. this.children = [],
  18683. this.offset = new r.Vector3(0,.5,0),
  18684. this.material = new r.MeshBasicMaterial({
  18685. color: 16777215 * Math.random(),
  18686. side: r.DoubleSide
  18687. })
  18688. }
  18689. var r = e("three");
  18690. e("../enum/Viewmode");
  18691. n.prototype.add = function(e) {
  18692. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18693. m ? (t = m.position.array,
  18694. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18695. n = e.faces);
  18696. var v = new r.Vector3;
  18697. if (i)
  18698. for (o = 0,
  18699. a = i.length; o < a; o += 3) {
  18700. var A = 3 * i[o]
  18701. , y = 3 * i[o + 1]
  18702. , C = 3 * i[o + 2];
  18703. s = (t[A] + t[y] + t[C]) / 3,
  18704. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18705. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18706. h = Math.floor(s / this.chunksize),
  18707. u = Math.floor(l / this.chunksize),
  18708. d = Math.floor(c / this.chunksize),
  18709. p = h + "." + u + "." + d,
  18710. p in this.chunks ? (g = this.chunks[p],
  18711. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18712. f = this.boundingBoxes[p] = new r.Box3),
  18713. 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]),
  18714. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18715. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18716. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18717. }
  18718. else
  18719. for (o = 0,
  18720. a = t.length; o < a; o += 9)
  18721. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18722. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18723. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18724. h = Math.floor(s / this.chunksize),
  18725. u = Math.floor(l / this.chunksize),
  18726. d = Math.floor(c / this.chunksize),
  18727. p = h + "." + u + "." + d,
  18728. p in this.chunks ? (g = this.chunks[p],
  18729. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18730. f = this.boundingBoxes[p] = new r.Box3),
  18731. 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]),
  18732. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18733. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18734. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18735. }
  18736. ,
  18737. n.prototype.build = function() {
  18738. var e = new r.Object3D;
  18739. e.material = this.material;
  18740. for (var t in this.chunks) {
  18741. var i = this.chunks[t]
  18742. , n = new r.BufferGeometry;
  18743. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18744. n.boundingBox = this.boundingBoxes[t];
  18745. var o = new r.Mesh(n,this.material);
  18746. o.material.visible = !1,
  18747. e.add(o),
  18748. this.chunks[t] = []
  18749. }
  18750. return e
  18751. }
  18752. ,
  18753. t.exports = n
  18754. }
  18755. , {
  18756. "../enum/Viewmode": 51,
  18757. three: 217
  18758. }],
  18759. 146: [function(e, t, i) {
  18760. "use strict";
  18761. var r = e("three")
  18762. , o = e("../settings")
  18763. , a = e("../util/common")
  18764. , s = e("../util/lerp")
  18765. , l = e("./ChunkedCollider")
  18766. , c = e("../util/transitions")
  18767. , h = e("../util/easing")
  18768. , u = (e("../objects/Panorama"),
  18769. e("../enum/RenderOrder"))
  18770. , d = e("../localization/localize");
  18771. function n(e, t, i) {
  18772. r.Object3D.call(this),
  18773. this.model = e,
  18774. this.floorIndex = t,
  18775. this.lang = o.languageTag,
  18776. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18777. this.panos = [],
  18778. this.chunks = [],
  18779. this.colliderBuilder = new l(3),
  18780. this.collider = null,
  18781. this.center = null,
  18782. this.boundingBox = new r.Box3,
  18783. this.size = null,
  18784. this.hidden = !1,
  18785. this.conservativeBoundingBox = new r.Box3,
  18786. this.debugColor = 16777215 * Math.random(),
  18787. this.transition = null
  18788. }
  18789. n.prototype = Object.create(r.Object3D.prototype),
  18790. n.prototype.constructor = n, //add
  18791. n.prototype.enter = function(e) {
  18792. this.model.setFloor(this, e)
  18793. }
  18794. ,
  18795. n.prototype.hide = function(e) {
  18796. if (!this.hidden || this.transition) {
  18797. this.chunks.forEach(function(e) {
  18798. e.material.transparent = !0
  18799. }),
  18800. c.cancel(this.transition);
  18801. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18802. , i = e ? 0 : o.hideFloorDelay / t;
  18803. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18804. this.hidden = !0
  18805. }
  18806. .bind(this), i, h.easeInOutQuad)
  18807. }
  18808. }
  18809. ,
  18810. n.prototype.show = function(e) {
  18811. if (this.hidden || this.transition) {
  18812. this.hidden = !1,
  18813. c.cancel(this.transition);
  18814. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18815. , i = e ? 0 : o.showFloorDelay / t;
  18816. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18817. this.hidden || this.chunks.forEach(function(e) {
  18818. e.material.transparent = !1
  18819. })
  18820. }
  18821. .bind(this), i, h.easeInOutQuad)
  18822. }
  18823. }
  18824. ,
  18825. n.prototype.toggle = function(e, t) {
  18826. e = void 0 === e ? this.hidden : e,
  18827. e ? this.show(t) : this.hide(t)
  18828. }
  18829. ,
  18830. n.prototype.containsPoint = function(e) {
  18831. return this.collider.children.some(function(t) {
  18832. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18833. t.geometry.boundingBox.containsPoint(e)
  18834. })
  18835. }
  18836. ,
  18837. n.prototype.distanceToPoint = function(e) {
  18838. var t = null
  18839. , i = 1 / 0;
  18840. return this.collider.children.forEach(function(n) {
  18841. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18842. var r = n.geometry.boundingBox.distanceToPoint(e);
  18843. (!t || i > r) && (i = r,
  18844. t = n)
  18845. }),
  18846. i
  18847. }
  18848. ,
  18849. n.prototype.addChunk = function(e) {
  18850. e.renderOrder = u.ghostFloor,
  18851. this.add(e),
  18852. this.chunks.push(e),
  18853. this.boundingBox.union(e.geometry.boundingBox),
  18854. this.size = this.boundingBox.size(),
  18855. this.colliderBuilder.add(e.geometry)
  18856. }
  18857. ,
  18858. n.prototype.addPano = function(e) {
  18859. this.panos.push(e),
  18860. this.add(e.skyboxMesh),
  18861. e.marker && this.add(e.marker);
  18862. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18863. var t = new r.Vector3(1,1,1)
  18864. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18865. this.boundingBox.union(i)
  18866. }
  18867. }
  18868. ,
  18869. n.prototype.build = function() {
  18870. this.collider = this.colliderBuilder.build(!0),
  18871. this.add(this.collider),
  18872. this.center = this.boundingBox.center(),
  18873. this.conservativeBoundingBox.copy(this.boundingBox),
  18874. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18875. return e.geometry.boundingBox.min.y
  18876. }), 5),
  18877. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18878. return e.geometry.boundingBox.max.y
  18879. }), 5)
  18880. if(!settings.extractFloor || !settings.extractFloor[window.number]){
  18881. this.colliderBuilder = null
  18882. }
  18883. }
  18884. ,
  18885. n.prototype.toShortString = function() {
  18886. return a.nth(this.floorIndex + 1)
  18887. }
  18888. ,
  18889. n.prototype.toString = function() {
  18890. return this.name
  18891. }
  18892. ,
  18893. t.exports = n
  18894. }
  18895. , {
  18896. "../enum/RenderOrder": 42,
  18897. "../localization/localize": 108,
  18898. "./strings-cn-CN": 109,
  18899. "../objects/Panorama": 148,
  18900. "../settings": 166,
  18901. "../util/common": 185,
  18902. "../util/easing": 186,
  18903. "../util/lerp": 188,
  18904. "../util/transitions": 195,
  18905. "./ChunkedCollider": 145,
  18906. three: 217
  18907. }],
  18908. 147: [function(e, t, i) {
  18909. "use strict";
  18910. function n(e) {
  18911. this.player = e,
  18912. this.obj3d = null,
  18913. this.UP = new r.Vector3(0,1,0)
  18914. }
  18915. var r = e("three")
  18916. , o = e("../settings");
  18917. n.prototype.prefs = {
  18918. linewidth: 3,
  18919. height: .07,
  18920. opacity: .45,
  18921. endScale: .05
  18922. },
  18923. n.prototype.discard = function() {
  18924. if (this.obj3d) {
  18925. var e = this.obj3d.parent;
  18926. e && e.remove(this.obj3d)
  18927. }
  18928. this.obj3d = null
  18929. }
  18930. ,
  18931. n.prototype.draw = function() {
  18932. if (this.discard(),
  18933. o.showNeighbors) {
  18934. var e = this.player.currentPano.floor;
  18935. this.obj3d = new r.Object3D;
  18936. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18937. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18938. i.y += this.prefs.height;
  18939. var n = .1525
  18940. , a = .127
  18941. , s = .0127
  18942. , l = .1
  18943. , c = .19
  18944. , h = .2032
  18945. , u = .2286
  18946. , d = .255
  18947. , p = new r.Matrix4;
  18948. for (var f in t)
  18949. if (t[f]) {
  18950. var g = this.player.model.panos.get(f)
  18951. , m = (g.position.clone().sub(this.player.model.position),
  18952. g.position.clone().sub(g.floorPosition))
  18953. , v = g.floorPosition.clone().sub(this.player.model.position);
  18954. v.y += this.prefs.height;
  18955. var A = new r.Geometry;
  18956. 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)),
  18957. 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)),
  18958. p.identity().setPosition(m),
  18959. A.applyMatrix(p),
  18960. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18961. 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)),
  18962. p.lookAt(v, i, this.UP).setPosition(v),
  18963. A.applyMatrix(p),
  18964. A.vertices.push(v, i);
  18965. var y = new r.Line(A,new r.LineBasicMaterial({
  18966. color: g.debugColor.getHex(),
  18967. transparent: !0,
  18968. opacity: this.prefs.opacity,
  18969. depthWrite: !1,
  18970. name: "sLine" + f,
  18971. linewidth: this.prefs.linewidth
  18972. }));
  18973. this.obj3d.add(y)
  18974. }
  18975. e.add(this.obj3d)
  18976. }
  18977. }
  18978. ,
  18979. n.prototype.update = function() {
  18980. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18981. }
  18982. ,
  18983. t.exports = n
  18984. }
  18985. , {
  18986. "../settings": 166,
  18987. three: 217
  18988. }],
  18989. 148: [function(e, t, i) {
  18990. (function(i) {
  18991. "use strict";
  18992. function n(e, t, i, n) {
  18993. this.model = e,
  18994. this.id = t,
  18995. this.alignmentType = i.alignmentType || l.ALIGNED,
  18996. this.neighbourUUIDs = i.neighbours || null,
  18997. this.neighbourPanos = null,
  18998. this.floor = null,
  18999. this.floorIndex = i.floor,
  19000. this.failedLoadingAt = 0,
  19001. this.maxLoadRetries = 4,
  19002. this.origin = i.position.clone(),
  19003. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  19004. this.quaternion = i.quaternion.clone(),
  19005. this.skyboxMesh = new r.Mesh(E),
  19006. this.skyboxMesh.position.copy(this.position),
  19007. this.skyboxMesh.quaternion.copy(this.quaternion),
  19008. this.skyboxMesh.name = "skybox",
  19009. this.skyboxMesh.visible = !1,
  19010. this.skyboxMesh.updateMatrix(),
  19011. this.skyboxMesh.updateMatrixWorld(),
  19012. this.marker = null,
  19013. this.showFloorMarker = !window.DATA.hideFloorMarker;
  19014. if(this.isAligned() ){
  19015. this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19016. map: w,
  19017. side: r.DoubleSide,
  19018. opacity: 0,
  19019. transparent: !0,
  19020. depthWrite: !1
  19021. })),
  19022. this.marker.visible = false //改:先不显示,之后根据opacity显示
  19023. this.marker.renderOrder = s.panoMarker,
  19024. this.marker.name = "marker",
  19025. this.marker.pano = this,
  19026. this.marker.layers.set(v.PANOMARKERS),
  19027. this.marker.updateMatrixWorld()
  19028. if(!window.DATA.hideFloorMarker){//xzw
  19029. let opa = this.marker.material.opacity
  19030. Object.defineProperty(this.marker.material, 'opacity', {
  19031. get: function () {
  19032. return opa
  19033. },
  19034. set: (o)=>{
  19035. opa = o
  19036. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  19037. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  19038. //console.log(o,this.id,this.marker.visible)
  19039. },
  19040. })
  19041. }
  19042. a.colorMarkerOnLoad && this.on("load", function() {
  19043. this.marker.material.color.set(65280)
  19044. })
  19045. }
  19046. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19047. this.floorPosition = i.puck ? i.puck.clone() : null,
  19048. this.tiled = n,
  19049. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19050. this.solidSkybox.flipY = !1,
  19051. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19052. this.solidSkybox.magFilter = r.LinearFilter,
  19053. this.solidSkybox.generateMipmaps = !1)),
  19054. this.zoomed = !1,
  19055. this.panoRenderer = null,
  19056. this.qualityManager = null,
  19057. this.tileDownloader = null,
  19058. this.tiledPanoRenderTarget = null,
  19059. this.minimumTiledPanoLoaded = !1,
  19060. this.highestPartialTileRenderOpCompleted = 0,
  19061. this.highestFullTileRenderOpCompleted = 0,
  19062. this.shouldRedrawOnBaseLoaded = !1,
  19063. this.lockUntilRenderingComplete = !1,
  19064. a.colorMarkerOnLoad && this.on("load", function() {
  19065. this.marker.material.color.set(65280)
  19066. });
  19067. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19068. var e = new r.TextureLoader;
  19069. e.setCrossOrigin(!0);
  19070. var g = e.load("static/images/texture.jpg");
  19071. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19072. color: 16777215,
  19073. transparent: !0,
  19074. opacity: .75,
  19075. map: g
  19076. })),
  19077. this.vrMarker.boluoType = "vr",
  19078. this.vrMarker.position.z = 1,
  19079. this.vrMarker.enabled = !0,
  19080. this.vrMarker.visible = !1,
  19081. window.vrMarkers = window.vrMarkers || [],
  19082. window.vrMarkers.push(this.vrMarker),
  19083. this.marker && this.marker.add(this.vrMarker),
  19084. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19085. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19086. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19087. this.adjustAngleEnable) {
  19088. var i = new r.Quaternion;
  19089. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19090. this.skyboxMesh.quaternion.multiply(i);
  19091. var m = new r.Quaternion;
  19092. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19093. this.skyboxMesh.quaternion.multiply(m);
  19094. var n = new r.Quaternion;
  19095. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19096. this.skyboxMesh.quaternion.multiply(n),
  19097. this.skyboxMesh.updateMatrix(),
  19098. this.skyboxMesh.updateMatrixWorld(),
  19099. this.model.updateProjectedPanos()
  19100. }
  19101. /**************************************************************************************************************************************/
  19102. }
  19103. var r = e("three")
  19104. , o = e("../util/logger")
  19105. , a = e("../settings")
  19106. , s = (e("../enum/Viewmode"),
  19107. e("../enum/RenderOrder"))
  19108. , l = e("../enum/AlignmentType")
  19109. , c = (e("../util/common"),
  19110. e("../util/transitions"))
  19111. , h = e("../util/lerp")
  19112. , u = e("../util/ajax")
  19113. , d = e("../util/texture")
  19114. , p = e("../util/panorama")
  19115. , f = (e("../enum/TileDownloaderEvents"),
  19116. e("../enum/PanoramaEvents"))
  19117. , g = e("../enum/PanoRendererEvents")
  19118. , m = e("../enum/PanoSizeClass")
  19119. , v = e("../enum/RenderLayers")
  19120. , A = (e("../scene/SceneRenderer"),
  19121. e("../enum/GLCubeFaces"),
  19122. e("../exception/BasicException"))
  19123. , y = e("../tile/TileUtils")
  19124. , C = e("events").EventEmitter
  19125. , I = new o(i)
  19126. , E = new r.SphereBufferGeometry(.1)
  19127. , b = new r.PlaneBufferGeometry(.35,.35,1,1)
  19128. , w = d.load("static/images/marker-256x256.png");
  19129. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19130. n.prototype = Object.create(C.prototype),
  19131. n.prototype.enter = function() {
  19132. var e = null;
  19133. return function() {
  19134. this.setZoomed(!1),
  19135. this.emit("enter", {
  19136. oldPano: e,
  19137. newPano: this
  19138. }),
  19139. e = this
  19140. this.model.setHighMap(this) //add
  19141. }
  19142. }(),
  19143. n.prototype.exit = function() {
  19144. this.tiled ? (this.clearWaitDeferreds(),
  19145. this.minimumTiledPanoLoaded = !1,
  19146. this.tiledPanoRenderTarget = null,
  19147. this.setZoomed(!1),
  19148. this.panoRenderer.deactivateTiledPano(this),
  19149. this.highestPartialTileRenderOpCompleted = 0,
  19150. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19151. this.solidSkybox.loaded = !1,
  19152. this.solidSkybox.version = 0),
  19153. this.emit("exit")
  19154. }
  19155. ,
  19156. n.prototype.hoverOn = function(e) {
  19157. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19158. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19159. }
  19160. ,
  19161. n.prototype.hoverOff = function(e) {
  19162. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19163. }
  19164. ,
  19165. n.prototype.build1 = function() {
  19166. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position),
  19167. this.floor.addPano(this),
  19168. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19169. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19170. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19171. }
  19172. ,
  19173. n.prototype.build2 = function() {
  19174. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19175. this.height = this.position.distanceTo(this.floorPosition),
  19176. this.placeMarker()
  19177. }
  19178. ,
  19179. n.prototype.interpolateFloorPosition = function() {
  19180. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19181. return !!e.floorPosition
  19182. }).sort(function(e, t) {
  19183. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19184. }
  19185. .bind(this))
  19186. , t = this.position.clone();
  19187. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19188. t
  19189. }
  19190. ,
  19191. n.prototype.raycastFloorPosition = function() {
  19192. I.warn("Performance warning: Raycasting to find floor position");
  19193. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19194. , t = e.intersectObjects(this.model.colliders);
  19195. return t.length ? t[0].point : null
  19196. }
  19197. ,
  19198. n.prototype.raycastToFindFloor = function() {
  19199. 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)];
  19200. return function() {
  19201. I.warn("Performance warning: Raycasting to find floor index");
  19202. for (var t = 0; t < e.length; t++) {
  19203. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19204. , n = i.intersectObjects(this.model.colliders);
  19205. if (n.length)
  19206. return n[0].object.parent.parent
  19207. }
  19208. return null
  19209. }
  19210. }(),
  19211. n.prototype.placeMarker = function() {
  19212. this.marker && (this.marker.position.copy(this.floorPosition),
  19213. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19214. this.marker.position.y += settings.markerHeight,
  19215. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19216. }
  19217. ,
  19218. n.prototype.translate = function(e) {
  19219. this.position.add(e),
  19220. this.floorPosition.add(e)
  19221. }
  19222. ,
  19223. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19224. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19225. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19226. }
  19227. ,
  19228. n.prototype.attachToPanoRenderer = function(e) {
  19229. this.panoRenderer = e,
  19230. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19231. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19232. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19233. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19234. }
  19235. ;
  19236. var _ = {};
  19237. n.prototype.getWaitDeferred = function(e) {
  19238. var t = _[this.id];
  19239. t || (t = {},
  19240. _[this.id] = t);
  19241. var i = t[e];
  19242. return i || (i = {
  19243. deferred: $.Deferred(),
  19244. active: !1
  19245. },
  19246. t[e] = i),
  19247. i
  19248. }
  19249. ,
  19250. n.prototype.resetWaitDeferred = function(e) {
  19251. var t = this.getWaitDeferred(e);
  19252. t.active = !1,
  19253. t.deferred = $.Deferred()
  19254. }
  19255. ,
  19256. n.prototype.clearWaitDeferreds = function() {
  19257. var e = _[this.id];
  19258. e || (e = {},
  19259. _[this.id] = e);
  19260. for (var t in e)
  19261. if (e.hasOwnProperty(t)) {
  19262. var i = e[t];
  19263. i.active = !1,
  19264. i.deferred = $.Deferred()
  19265. }
  19266. }
  19267. ,
  19268. n.prototype.loadTiledPano = function() {
  19269. var e = (new r.Vector3,
  19270. [])
  19271. , t = [];
  19272. return function(i, n, r, o, a, s) {
  19273. null !== o && void 0 !== o || (o = !0),
  19274. null !== a && void 0 !== a || (a = !0);
  19275. var l = this.getWaitDeferred(i)
  19276. , c = l.deferred
  19277. , h = null
  19278. , u = null;
  19279. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19280. u = r.vFov)),
  19281. !this.isLoaded(i)) {
  19282. if (!l.active) {
  19283. if (l.active = !0,
  19284. r) {
  19285. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19286. e[this.id + ":" + i] = {
  19287. tileCount: 0,
  19288. targetTileCount: d
  19289. },
  19290. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19291. }
  19292. t[this.id] || (t[this.id] = !0,
  19293. this.on(f.LoadComplete, function(e, t) {
  19294. var i = this.getWaitDeferred(e).deferred;
  19295. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19296. this.resetWaitDeferred(e))
  19297. }
  19298. .bind(this)),
  19299. this.on(f.LoadFailed, function(e) {
  19300. var t = this.getWaitDeferred(e).deferred;
  19301. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19302. this.resetWaitDeferred(e))
  19303. }
  19304. .bind(this)),
  19305. this.on(f.TileLoaded, function(t, i, n) {
  19306. var r = this.getWaitDeferred(t).deferred;
  19307. if (r && "pending" === r.state()) {
  19308. r.notify(t, i, n);
  19309. var o = e[this.id + ":" + t];
  19310. o && (o.tileCount++,
  19311. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19312. r.resolve(t, n),
  19313. this.resetWaitDeferred(t)))
  19314. }
  19315. }
  19316. .bind(this)))
  19317. }
  19318. this.tileDownloader.clearForceQueue(),
  19319. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19320. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19321. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19322. }
  19323. return c.promise()
  19324. }
  19325. }(),
  19326. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19327. if (e === this.id) {
  19328. var n = this.qualityManager.getPanoSize(m.BASE);
  19329. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19330. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19331. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19332. }
  19333. }
  19334. ,
  19335. n.prototype.onTileRendered = function(e, t, i, n) {
  19336. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19337. }
  19338. ,
  19339. n.prototype.onPanoRendered = function(e, t, i, n) {
  19340. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19341. this.updateSkyboxForZoomLevel(),
  19342. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19343. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19344. this.emit("load", t),
  19345. this.model.emit("load", this),
  19346. this.emit(f.LoadComplete, t, i))
  19347. }
  19348. ,
  19349. n.prototype.setZoomed = function(e) {
  19350. this.zoomed = e,
  19351. this.updateSkyboxForZoomLevel()
  19352. if(e){ //add
  19353. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19354. this.model.showHighMap()
  19355. }
  19356. }else{
  19357. this.model.hideHighMap()
  19358. }
  19359. }
  19360. ,
  19361. n.prototype.ensureSkyboxReadyForRender = function() {
  19362. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19363. this.solidSkybox.loaded = !0)
  19364. }
  19365. ,
  19366. n.prototype.updateSkyboxForZoomLevel = function() {
  19367. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19368. }
  19369. ,
  19370. n.prototype.getSkyboxTexture = function() {
  19371. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19372. if(!this.tiled){
  19373. return this.solidSkybox
  19374. }
  19375. if(this.minimumTiledPanoLoaded)
  19376. {
  19377. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19378. {
  19379. return this.panoRenderer.zoomRenderTarget.texture;
  19380. }
  19381. else
  19382. {
  19383. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19384. return this.tiledPanoRenderTarget.texture;
  19385. }
  19386. }
  19387. else
  19388. {
  19389. return null;
  19390. }
  19391. }
  19392. ,
  19393. n.prototype.onTileRenderFail = function(e, t, i) {
  19394. e === this.id && this.emit(f.LoadFailed, t)
  19395. }
  19396. ,
  19397. n.prototype.isLoaded = function(e) {
  19398. if (this.tiled) {
  19399. if (e && "string" == typeof e)
  19400. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19401. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19402. }
  19403. if (e && "number" == typeof e)
  19404. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19405. return !!this.solidSkybox.high || e in this.solidSkybox
  19406. }
  19407. ,
  19408. n.prototype.loadCube = function(e) {
  19409. if (this.isLoaded(e))
  19410. return I.info("Skipping load of pano, already loaded"),
  19411. $.when();
  19412. this.emit("loading", e),
  19413. this.model.emit("loading", this);
  19414. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19415. , i = t.filter(function(e) {
  19416. return !e
  19417. });
  19418. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19419. e = "high",
  19420. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19421. var n = 0
  19422. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19423. return u.getImage(t[i])
  19424. }
  19425. .bind(this));
  19426. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19427. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19428. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19429. this.solidSkybox.low = null),
  19430. this.solidSkybox.needsUpdate = !0,
  19431. this.emit("load", e),
  19432. this.model.emit("load", this),
  19433. this
  19434. }
  19435. .bind(this), function() {
  19436. I.error("Downloading cubemap for pano", this.id, "failed"),
  19437. this.failedLoadingAt = Date.now()
  19438. }
  19439. .bind(this), function() {
  19440. return $.when(++n, 6)
  19441. })
  19442. }
  19443. ,
  19444. n.raycastsSkipped = 0,
  19445. n.raycastsDone = 0,
  19446. n.prototype.findNeighourPanos = function() {
  19447. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19448. this.model.panos.forEach(function(e) {
  19449. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19450. var t = this.position.distanceTo(e.position);
  19451. if (t > a.panoramaNeighbourMaxDistance)
  19452. return this.model.panos.setNeighbour(this, e, !1),
  19453. void n.raycastsSkipped++;
  19454. var i = e.position.clone().sub(this.position).normalize()
  19455. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19456. , s = o.intersectObjects(this.model.colliders);
  19457. n.raycastsDone++,
  19458. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19459. 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)))
  19460. }
  19461. }
  19462. .bind(this)),
  19463. this.model.panos.neighbourMap[this.id]
  19464. }
  19465. ,
  19466. n.prototype.worldPosition = function() {
  19467. return this.position
  19468. }
  19469. ,
  19470. n.prototype.addLabel = function() {
  19471. this.removeLabel()
  19472. this.label = new TextSprite({
  19473. sizeInfo: {
  19474. minSize: 100,
  19475. maxSize: 200,
  19476. nearBound: 0.7,
  19477. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19478. farBoundPlan: 100,
  19479. },
  19480. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19481. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19482. borderRadius: 15,
  19483. renderOrder: 5,
  19484. text: this.id //`${this.id}-f${this.floorIndex}`
  19485. })
  19486. let position = this.floorPosition.clone()
  19487. position.y += 0.2
  19488. this.label.position.copy(position)
  19489. this.floor.add(this.label)
  19490. },
  19491. n.prototype.removeLabel = function() {
  19492. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19493. },
  19494. /* n.prototype.addTextSprite = function(e, t) {
  19495. this.removeTextSprite();
  19496. var i = document.createElement("canvas")
  19497. , n = i.getContext("2d");
  19498. i.width = 256,
  19499. i.height = 256;
  19500. var o = "Arial"
  19501. , a = 60;
  19502. n.font = "bold " + a + "px " + o,
  19503. n.fillStyle = "white";
  19504. var s = n.measureText(e).width;
  19505. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19506. var l = new r.Texture(i);
  19507. l.needsUpdate = !0;
  19508. var c = new r.SpriteMaterial({
  19509. map: l,
  19510. color: t || 16428055
  19511. });
  19512. this.text3d = new r.Sprite(c),
  19513. this.text3d.position.copy(this.skyboxMesh.position),
  19514. this.floor.add(this.text3d)
  19515. }
  19516. ,
  19517. n.prototype.removeTextSprite = function() {
  19518. this.text3d && (this.floor.remove(this.text3d),
  19519. this.text3d = null)
  19520. } */
  19521. n.prototype.isAligned = function() {
  19522. return this.alignmentType === l.ALIGNED
  19523. }
  19524. ,
  19525. n.filters = {
  19526. inDirection: function(e, t, i) {
  19527. return function(n) {
  19528. var r = n.position.clone().sub(e).normalize();
  19529. return r.dot(t) > i
  19530. }
  19531. },
  19532. inFloorDirection: function(e, t, i) {
  19533. return function(n) {
  19534. var r = n.floorPosition.clone().sub(e).normalize();
  19535. return r.dot(t) > i
  19536. }
  19537. },
  19538. inPanoDirection: function(e, t, i) {
  19539. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19540. function(n) {
  19541. var r = n.floorPosition.clone().sub(e).normalize()
  19542. , o = n.position.clone().sub(e).normalize();
  19543. return r.dot(t) > i || o.dot(t) > i
  19544. }
  19545. },
  19546. atFloor: function(e) {
  19547. return function(t) {
  19548. return !e || t.floor === e
  19549. }
  19550. },
  19551. not: function(e) {
  19552. return function(t) {
  19553. return t !== e
  19554. }
  19555. },
  19556. notIn: function(e) {
  19557. return function(t) {
  19558. return e.indexOf(t) === -1
  19559. }
  19560. },
  19561. isLoaded: function() {
  19562. return function(e) {
  19563. return e.isLoaded()
  19564. }
  19565. },
  19566. isNotLoaded: function() {
  19567. return function(e) {
  19568. return !e.isLoaded()
  19569. }
  19570. },
  19571. isCloseEnoughTo: function(e, t) {
  19572. return function(i) {
  19573. return e.distanceTo(i.floorPosition) < t
  19574. }
  19575. },
  19576. hasMinimumHeightDifferenceTo: function(e, t) {
  19577. return function(i) {
  19578. return Math.abs(i.position.y - e.y) > t
  19579. }
  19580. },
  19581. isNotBehindNormal: function(e, t) {
  19582. var i = new r.Vector3;
  19583. return t = t.clone(),
  19584. function(n) {
  19585. var r = i.copy(n.position).sub(e).normalize();
  19586. return r.dot(t) > 0
  19587. }
  19588. },
  19589. isNeighbourPanoTo: function(e) {
  19590. return function(t) {
  19591. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19592. }
  19593. },
  19594. isNeighbourOfNeighbourTo: function(e) {
  19595. return function(t) {
  19596. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19597. var n = e.model.panos.get(i);
  19598. return !!n && n.neighbourPanos[t.id]
  19599. })
  19600. }
  19601. },
  19602. isNotRecentlyFailed: function(e) {
  19603. return function(t) {
  19604. return Date.now() - t.failedLoadingAt > e
  19605. }
  19606. },
  19607. isOnVisibleFloor: function() {
  19608. return function(e) {
  19609. return !e.floor.hidden
  19610. }
  19611. },
  19612. isPanoAligned: function() {
  19613. return function(e) {
  19614. return e.isAligned()
  19615. }
  19616. }
  19617. },
  19618. n.sortFunctions = {
  19619. distanceToPoint: function(e) {
  19620. return function(t, i) {
  19621. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19622. }
  19623. },
  19624. floorDistanceToPoint: function(e) {
  19625. return function(t, i) {
  19626. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19627. }
  19628. },
  19629. choose: function(e) {
  19630. return function(t, i) {
  19631. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19632. }
  19633. }
  19634. },
  19635. n.scoreFunctions = {
  19636. distance: function(e, t) {
  19637. return t = t || a.navigation.distanceFactor,
  19638. function(i) {
  19639. return e ? e.position.distanceTo(i.position) * t : 0
  19640. }
  19641. },
  19642. distanceSquared: function(e, t) {
  19643. return t = t || a.navigation.distanceFactor,
  19644. function(i) {
  19645. return e ? e.position.distanceToSquared(i.position) * t : 0
  19646. }
  19647. },
  19648. direction: function(e, t) {
  19649. return function(i) {
  19650. var n = i.position.clone().sub(e).normalize();
  19651. return n.dot(t) * a.navigation.directionFactor
  19652. }
  19653. },
  19654. angle: function(e, t) {
  19655. return function(i) {
  19656. var n = i.position.clone().sub(e).normalize();
  19657. return n.angleTo(t) * a.navigation.angleFactor
  19658. }
  19659. },
  19660. inFieldOfView: function(e, t) {
  19661. return function(i) {
  19662. var n = i.position.clone().sub(e).normalize();
  19663. return n.dot(t) > .75 ? 10 : -1
  19664. }
  19665. },
  19666. optionality: function(e) {
  19667. return function(t) {
  19668. var i = t.neighbourUUIDs.filter(function(t) {
  19669. return !(t in e.neighbourUUIDs) && t !== e.id
  19670. });
  19671. return i.length * a.navigation.optionalityFactor
  19672. }
  19673. },
  19674. penalizeHeightDifferenceUnder: function(e, t) {
  19675. return function(i) {
  19676. return e.y - i.position.y < t ? -20 : 0
  19677. }
  19678. }
  19679. },
  19680. t.exports = n
  19681. }
  19682. ).call(this, "/js/objects/Panorama.js")
  19683. }
  19684. , {
  19685. "../enum/AlignmentType": 17,
  19686. "../enum/GLCubeFaces": 25,
  19687. "../enum/PanoRendererEvents": 35,
  19688. "../enum/PanoSizeClass": 36,
  19689. "../enum/PanoramaEvents": 37,
  19690. "../enum/RenderLayers": 41,
  19691. "../enum/RenderOrder": 42,
  19692. "../enum/TileDownloaderEvents": 45,
  19693. "../enum/Viewmode": 51,
  19694. "../exception/BasicException": 55,
  19695. "../scene/SceneRenderer": 158,
  19696. "../settings": 166,
  19697. "../tile/TileUtils": 174,
  19698. "../util/ajax": 181,
  19699. "../util/common": 185,
  19700. "../util/lerp": 188,
  19701. "../util/logger": 189,
  19702. "../util/panorama": 191,
  19703. "../util/texture": 194,
  19704. "../util/transitions": 195,
  19705. events: 202,
  19706. three: 217
  19707. }],
  19708. 149: [function(e, t, i) {
  19709. "use strict";
  19710. function n(e) {
  19711. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19712. t.map.value = d,
  19713. t.opacity.value = 0,
  19714. t.color.value.set(o.reticuleColor),
  19715. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19716. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19717. side: r.DoubleSide,
  19718. depthWrite: !1,
  19719. depthTest: !1,
  19720. transparent: !0,
  19721. vertexShader: c.waypoint.vertexShader,
  19722. fragmentShader: c.waypoint.fragmentShader,
  19723. uniforms: t,
  19724. name: "waypoint",
  19725. opacity: 0,
  19726. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19727. })),
  19728. this.layers.set(h.RETICULE),
  19729. this.renderOrder = u.reticule,
  19730. this.player = e,
  19731. this.direction = new r.Vector3,
  19732. this.hidden = !0,
  19733. this.mouseLastMoveTime = Date.now()
  19734. }
  19735. var r = e("three")
  19736. , o = e("../settings")
  19737. , a = e("../util/transitions")
  19738. , s = e("../util/texture")
  19739. , l = e("../util/lerp")
  19740. , c = e("../shaders")
  19741. , h = e("../enum/RenderLayers")
  19742. , u = e("../enum/RenderOrder")
  19743. , d = s.load("static/images/reticule-256x256.png");
  19744. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19745. n.prototype = Object.create(r.Mesh.prototype),
  19746. n.prototype.move = function(e, t, i) {
  19747. this.hidden = i,
  19748. this.mouseLastMoveTime = Date.now()
  19749. }
  19750. ,
  19751. n.prototype.hide = function() {
  19752. this.hidden || (this.hidden = !0,
  19753. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19754. }
  19755. ,
  19756. n.prototype.show = function() {
  19757. this.hidden = !1,
  19758. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19759. }
  19760. ,
  19761. n.prototype.update = function() {
  19762. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19763. }
  19764. ,
  19765. n.prototype.updatePosition = function(e, t) {
  19766. if (!this.hidden) {
  19767. if (!t)
  19768. return this.hide();
  19769. var i = t.point
  19770. , n = e.distanceTo(i)
  19771. , r = 1 + .01 * n;
  19772. n < 1 && (r -= 1 - n),
  19773. this.show(),
  19774. this.scale.set(r, r, r),
  19775. this.direction = this.direction.multiplyScalar(.8),
  19776. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19777. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19778. this.lookAt(this.position.clone().add(this.direction))
  19779. }
  19780. }
  19781. ,
  19782. n.prototype.writeAstag = function() {
  19783. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19784. , t = new Date;
  19785. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19786. var i = {
  19787. enabled: !0,
  19788. version: "0",
  19789. created: t.toISOString(),
  19790. created_by: "APITest",
  19791. position: this.position.clone(),
  19792. stem: {
  19793. enabled: o.tags.pole.enabled,
  19794. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19795. },
  19796. label: "tag " + this.tagCount,
  19797. description: "Description " + e,
  19798. floor: function(e) {
  19799. if (e.currentFloor) {
  19800. var t = e.floors.indexOf(e.currentFloor);
  19801. return t > -1 ? t : void 0
  19802. }
  19803. }(this.player.model),
  19804. type: "info",
  19805. metadata: {
  19806. preferred_camera: {
  19807. mode: this.player.mode
  19808. }
  19809. }
  19810. };
  19811. console.log("--------------------------"),
  19812. console.log(JSON.stringify(i));
  19813. var n = this.player.model.addtag(e, i).build();
  19814. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19815. n.visible || n.show(o.tags.startup.fadeInDuration))
  19816. }
  19817. ,
  19818. t.exports = n
  19819. }
  19820. , {
  19821. "../enum/RenderLayers": 41,
  19822. "../enum/RenderOrder": 42,
  19823. "../settings": 166,
  19824. "../shaders": 167,
  19825. "../util/lerp": 188,
  19826. "../util/texture": 194,
  19827. "../util/transitions": 195,
  19828. three: 217
  19829. }],
  19830. 150: [function(e, t, i) {
  19831. "use strict";
  19832. function n(e, t) {
  19833. this.chunks = [],
  19834. this.floorId = e,
  19835. this.roomId = t,
  19836. this.position = new r.Vector3
  19837. }
  19838. var r = e("three");
  19839. n.prototype.addChunk = function(e) {
  19840. this.chunks.push(e)
  19841. }
  19842. ,
  19843. n.prototype.calcBoundaries = function() {
  19844. 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++) {
  19845. var s = this.chunks[a]
  19846. , l = s.geometry.attributes.position;
  19847. if (l)
  19848. for (var c = 0; c < l.array.length; c += 3)
  19849. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19850. t.add(e),
  19851. 0 === c ? (i.copy(e),
  19852. n.copy(e)) : (i.max(e),
  19853. n.min(e)),
  19854. o++
  19855. }
  19856. o > 0 ? (t.multiplyScalar(1 / o),
  19857. this.average = t) : this.average = null,
  19858. this.boundsMax = i,
  19859. this.boundsMin = n,
  19860. this.center = new r.Vector3,
  19861. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19862. }
  19863. ,
  19864. t.exports = n
  19865. }
  19866. , {
  19867. three: 217
  19868. }],
  19869. 151: [function(e, t, i) {
  19870. (function(i) {
  19871. "use strict";
  19872. function n(e, t, i) {
  19873. this.obj3d = null,
  19874. this.nodes = [],
  19875. this.colorHull = [],
  19876. this.shortPaths = {},
  19877. this.floorHull = null,
  19878. this.cameraHull = null,
  19879. this.floorPathDistance = 0,
  19880. this.floorCurvePoints = null,
  19881. this.floorCurveColors = null,
  19882. this.camCurvePoints = null,
  19883. this.warpDestHeroLoc = null,
  19884. this.warpDestPano = null,
  19885. this.warpPathPoints = null,
  19886. this.warpPathLengths = [0],
  19887. this.warpLength = 0,
  19888. this.closeWarpDistance = 4,
  19889. this.UP = A.UP.clone(),
  19890. this.longestStep = 0,
  19891. this.upcomingTransType = null,
  19892. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19893. this.prevNextDist = 0,
  19894. this.nextI = 0,
  19895. this.activeTransType = null,
  19896. this.lastTransType = null,
  19897. this.bunnyObj = null,
  19898. this.director = e,
  19899. this.player = t,
  19900. this.playerControls = i,
  19901. this.modelManager = t.modelManager,
  19902. this.updateModel(),
  19903. this.updateDefaultsFromModelData(),
  19904. this.bindEvents(),
  19905. this.warping = !1,
  19906. this.waitingToWarp = !1,
  19907. this.warpInterrupted = !1,
  19908. this.warpInterruptionBlackoutStyle = null,
  19909. this.warpInterruptionTravelTime = null
  19910. }
  19911. var r = e("three")
  19912. , o = e("../util/logger")
  19913. , a = e("../enum/Viewmode")
  19914. , s = e("../enum/RenderOrder")
  19915. , l = e("../enum/WarpStyle")
  19916. , c = e("../settings")
  19917. , h = e("../util/math")
  19918. , u = e("../util/lerp")
  19919. , d = e("../util/easing")
  19920. , p = e("../util/transitions")
  19921. , f = e("../objects/Snapshot")
  19922. , g = e("../effects")
  19923. , m = e("../shaders")
  19924. , v = (e("../gui/gui"),
  19925. e("../util/texture"))
  19926. , A = e("../enum/Vectors")
  19927. , y = (e("../model/ModelManager"),
  19928. new o(i))
  19929. , C = e("../enum/PlayerEvents")
  19930. , I = e("../enum/BlackoutStyle")
  19931. , E = e("../enum/ModelManagerEvents")
  19932. , b = e("../constants")
  19933. , w = {
  19934. 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"),
  19935. pathEnd: v.load("static/images/End.png"),
  19936. 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==")
  19937. };
  19938. n.prototype.setScene = function(e) {
  19939. this.createCpm(e),
  19940. this.createBunnyObj(e)
  19941. }
  19942. ,
  19943. n.prototype.updateModel = function() {
  19944. this.model = this.modelManager.getActiveModel()
  19945. }
  19946. ,
  19947. n.prototype.bindEvents = function() {
  19948. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19949. }
  19950. ,
  19951. n.prototype.updateDefaultsFromModelData = function() {
  19952. this.model.data
  19953. }
  19954. ,
  19955. n.prototype.pointPathDistance = function(e) {
  19956. for (var t = 0, i = 1; i < e.length; i += 1)
  19957. t += e[i - 1].distanceTo(e[i]);
  19958. return t
  19959. }
  19960. ,
  19961. n.prototype.pointPathLengths = function(e) {
  19962. for (var t = [0], i = 1; i < e.length; i += 1)
  19963. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19964. return t
  19965. }
  19966. ,
  19967. n.prototype.interpAlongPath = function(e, t, i) {
  19968. var n, o = new r.Vector3, a = t[t.length - 1];
  19969. if (i < 1) {
  19970. n = i * a;
  19971. for (var s = 1; s < t.length; s += 1)
  19972. if (t[s] > n) {
  19973. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19974. return o.copy(e[s]),
  19975. o.sub(e[s - 1]),
  19976. o.multiplyScalar(l),
  19977. o.add(e[s - 1]),
  19978. o
  19979. }
  19980. } else
  19981. o.copy(e[e.length - 1]);
  19982. return o
  19983. }
  19984. ,
  19985. n.prototype.pathHeight = function() {
  19986. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19987. }
  19988. ,
  19989. n.prototype.createBunnyObj = function(e) {
  19990. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19991. this.bunnyObj.visible = c.warp.showBunny),
  19992. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19993. e.add(this.bunnyObj)
  19994. }
  19995. ,
  19996. n.prototype.createCpm = function(e) {
  19997. if (!this.currentPanoMarker) {
  19998. /* var t = this.makeWaypointObj(w.pathEnd, "Current");
  19999. t.material.uniforms.opacity.value = 0, */
  20000. let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.6,0.6,1,1), new THREE.MeshBasicMaterial({
  20001. map: v.load('static/images/icon_address.png'), depthTest:false,
  20002. transparent:true,
  20003. }))
  20004. sprite.position.y = 0.3
  20005. let t = new THREE.Object3D()
  20006. t.add(sprite)
  20007. this.currentPanoMarker = {
  20008. mesh: t,
  20009. placed: !1
  20010. }
  20011. }
  20012. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20013. this.placeCpm(),
  20014. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20015. }
  20016. ,
  20017. n.prototype.placeCpm = function() {
  20018. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20019. var e = this.player.currentPano.floor;
  20020. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20021. e.add(this.currentPanoMarker.mesh)),
  20022. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20023. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  20024. this.currentPanoMarker.placed = !0
  20025. } else
  20026. this.popOutCpm()
  20027. }
  20028. ,
  20029. n.prototype.fadeInCpm = function(e) {
  20030. 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.children[0].material/* .uniforms.opacity */, "opacity", 1), e)
  20031. }
  20032. ,
  20033. n.prototype.fadeOutCpm = function(e) {
  20034. p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 0), e)
  20035. }
  20036. ,
  20037. n.prototype.popInCpm = function() {
  20038. return //xzw add 否则点击导览item会在底下显示红色标记
  20039. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20040. }
  20041. ,
  20042. n.prototype.popOutCpm = function() {
  20043. this.fadeOutCpm(2)
  20044. }
  20045. ,
  20046. n.prototype.brushPrefs = {
  20047. linewidth: 7,
  20048. strokeWidth: 15,
  20049. cvSegments: 48,
  20050. paveStep: .1,
  20051. paveWidth: .2,
  20052. lookBlendDist: 3,
  20053. maxTurn: r.Math.degToRad(2)
  20054. },
  20055. n.prototype.panoPathDistance = function(e) {
  20056. var t = this.model.panos;
  20057. if (!e || e.length < 2)
  20058. return 0;
  20059. for (var i = [], n = 0; n < e.length; n += 1)
  20060. i.push(t.get(e[n]).floorPosition);
  20061. return this.pointPathDistance(i)
  20062. }
  20063. ,
  20064. n.prototype.loadTileTexture = function(e) {
  20065. var t = v.load(e, function(t) {
  20066. t.wrapS = r.RepeatWrapping,
  20067. t.wrapT = r.RepeatWrapping,
  20068. t.needsUpdate = !0,
  20069. y.debug('path texture "' + e + '" is ready')
  20070. }, function() {
  20071. y.error('path texture "' + e + '" failed')
  20072. });
  20073. return t.mapping = r.UVMapping,
  20074. t
  20075. }
  20076. ,
  20077. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20078. var a = {
  20079. cameraMode: n,
  20080. position: e,
  20081. quaternion: t,
  20082. panoId: i,
  20083. orthoZoom: o,
  20084. floorVisibility: r,
  20085. thumbUrl: null,
  20086. name: null
  20087. };
  20088. return new f(a)
  20089. }
  20090. ,
  20091. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20092. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20093. }
  20094. ,
  20095. n.prototype.setWarpDestination = function(e) {
  20096. this.warpDestHeroLoc = e
  20097. }
  20098. ,
  20099. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20100. var t = this.getHeroDescriptorByHeroIndex(e);
  20101. return null !== t && (this.setWarpDestination(t),
  20102. !0)
  20103. }
  20104. ,
  20105. n.prototype.setWarpDestinationByPano = function(e, t) {
  20106. var i = this.model.panos.get(e.id);
  20107. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20108. }
  20109. ,
  20110. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20111. var i = this.model.panos.get(e);
  20112. if (i) {
  20113. t = t || new r.Quaternion;
  20114. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20115. return this.setWarpDestination(n),
  20116. !0
  20117. }
  20118. return !1
  20119. }
  20120. ,
  20121. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20122. var t = this.model.heroCount();
  20123. /* if (null !== this.warpDestHeroLoc && t < 2)
  20124. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20125. this.model.getHeroDescriptorByIndex(0); */
  20126. var i = this.model.getHeroDescriptorByIndex(e);
  20127. if (i) {
  20128. var n = i.isPano() ? i.panoId : i.cameraMode;
  20129. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20130. }
  20131. return i
  20132. }
  20133. ,
  20134. n.prototype.getHeroDescriptorByPano = function(e) {
  20135. var t = this.model.panos.get(e.id);
  20136. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20137. }
  20138. ,
  20139. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20140. var t = this.getHeroIndexFromPanoId(e);
  20141. return this.getHeroDescriptorByHeroIndex(t)
  20142. }
  20143. ,
  20144. n.prototype.getHeroIndexFromPanoId = function(e) {
  20145. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20146. var i = this.model.heroLocations[t]
  20147. , n = this.getHeroId(i);
  20148. if (n && n === e)
  20149. return t
  20150. }
  20151. return -1
  20152. }
  20153. ,
  20154. n.prototype.getHeroPano = function(e) {
  20155. if (null === e)
  20156. return y.warn("getHeroPano(): no destination"),
  20157. null;
  20158. var t = this.getHeroId(e)
  20159. , i = this.model.panos.get(t);
  20160. return void 0 === i && (i = null,
  20161. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20162. i
  20163. }
  20164. ,
  20165. n.prototype.getHeroId = function(e) {
  20166. return e.panoId
  20167. }
  20168. ,
  20169. n.prototype.setWarpDestPano = function() {
  20170. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20171. this.warpDestPano
  20172. }
  20173. ,
  20174. n.prototype.brushToWarpPano = function(e, t) {
  20175. if (this.discardPathObject(),
  20176. !this.setWarpDestPano())
  20177. return !1;
  20178. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20179. !this.warpDestPano)
  20180. return y.info("No brush"),
  20181. !1;
  20182. if (!this.player.currentPano)
  20183. return y.debug("No current pano, visibility undefined"),
  20184. !1;
  20185. if (!this.warpDestPano)
  20186. return y.info("No wPano, visibility undefined"),
  20187. !1;
  20188. if (!this.warpDestPano.isAligned())
  20189. return y.debug("Cannot brush to unaligned pano"),
  20190. !1;
  20191. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20192. , n = !0;
  20193. if (this.player.currentPano.id === this.warpDestPano.id)
  20194. y.debug("Already at destination pano");
  20195. else {
  20196. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20197. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20198. this.obj3d = new r.Object3D,
  20199. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20200. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20201. e = t) : (this.setPathHulls(this.nodes),
  20202. this.setFloorCurves(),
  20203. 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)))),
  20204. this.player.currentPano.floor.add(this.obj3d);
  20205. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20206. , s = e === l.STD;
  20207. if (!n && (i || s)) {
  20208. if (o) {
  20209. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20210. this.obj3d.add(h)
  20211. }
  20212. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20213. this.obj3d.add(u)
  20214. }
  20215. this.appearSlow()
  20216. }
  20217. return this.upcomingTransType = e,
  20218. !n
  20219. }
  20220. ,
  20221. n.prototype.findShortestPath = function(e, t) {
  20222. if (!e || !t)
  20223. return null;
  20224. var i = c.warp.walkExtraPanosDistance
  20225. , n = e.id + ":" + t.id + ":" + i;
  20226. if (this.shortPaths.hasOwnProperty(n))
  20227. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20228. var r = t.id + ":" + e.id + ":" + i;
  20229. if (this.shortPaths.hasOwnProperty(r))
  20230. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20231. var o = this.model.panos.aStarSearch(e, t);
  20232. return this.model.panos.includeNodesNearPath(o, i),
  20233. this.shortPaths[n] = o ? o.slice() : null,
  20234. o
  20235. }
  20236. ,
  20237. n.prototype.makePathHulls = function(e) {
  20238. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20239. t = u.get(e[0]),
  20240. r = t.floor.floorIndex;
  20241. for (var d = 0; d < e.length; d += 1)
  20242. t = u.get(e[d]),
  20243. i = t.floorPosition.clone().sub(this.model.position),
  20244. i.y += this.pathHeight(),
  20245. s.push(i),
  20246. l.push(t.position.clone()),
  20247. n = t.floor.floorIndex,
  20248. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20249. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20250. o > a && (a = o));
  20251. return a > this.longestStep && (this.longestStep = a,
  20252. y.debug("path contains " + a + " meter segment")),
  20253. {
  20254. floor: s,
  20255. camera: l,
  20256. color: h
  20257. }
  20258. }
  20259. ,
  20260. n.prototype.makeFloorCurves = function(e, t, i) {
  20261. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20262. , o = this.pointPathDistance(e) - 2 * n
  20263. , s = e.slice(0)
  20264. , l = s[1].clone().sub(s[0]);
  20265. l.y = 0,
  20266. l.normalize().multiplyScalar(n),
  20267. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20268. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20269. l.y = 0,
  20270. l.normalize().multiplyScalar(n),
  20271. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20272. var h = new r.CatmullRomCurve3(s)
  20273. , u = Math.floor(o / i);
  20274. u = 4 * Math.floor(u / 4),
  20275. u = Math.max(4, u);
  20276. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20277. f = 0,
  20278. d = g[A].distanceTo(e[0]);
  20279. for (var y = 1; y < e.length; y += 1)
  20280. v.copy(g[A]).sub(e[y]),
  20281. v.y *= 4,
  20282. p = v.length(),
  20283. p < d && (f = y);
  20284. m.push(t[f])
  20285. }
  20286. return {
  20287. distance: o,
  20288. points: g,
  20289. colors: m
  20290. }
  20291. }
  20292. ,
  20293. n.prototype.makeCameraCurvePoints = function(e, t) {
  20294. var i = this.pointPathDistance(e)
  20295. , n = new r.CatmullRomCurve3(e);
  20296. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20297. }
  20298. ,
  20299. n.prototype.makeCameraCurveTangents = function(e, t) {
  20300. var i = this.pointPathDistance(e)
  20301. , n = new r.CatmullRomCurve3(e)
  20302. , o = Math.max(2, Math.floor(i / t));
  20303. o || (o = 5);
  20304. for (var a = [], s = 0; s <= o; s++)
  20305. a.push(n.getTangentAt(s / o));
  20306. return a
  20307. }
  20308. ,
  20309. n.prototype.setPathHulls = function(e) {
  20310. var t = this.makePathHulls(e);
  20311. this.floorHull = t.floor,
  20312. this.cameraHull = t.camera,
  20313. this.colorHull = t.color
  20314. }
  20315. ,
  20316. n.prototype.setFloorCurves = function() {
  20317. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20318. this.floorPathDistance = e.distance,
  20319. this.floorCurvePoints = e.points,
  20320. this.floorCurveColors = e.colors
  20321. }
  20322. ,
  20323. n.prototype.setCameraCurvePoints = function() {
  20324. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20325. }
  20326. ,
  20327. n.prototype.chooseWarpPath = function(e) {
  20328. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20329. if (this.player.currentPano === this.warpDestPano || !e)
  20330. return this.warpPathPoints = null,
  20331. this.warpLength = 0,
  20332. !1;
  20333. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20334. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20335. t = this.warpDestPano.position.clone().sub(o.position),
  20336. i = t.clone().negate(),
  20337. t.multiplyScalar(.15).add(o.position),
  20338. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20339. t.y = o.position.y,
  20340. i.y = this.warpDestPano.position.y,
  20341. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20342. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20343. this.setCameraCurvePoints(),
  20344. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20345. this.warpLength = 0,
  20346. this.warpPathLengths = [0];
  20347. 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) {
  20348. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20349. var p = s.length();
  20350. s.y *= c.warp.climbEffort;
  20351. var f = s.length() / p;
  20352. if (d > 1) {
  20353. s.setY(0).normalize(),
  20354. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20355. var g = Math.min(1, s.dot(l))
  20356. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20357. f = Math.max(m, f)
  20358. }
  20359. this.warpLength += p * f,
  20360. this.warpPathLengths[d] = this.warpLength
  20361. }
  20362. return !0
  20363. }
  20364. ,
  20365. n.prototype.drawPathRibbon = function(e, t) {
  20366. this.bunnyObj.visible = c.warp.showBunny;
  20367. 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) {
  20368. h.copy(e[u]),
  20369. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20370. h.normalize(),
  20371. n.crossVectors(h, A.UP),
  20372. n.multiplyScalar(i);
  20373. var d = (new r.Vector3).copy(e[u]).add(o);
  20374. d.sub(n),
  20375. l.vertices.push(d),
  20376. d = (new r.Vector3).copy(e[u]).add(o),
  20377. d.add(n),
  20378. l.vertices.push(d)
  20379. }
  20380. var p, f = 0;
  20381. for (u = 0; u < e.length - 1; u += 1) {
  20382. var g = 2 * u
  20383. , v = f;
  20384. f += e[u + 1].distanceTo(e[u]);
  20385. var y = f
  20386. , C = t[u]
  20387. , I = t[u + 1];
  20388. p = new r.Face3(g,g + 1,g + 2),
  20389. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20390. l.faces.push(p),
  20391. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20392. p = new r.Face3(g + 2,g + 1,g + 3),
  20393. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20394. l.faces.push(p),
  20395. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20396. }
  20397. l.computeFaceNormals(),
  20398. l.computeVertexNormals();
  20399. var E, b;
  20400. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20401. b.map.value = w.path,
  20402. b.opacity.value = 0,
  20403. b.color.value.set(c.path.color),
  20404. E = new r.RawShaderMaterial({
  20405. side: r.DoubleSide,
  20406. depthWrite: !1,
  20407. transparent: !0,
  20408. vertexShader: m.ribbon.vertexShader,
  20409. fragmentShader: m.ribbon.fragmentShader,
  20410. uniforms: b,
  20411. name: "ribbonT",
  20412. opacity: 0
  20413. })) : E = new r.MeshBasicMaterial({
  20414. color: 16777215,
  20415. side: r.DoubleSide,
  20416. name: "ribbonOut",
  20417. vertexColors: r.VertexColors
  20418. });
  20419. var _ = new r.Mesh(l,E);
  20420. _.renderOrder = 10
  20421. return _.name = "ribbon",
  20422. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20423. _
  20424. }
  20425. ,
  20426. n.prototype.drawPathPavement = function(e) {
  20427. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20428. s.copy(e[l]),
  20429. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20430. s.normalize(),
  20431. n.crossVectors(s, A.UP),
  20432. n.multiplyScalar(this.brushPrefs.paveWidth),
  20433. t = (new r.Vector3).copy(e[l]),
  20434. t.sub(n),
  20435. o.vertices.push(t),
  20436. o.vertices.push((new r.Vector3).copy(e[l])),
  20437. t = (new r.Vector3).copy(e[l]),
  20438. t.add(n),
  20439. o.vertices.push(t);
  20440. var h, u, d;
  20441. for (l = 0; l < e.length - 1; l += 1)
  20442. h = 3 * l + 1,
  20443. u = l * i,
  20444. d = u + i,
  20445. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20446. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20447. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20448. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20449. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20450. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20451. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20452. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20453. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20454. color: c.path.color,
  20455. side: r.DoubleSide,
  20456. transparent: !0,
  20457. depthWrite: !1,
  20458. opacity: 0,
  20459. name: "paveT",
  20460. map: w.path
  20461. }) : new r.MeshBasicMaterial({
  20462. color: c.path.color,
  20463. side: r.DoubleSide,
  20464. transparent: !0,
  20465. depthWrite: !1,
  20466. opacity: 1,
  20467. name: "paveO",
  20468. map: w.path
  20469. });
  20470. return new r.Mesh(o,p)
  20471. }
  20472. ,
  20473. n.prototype.hintPrefs = {
  20474. rad: .18,
  20475. width: .0125,
  20476. depth: .0625,
  20477. setBack: -.04,
  20478. markRad: .25,
  20479. markInnerRad: .16
  20480. },
  20481. n.prototype.makeWaypointObj = function(e, t) {
  20482. var i = new r.Geometry
  20483. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20484. , o = this.pathHeight();
  20485. 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)),
  20486. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20487. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20488. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20489. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20490. s.map.value = e,
  20491. s.opacity.value = 0,
  20492. s.color.value.set(c.path.color);
  20493. var l = {
  20494. side: r.DoubleSide,
  20495. depthWrite: !1,
  20496. transparent: !0,
  20497. vertexShader: m.waypoint.vertexShader,
  20498. fragmentShader: m.waypoint.fragmentShader,
  20499. uniforms: s,
  20500. name: "waypoint",
  20501. opacity: 0
  20502. };
  20503. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20504. l.name = "wayPtOut");
  20505. var h = new r.RawShaderMaterial(l)
  20506. , u = new r.Mesh(i,h);
  20507. return u.name = t,
  20508. u
  20509. }
  20510. ,
  20511. n.prototype.makeStartMarker = function(e, t) {
  20512. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20513. i.y = 0,
  20514. i.normalize();
  20515. var n = Math.acos(i.x)
  20516. , o = this.makeWaypointObj(w.pathStart, "Start");
  20517. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20518. o.position.copy(e),
  20519. o
  20520. }
  20521. ,
  20522. n.prototype.makeEndMarker = function(e) {
  20523. var t = this.makeWaypointObj(w.pathEnd, "End")
  20524. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20525. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20526. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20527. t.position.copy(e),
  20528. t
  20529. }
  20530. ,
  20531. n.prototype.pathClean = function(e) {
  20532. if (e) {
  20533. for (var t in e.children)
  20534. this.pathClean(e.children[t]);
  20535. e.geometry && e.geometry.dispose(),
  20536. e.material && e.material.dispose()
  20537. }
  20538. }
  20539. ,
  20540. n.prototype.discardPathObject = function() {
  20541. if (this.obj3d) {
  20542. var e = this.obj3d.parent;
  20543. e && e.remove(this.obj3d),
  20544. this.pathClean(this.obj3d)
  20545. }
  20546. this.obj3d = null,
  20547. this.popInCpm()
  20548. }
  20549. ,
  20550. n.prototype.discardSlow = function() {
  20551. if (this.obj3d) {
  20552. if (this.player.mode !== a.PANORAMA)
  20553. return void this.discardPathObject();
  20554. for (var e, t = this, i = 0, n = function() {
  20555. this.discardPathObject()
  20556. }
  20557. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20558. e = t.obj3d.children[r],
  20559. 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]),
  20560. i += 1,
  20561. n = null);
  20562. 0 === i && this.discardPathObject(),
  20563. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20564. }
  20565. }
  20566. ,
  20567. n.prototype.appearSlow = function() {
  20568. var e, t = this;
  20569. this.fadeOutCpm(c.path.fadeInTime);
  20570. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20571. e = t.obj3d.children[n],
  20572. 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]))
  20573. }
  20574. ,
  20575. n.prototype.update = function() {
  20576. this.obj3d && this.obj3d.updateMatrixWorld()
  20577. }
  20578. ,
  20579. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20580. var t = r.Math.degToRad(c.warp.burnsAngle);
  20581. if (this.player.mode === a.PANORAMA) {
  20582. var i = this.burnsDir * t;
  20583. if (this.upcomingTransType === l.BLACK)
  20584. return i;
  20585. var n = e;
  20586. if (null === n)
  20587. return y.warn("Transition request for non-highlight"),
  20588. i;
  20589. var o = this.getHeroDescriptorByHeroIndex(n);
  20590. if (null === o)
  20591. return i;
  20592. if (!o.isPano())
  20593. return i;
  20594. var s = this.getHeroPano(o)
  20595. , h = this.playerControls.cameras[a.PANORAMA]
  20596. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20597. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20598. , p = function(e) {
  20599. var i = Math.acos(Math.min(1, e.dot(u)))
  20600. , n = (new r.Vector3).crossVectors(u, e);
  20601. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20602. };
  20603. if (s === this.player.currentPano)
  20604. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20605. var f = this.findShortestPath(this.player.currentPano, s);
  20606. if (void 0 === f || null === f || f.length < 1)
  20607. return y.debug("Empty path ahead..."),
  20608. i;
  20609. var g = this.makePathHulls(f)
  20610. , m = new r.CatmullRomCurve3(g.camera)
  20611. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20612. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20613. }
  20614. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20615. }
  20616. ,
  20617. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20618. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20619. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20620. var n = new r.Euler
  20621. , o = new r.Vector3;
  20622. y.debug("Starting wait: " + (void 0 !== t));
  20623. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  20624. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20625. , h = function() {
  20626. this.endWarpState(),
  20627. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20628. t && t()
  20629. }
  20630. .bind(this)
  20631. , u = function(e, t) {
  20632. if (this.warpInterrupted)
  20633. return h(),
  20634. !0;
  20635. var r = t || 1e3 / 60;
  20636. if (c.warp.doBurns && !currentLocation.dontRot )
  20637. if (this.player.mode === a.PANORAMA) {
  20638. var l = this.playerControls.cameras[a.PANORAMA];
  20639. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20640. var u = i == 0 ? s : r * s / i;
  20641. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20642. n.y += u,
  20643. o.set(0, 0, -1),
  20644. o.applyEuler(n),
  20645. o.add(l.position),
  20646. l.controls.lookAt(o),
  20647. l.controls.lookVector.copy(o)
  20648. ,l.lookAt(o)
  20649. } else
  20650. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20651. }
  20652. .bind(this);
  20653. this.startWarpState(),
  20654. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20655. }
  20656. ,
  20657. n.prototype.warpToNonPano = function(e) {
  20658. if (this.discardPathObject(),
  20659. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20660. var t = function() {
  20661. e && e()
  20662. }
  20663. .bind(this);
  20664. this.player.flyToNewMode({
  20665. mode: this.warpDestHeroLoc.cameraMode,
  20666. duration: c.warp.outsideTime,
  20667. warpDest: this.warpDestHeroLoc,
  20668. callback: t,
  20669. force: !0
  20670. })
  20671. } else
  20672. y.warn("no warp destination!!!"),
  20673. e && e()
  20674. }
  20675. ,
  20676. n.prototype._resetWarpShaderParams = function(e) {//
  20677. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20678. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20679. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20680. delete e.material.defines.newBlack;
  20681. e.material.needsUpdate = true
  20682. } */
  20683. }
  20684. ,
  20685. n.prototype._clearWarpShading = function() {
  20686. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20687. this._resetWarpShaderParams(e[t]),
  20688. e[t].visible = !0;
  20689. this._resetWarpShaderParams(this.model.skybox)
  20690. }
  20691. ,
  20692. n.prototype._warpStopFlying = function() {
  20693. this.activeTransType = null,
  20694. this.placeCpm()
  20695. }
  20696. ,
  20697. n.prototype._wrapupTravelOnlyBits = function() {
  20698. this._warpStopFlying(),
  20699. this.warpPathPoints && (this.player.currentPano.exit(),
  20700. this.warpDestPano.enter(),
  20701. this.player.currentPano = this.warpDestPano),
  20702. this.player.spider.draw(),
  20703. this.placeCpm()
  20704. }
  20705. ,
  20706. n.prototype._wrapupTravel = function(e) {
  20707. this._wrapupTravelOnlyBits(),
  20708. this.warpCameraAim(e)
  20709. }
  20710. ,
  20711. n.prototype._wrapupWarpShading = function(e) {
  20712. this._clearWarpShading(),
  20713. this._wrapupTravel(e)
  20714. }
  20715. ,
  20716. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20717. t !== I.END && this._clearWarpShading(),
  20718. this._wrapupTravelOnlyBits(),
  20719. this.upcomingTransType = null,
  20720. e && e()
  20721. }
  20722. ,
  20723. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20724. var i = this.warpDestHeroLoc.quaternion
  20725. , n = this.playerControls.cameras[a.PANORAMA]
  20726. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20727. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20728. , l = s.dot(o)
  20729. , u = r.Math.radToDeg(Math.acos(l))
  20730. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20731. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20732. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20733. m.y = h.constrainedTurn(m.y),
  20734. this.burnsDir = Math.sign(m.y);
  20735. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20736. , A = new r.Vector3
  20737. , C = function(e, t) {
  20738. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20739. v.y = g.y + e * m.y,
  20740. v.z = g.z + e * m.z,
  20741. A.set(0, 0, -1),
  20742. A.applyEuler(v),
  20743. A.add(n.position),
  20744. n.controls.lookAt(A),
  20745. n.controls.lookVector.copy(A),
  20746. void n.lookAt(A))
  20747. }
  20748. .bind(this);
  20749. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20750. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20751. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20752. ):
  20753. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20754. ,void (t && t())
  20755. ) */
  20756. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20757. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20758. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20759. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20760. ,void (t && t())
  20761. )
  20762. }
  20763. ,
  20764. n.prototype._warpBendAim = function(e, t, i, n) {
  20765. var o = n || 0
  20766. , s = this.playerControls.cameras[a.PANORAMA]
  20767. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20768. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20769. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20770. f.y = h.constrainedTurn(f.y);
  20771. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20772. f.x = g * Math.sign(f.x),
  20773. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20774. this.burnsDir = Math.sign(f.y),
  20775. g *= Math.sign(f.y),
  20776. f.y = g;
  20777. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20778. , v = new r.Vector3
  20779. , A = function(e, t) {
  20780. if (e < .5)
  20781. m.x = u.x + e * f.x,
  20782. m.y = u.y + e * f.y,
  20783. m.z = u.z + e * f.z;
  20784. else {
  20785. var i = (1 - e) * c.warp.softBendEnd;
  20786. m.x = l.x - i * f.x,
  20787. m.y = l.y - i * f.y,
  20788. m.z = l.z - i * f.z
  20789. }
  20790. v.set(0, 0, -1),
  20791. v.applyEuler(m),
  20792. v.add(s.position);
  20793. s.controls.lookAt(v),
  20794. s.controls.lookVector.copy(v),
  20795. s.lookAt(v);
  20796. }
  20797. .bind(this);
  20798. if(window.DATA.momentTourBlackNewType){
  20799. A(1)
  20800. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20801. }
  20802. ,
  20803. n.prototype._warpStepCameraAim = function(e, t, i) {
  20804. var n = this.playerControls.cameras[a.PANORAMA]
  20805. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20806. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20807. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20808. l.y = h.constrainedTurn(l.y),
  20809. this.burnsDir = Math.sign(l.y);
  20810. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20811. , f = new r.Vector3
  20812. , g = function(e, t) {
  20813. e < .5 ? u.copy(s) : u.copy(o),
  20814. f.set(0, 0, -1),
  20815. f.applyEuler(u),
  20816. f.add(n.position),
  20817. n.controls.lookAt(f),
  20818. n.controls.lookVector.copy(f),
  20819. n.lookAt(f)
  20820. }
  20821. .bind(this);
  20822. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20823. }
  20824. ,
  20825. n.prototype.setBurnsDir = function() {
  20826. var e = this.playerControls.cameras[a.PANORAMA]
  20827. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20828. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20829. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20830. n.y = h.constrainedTurn(n.y),
  20831. this.burnsDir = Math.sign(n.y)
  20832. }
  20833. ,
  20834. n.prototype.stepWarpPath = function(firstPos, e ) {
  20835. var i = this.playerControls.cameras[a.PANORAMA];
  20836. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20837. if (!n){
  20838. return i.position.copy(this.warpDestPano.position),
  20839. !0;
  20840. }
  20841. /* if (!this.warpPathPoints)
  20842. return i.position.copy(this.warpDestPano.position),
  20843. !0;
  20844. var n = this.warpPathPoints[0] */
  20845. var o = this.warpDestPano.position;
  20846. /* console.log(firstPos)
  20847. console.log(o) */
  20848. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20849. var s = new r.Vector3;
  20850. 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),
  20851. i.position.copy(s)
  20852. } else
  20853. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20854. }
  20855. ,
  20856. n.prototype.interruptAndFastForward = function(e, t) {
  20857. this.warping && (this.warpInterrupted = !0,
  20858. this.warpInterruptionBlackoutStyle = e,
  20859. this.warpInterruptionTravelTime = t,
  20860. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20861. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20862. }
  20863. ,
  20864. n.prototype.warpCameraAim = function(e) {
  20865. var t = c.warp.minWarpTime;
  20866. if (this.upcomingTransType === l.BLACK)
  20867. t = c.warp.teleportTime;
  20868. else {
  20869. var i = this.playerControls.cameras[a.PANORAMA]
  20870. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20871. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20872. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20873. s.y = h.constrainedTurn(s.y);
  20874. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20875. t = Math.max(t, u)
  20876. }
  20877. var d = function() {
  20878. this._warpStopFlying(),
  20879. this.discardSlow(),
  20880. e && e()
  20881. }
  20882. .bind(this);
  20883. this._warpCameraAim(t, d)
  20884. }
  20885. ,
  20886. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20887. this.model.skybox.material.uniforms.blackout.value = n;
  20888. var r = u.uniform(this.model.skybox, "progress", 1)
  20889. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20890. , a = !1
  20891. , s = function() {
  20892. if (this.warpInterrupted)
  20893. return a = !0,
  20894. !0
  20895. }
  20896. .bind(this)
  20897. , l = function(e, t) {
  20898. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20899. !0) : void r(e, t)
  20900. }
  20901. .bind(this)
  20902. , h = function(e, t) {
  20903. return i && a ? (o(0),
  20904. !0) : void o(e, t)
  20905. }
  20906. .bind(this);
  20907. p.start(s, e, null, t, null, "safeHaltWatch"),
  20908. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20909. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20910. }
  20911. ,
  20912. n.prototype.warpTravel_STD = function(e) {
  20913. 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),
  20914. 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;
  20915. w += this.warpLength * c.warp.timePerMeter,
  20916. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20917. var _ = !1
  20918. , T = this.warpDestHeroLoc.quaternion
  20919. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20920. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20921. , M = S.dot(x)
  20922. , R = r.Math.radToDeg(Math.acos(M))
  20923. , P = function(e) {
  20924. var t = o
  20925. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20926. return i
  20927. }
  20928. , O = function() {
  20929. return E.lookAt(C, t, A.UP),
  20930. s.setFromRotationMatrix(E, c.warp.eOrder),
  20931. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20932. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20933. h.constrainedTurn(b.y)
  20934. }
  20935. .bind(this)
  20936. , L = function(e, t) {
  20937. if (this.warpInterrupted)
  20938. return _ = !0,
  20939. !0
  20940. }
  20941. .bind(this)
  20942. , D = function(e, t) {
  20943. return _ || !this.warpPathPoints ? (g.blur(0),
  20944. !0) : void g.blur(e)
  20945. }
  20946. .bind(this)
  20947. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20948. , B = function(e, t) {
  20949. return _ || !this.warpPathPoints ? (N(0),
  20950. !0) : void N(e, t)
  20951. }
  20952. .bind(this)
  20953. , F = function(e, t) {
  20954. if (!this.warpPathPoints)
  20955. return n.position.copy(this.warpDestPano.position),
  20956. !0;
  20957. if (_)
  20958. return !0;
  20959. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20960. n.position.copy(i),
  20961. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20962. }
  20963. .bind(this)
  20964. , V = function(e, n) {
  20965. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20966. !0)
  20967. }
  20968. .bind(this)
  20969. , U = function(e, o) {
  20970. if (_)
  20971. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20972. !0;
  20973. if (!this.warpPathPoints)
  20974. return !0;
  20975. var a = this.warpLength * e
  20976. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20977. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20978. c.warp.matchCam && (l *= 1 - u),
  20979. E.lookAt(C, t, A.UP),
  20980. s.setFromRotationMatrix(E, c.warp.eOrder),
  20981. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20982. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20983. b.y = h.constrainedTurn(b.y),
  20984. s.x = m.x + l * b.x,
  20985. s.y = m.y + l * b.y,
  20986. s.z = m.z + l * b.z,
  20987. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20988. b.y = h.constrainedTurn(b.y);
  20989. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20990. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20991. v.x = v.x + b.x * c.warp.turnFriction,
  20992. v.y = v.y + b.y * c.warp.turnFriction,
  20993. v.z = v.z + b.z * c.warp.turnFriction,
  20994. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20995. var p = t.clone().sub(C).normalize();
  20996. if (R < c.warp.maxAimRotation && u > 0) {
  20997. var g = 1 - u;
  20998. p.x = p.x * g + u * S.x,
  20999. p.y = p.y * g + u * S.y,
  21000. p.z = p.z * g + u * S.z,
  21001. p.normalize()
  21002. }
  21003. this.bunnyObj.position.copy(n.position).add(p),
  21004. f.set(0, 0, -1).applyEuler(v).normalize(),
  21005. f.multiplyScalar(8),
  21006. f.add(n.position),
  21007. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21008. n.controls.lookVector.copy(f),
  21009. n.lookAt(f))
  21010. }
  21011. .bind(this)
  21012. , k = function() {
  21013. _ ? (this.discardSlow(),
  21014. this.upcomingTransType = l.BLACK,
  21015. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21016. }
  21017. .bind(this);
  21018. V(0);
  21019. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21020. w += H;
  21021. var G = H / w;
  21022. this.warpCommonParameters(w, G, !0, I.NONE),
  21023. p.start(L, w, null, 0, null, "_haltWatcher"),
  21024. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21025. p.start(D, w, null, G, P, "blurring")),
  21026. p.start(B, w, null, G, P, "modelAlpha"),
  21027. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21028. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21029. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21030. }
  21031. ,
  21032. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21033. var r = e || 0;
  21034. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21035. //add
  21036. player.model.hotGroup.visible = false
  21037. let oldPano = this.player.currentPano
  21038. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  21039. this.player.emit("pano.chosen", oldPano, toPano)
  21040. var done = ()=>{
  21041. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  21042. player.model.hotGroup.visible = true
  21043. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  21044. }})
  21045. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  21046. }
  21047. if(window.DATA.momentTourBlackNewType){
  21048. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  21049. var camera = this.playerControls.cameras[a.PANORAMA];
  21050. var end = this.warpDestHeroLoc.position
  21051. camera.position.copy(end)
  21052. setTimeout(()=>{
  21053. player.sceneRenderer.effects.transitionMaskPass.stop()
  21054. this.wrapupWarpShadingOnly(n, i);
  21055. done()
  21056. },t)
  21057. }else{
  21058. var o = function() {
  21059. this.wrapupWarpShadingOnly(n, i);
  21060. done()
  21061. }
  21062. .bind(this);
  21063. var firstPos = this.player.position.clone()//add
  21064. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21065. }
  21066. this.warpCommonParameters(t, r, !1, i)
  21067. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21068. if(window.momentTourBlackNewType){
  21069. e.material.uniforms.blackout.value = 5//i 改
  21070. //e.material.defines.newBlack = ''
  21071. //e.material.needsUpdate = true
  21072. }else{
  21073. e.material.uniforms.blackout.value = i
  21074. }
  21075. }),
  21076. this._warpBendAim(null, t, null, r);
  21077. }
  21078. ,
  21079. n.prototype.flightStepWalk = function(e, t, i) {
  21080. var n = .001
  21081. , o = 1
  21082. , a = 1.2
  21083. , s = new r.Vector3
  21084. , h = new r.Vector3
  21085. , u = function(e, t) {
  21086. //导览速度
  21087. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21088. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21089. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  21090. h.copy(A.FORWARD),
  21091. this.player.getDirection(h),
  21092. s.copy(t).sub(e.position).normalize();
  21093. var l = s.dot(h)
  21094. , u = Math.acos(l)
  21095. , d = u / r;
  21096. d > n && (r *= d / n,
  21097. u < o && (r *= a))
  21098. return r / DATA.tourWalkSpeed * 100 // 改
  21099. };
  21100. return function(e, t, i) {
  21101. if (this.warpInterrupted)
  21102. i && i();
  21103. else if (this.activeTransType !== l.WALK)
  21104. this._clearWarpShading(),
  21105. this._warpStopFlying(),
  21106. this.player.spider.draw(),
  21107. this.placeCpm(),
  21108. i && i();
  21109. else if (this.player.currentPano !== e) {
  21110. var n = {
  21111. pano: e,
  21112. lookAtPoint: t,
  21113. duration: null,
  21114. maxDistanceOverride: c.warp.walkMaxDist,
  21115. skipWarpingCheck: !1,
  21116. constantMoveSpeed: !0
  21117. };
  21118. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21119. n.zoomLevel = this.warpDestHeroLoc.zoom
  21120. }
  21121. n.duration = u.call(this, e, t),
  21122. this.player.nonInterruptingFlyToPano(n, i)
  21123. } else
  21124. i && i()
  21125. }
  21126. }(),
  21127. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21128. return this.flightStepWalk.bind(this, e, t, i)
  21129. }
  21130. ,
  21131. n.prototype.warpTravel_WALK = function() {
  21132. var e = [];
  21133. return function(t) {
  21134. var i = this.player.model.panos;
  21135. e.length = 0;
  21136. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21137. var s = this.nodes[a]
  21138. , l = i.get(s);
  21139. a === this.nodes.length - 1;
  21140. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21141. n && o || (e.push(s),
  21142. n = l)
  21143. }
  21144. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21145. var h = e.length
  21146. , u = i.get(e[h - 1])
  21147. , d = new Array(h + 1);
  21148. d[d.length - 1] = function() {
  21149. t && t()
  21150. }
  21151. .bind(this);
  21152. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21153. var g = e[p];
  21154. u = i.get(g);
  21155. var m = new r.Vector3;
  21156. this.getLookAtForWalkingTourNode(e, p, m),
  21157. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21158. p--
  21159. }
  21160. d[0]()
  21161. }
  21162. }(),
  21163. n.prototype.getLookAtForWalkingTourNode = function() {
  21164. var e = new r.Vector3
  21165. , t = new r.Vector3
  21166. , i = new r.Vector3
  21167. , n = new r.Vector3
  21168. , o = new r.Vector3
  21169. , a = .65
  21170. , s = .75
  21171. , l = .2
  21172. , c = .4
  21173. , h = .2
  21174. , u = 3;
  21175. return function(r, d, p) {
  21176. var f = r.length;
  21177. if (d >= f)
  21178. return !1;
  21179. var g = 1
  21180. , m = 1;
  21181. t.set(0, 0, 0),
  21182. o.set(0, 0, 0);
  21183. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21184. if (v = this.player.model.panos.get(r[A]),
  21185. this.getOrientationForWalkingTourNode(r, A, i),
  21186. A === d && e.copy(i),
  21187. n.copy(i),
  21188. A > d) {
  21189. var y = n.dot(e) < a;
  21190. g *= y ? l : s,
  21191. m *= y ? h : c
  21192. }
  21193. i.multiplyScalar(g),
  21194. t.add(i),
  21195. o.lerp(v.position, m)
  21196. }
  21197. return t.normalize(),
  21198. p.copy(o),
  21199. p.add(t),
  21200. !0
  21201. }
  21202. }(),
  21203. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21204. var n = e.length;
  21205. if (t >= n)
  21206. return !1;
  21207. if (t === n - 1)
  21208. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21209. else {
  21210. var r = this.player.model.panos.get(e[t])
  21211. , o = this.player.model.panos.get(e[t + 1]);
  21212. i.copy(o.position).sub(r.position)
  21213. }
  21214. return i.normalize(),
  21215. !0
  21216. }
  21217. ,
  21218. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21219. if (this.activeTransType = this.upcomingTransType,
  21220. this.lastTransType = this.activeTransType,
  21221. this.upcomingTransType = null,
  21222. !e) {
  21223. var r = function() {
  21224. this._wrapupTravel(n)
  21225. }
  21226. .bind(this)
  21227. , o = {
  21228. pano: this.warpDestPano,
  21229. lookAtPoint: null,
  21230. duration: null,
  21231. maxDistanceOverride: null,
  21232. skipWarpingCheck: !1
  21233. };
  21234. return void this.player.flyToPano(o, r)
  21235. }
  21236. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21237. this._clearWarpShading(),
  21238. this._warpStopFlying(),
  21239. this.player.spider.draw(),
  21240. this.placeCpm(),
  21241. n && n()
  21242. }
  21243. .bind(this)) : this.warpTravel_STD(n)
  21244. }
  21245. ,
  21246. n.prototype.startWarpState = function() {
  21247. this.warping = !0,
  21248. this.warpInterrupted = !1,
  21249. this.warpInterruptionBlackoutStyle = null,
  21250. this.warpInterruptionTravelTime = null
  21251. }
  21252. ,
  21253. n.prototype.endWarpState = function() {
  21254. this.warping = !1
  21255. this.director.emit('warp.end')//xzw add
  21256. }
  21257. ,
  21258. n.prototype.warpToPano = function(e, t, i, n) {
  21259. if (this.warping)
  21260. return void y.warn("Cannot warp when already warping");
  21261. if (this.upcomingTransType = e,
  21262. this.activeTransType = null,
  21263. !this.setWarpDestPano())
  21264. return this.upcomingTransType = null,
  21265. void this.warpToNonPano(n);
  21266. if (this.player.mode !== a.PANORAMA)
  21267. return this.upcomingTransType = null,
  21268. this.discardSlow(),
  21269. void this.player.flyToNewMode({
  21270. mode: a.PANORAMA,
  21271. pano: this.warpDestPano,
  21272. duration: c.warp.outsideTime,
  21273. warpDest: this.warpDestHeroLoc,
  21274. callback: n,
  21275. force: !0
  21276. });
  21277. if (!this.warpDestPano)
  21278. return y.warn("no warp destination, callback dropped"),
  21279. void (this.upcomingTransType = null);
  21280. 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)
  21281. , o = this.chooseWarpPath(r);
  21282. if (o && this.upcomingTransType !== l.WALK) {
  21283. var s = function() {
  21284. this.waitingToWarp = !1,
  21285. this.warpToPano(e, t, i, n)
  21286. }
  21287. .bind(this);
  21288. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21289. return void (this.waitingToWarp = !0)
  21290. }
  21291. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21292. this.player.currentPano = this.warpDestPano,
  21293. this.placeCpm(),
  21294. this.fadeOutCpm(c.path.fadeOutTime),
  21295. this.player.spider.draw()),
  21296. y.debug("Warping to pano ", this.warpDestPano.position),
  21297. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21298. this.startWarpState();
  21299. var h = function() {
  21300. this.endWarpState(),
  21301. n && n()
  21302. }
  21303. .bind(this);
  21304. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21305. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21306. }
  21307. ,
  21308. t.exports = n
  21309. }
  21310. ).call(this, "/js/objects/ShowPath.js")
  21311. }
  21312. , {
  21313. "../constants": 8,
  21314. "../effects": 16,
  21315. "../enum/BlackoutStyle": 18,
  21316. "../enum/ModelManagerEvents": 33,
  21317. "../enum/PlayerEvents": 40,
  21318. "../enum/RenderOrder": 42,
  21319. "../enum/Vectors": 50,
  21320. "../enum/Viewmode": 51,
  21321. "../enum/WarpStyle": 52,
  21322. "../gui/gui": 65,
  21323. "../model/ModelManager": 140,
  21324. "../objects/Snapshot": 153,
  21325. "../settings": 166,
  21326. "../shaders": 167,
  21327. "../util/easing": 186,
  21328. "../util/lerp": 188,
  21329. "../util/logger": 189,
  21330. "../util/math": 190,
  21331. "../util/texture": 194,
  21332. "../util/transitions": 195,
  21333. three: 217
  21334. }],
  21335. 152: [function(e, t, i) {
  21336. "use strict";
  21337. function n() {
  21338. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21339. , t = new r.RawShaderMaterial({
  21340. fragmentShader: o.skysphere.fragmentShader,
  21341. vertexShader: o.skysphere.vertexShader,
  21342. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21343. side: r.BackSide,
  21344. name: "skysphere"
  21345. });
  21346. t.uniforms.radius.value = e.parameters.radius,
  21347. r.Mesh.call(this, e, t)
  21348. }
  21349. var r = e("three")
  21350. , o = e("../shaders")
  21351. , a = e("../settings");
  21352. n.prototype = Object.create(r.Mesh.prototype),
  21353. n.prototype.constructor = n,
  21354. t.exports = n
  21355. }
  21356. , {
  21357. "../settings": 166,
  21358. "../shaders": 167,
  21359. three: 217
  21360. }],
  21361. 153: [function(e, t, i) {
  21362. (function(i) {
  21363. "use strict";
  21364. function n(e) {
  21365. o.call(this, e),
  21366. this.sid = e.sid,//xzw add
  21367. this.panoId = e.panoId,
  21368. this.orthoZoom = e.orthoZoom,
  21369. this.floorVisibility = e.floorVisibility,
  21370. this.thumbUrl = e.thumbUrl,
  21371. this.name = e.name,
  21372. this.zoom = e.zoom
  21373. }
  21374. var r = (e("three"),
  21375. e("../util/logger"))
  21376. , o = (e("../settings"),
  21377. e("../enum/Viewmode"),
  21378. e("../util/common"),
  21379. e("../util/transitions"),
  21380. e("../util/lerp"),
  21381. e("../util/ajax"),
  21382. e("../util/texture"),
  21383. e("./View"));
  21384. e("events").EventEmitter,
  21385. new r(i);
  21386. n.prototype = Object.create(o.prototype),
  21387. n.prototype.isPano = function() {
  21388. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21389. }
  21390. ,
  21391. t.exports = n
  21392. }
  21393. ).call(this, "/js/objects/Snapshot.js")
  21394. }
  21395. , {
  21396. "../enum/Viewmode": 51,
  21397. "../settings": 166,
  21398. "../util/ajax": 181,
  21399. "../util/common": 185,
  21400. "../util/lerp": 188,
  21401. "../util/logger": 189,
  21402. "../util/texture": 194,
  21403. "../util/transitions": 195,
  21404. "./View": 154,
  21405. events: 202,
  21406. three: 217
  21407. }],
  21408. 154: [function(e, t, i) {
  21409. (function(i) {
  21410. "use strict";
  21411. function n(e) {
  21412. e = e || {},
  21413. this.position = new r.Vector3,
  21414. this.quaternion = new r.Quaternion,
  21415. this.update(e)
  21416. }
  21417. var r = e("three")
  21418. , o = e("../util/logger")
  21419. , a = (e("../settings"),
  21420. e("../enum/Viewmode"),
  21421. e("../util/common"),
  21422. e("../util/transitions"),
  21423. e("../util/lerp"),
  21424. e("../util/ajax"),
  21425. e("../util/texture"),
  21426. e("events").EventEmitter);
  21427. new o(i);
  21428. n.prototype = Object.create(a.prototype),
  21429. n.prototype.isValid = function() {
  21430. return !!this.cameraMode
  21431. }
  21432. ,
  21433. n.prototype.update = function(e) {
  21434. return this.cameraMode = e.cameraMode || this.cameraMode,
  21435. this.pano = e.pano || this.pano,
  21436. e.position && this.position.copy(e.position),
  21437. e.quaternion && this.quaternion.copy(e.quaternion),
  21438. this
  21439. }
  21440. ,
  21441. t.exports = n
  21442. }
  21443. ).call(this, "/js/objects/View.js")
  21444. }
  21445. , {
  21446. "../enum/Viewmode": 51,
  21447. "../settings": 166,
  21448. "../util/ajax": 181,
  21449. "../util/common": 185,
  21450. "../util/lerp": 188,
  21451. "../util/logger": 189,
  21452. "../util/texture": 194,
  21453. "../util/transitions": 195,
  21454. events: 202,
  21455. three: 217
  21456. }],
  21457. 155: [function(e, t, i) {//player.js
  21458. (function(i) {
  21459. "use strict";
  21460. function n(e) {
  21461. this.currentPano = null,
  21462. this.nextPano = null,
  21463. this.camera = null,
  21464. this.paused = !1,
  21465. this.flying = !1,
  21466. this.sceneIntersectionPlane = null,
  21467. this.target = new r.Vector3,
  21468. this.mouse = new r.Vector3(1.1,1.1,.5),
  21469. this.mouseAtMouseDown = new r.Vector2,
  21470. this.mouseCouldBeClickToMove = !1,
  21471. this.mouseLastMoveTime = Date.now(),
  21472. this.mouseDown = !1,
  21473. this.mouseDownTimer = null,
  21474. this.couldBeLongTap = !1,
  21475. this.containsMouse = !1, //
  21476. this.isTouchEvent = !1,
  21477. this.isPanoHover = !1,
  21478. this.reticule = new a(this),
  21479. this.panoMarkers = [],
  21480. this.spider = new h(this),
  21481. this.quaternion = new r.Quaternion,
  21482. this.position = new r.Vector3(15,10,15),
  21483. this.previousState = null,
  21484. this.lastInsideView = new c,
  21485. this.last360View = new c,
  21486. this.raycaster = new r.Raycaster,
  21487. this.intersect = null,
  21488. this.lastChangeTime = Date.now(),
  21489. this.history = new I,
  21490. this.cameraControls = null,
  21491. this.path = null,
  21492. this.model = null,
  21493. this.domElement = null,
  21494. this.cachedPanoCandidates = null,
  21495. this.basePanoSize = 0,
  21496. this.standardPanoSize = 0,
  21497. this.highPanoSize = 0,
  21498. this.ultraHighPanoSize = 0,
  21499. this.zoomLevel = 1,
  21500. this.zooming = 0,
  21501. this.zoomSpeed = .5,
  21502. this.scrollZoomSpeed = .06,
  21503. this.zoomSpeedAdjust = .05,
  21504. this.defaultZoomIncrement = .2,
  21505. this.baseFov = f.insideFOV,
  21506. this.zoomFov = this.baseFov,
  21507. this.zoomEnabled = !0,
  21508. this.preRenderingEnabled = !1,
  21509. this.setupCustomProperties(e),
  21510. this.zoomStats = new L
  21511. window.player = this
  21512. this.modeTran = ''
  21513. }
  21514. var r = e("three")
  21515. , o = e("./util/logger")
  21516. , a = e("./objects/Reticule")
  21517. , s = e("./objects/Panorama")
  21518. , l = e("./objects/ShowPath")
  21519. , c = e("./objects/View")
  21520. , h = (e("./objects/Snapshot"),
  21521. e("./objects/NSpider"))
  21522. , u = e("./enum/Viewmode")
  21523. , d = (e("./enum/TagStates"),
  21524. e("./enum/Vectors"))
  21525. , p = e("./enum/Keys")
  21526. , f = (e("./enum/AlignmentType"),
  21527. e("./settings"))
  21528. , g = e("./util/common")
  21529. , m = (e("./util/browser"),
  21530. e("./util/math"))
  21531. , v = e("./util/lerp")
  21532. , A = e("./util/easing")
  21533. , y = e("./util/transitions")
  21534. , C = e("events").EventEmitter
  21535. , I = (e("./shaders"),
  21536. e("./util/history"))
  21537. , E = (e("./util/camera"),
  21538. e("./model/ModelManager"),
  21539. e("./enum/PathDiscardMode"))
  21540. , b = e("./enum/PathDisplayMode")
  21541. , w = e("./enum/PlayerEvents")
  21542. , _ = e("./enum/ControlEvents")
  21543. , T = e("./enum/ModelManagerEvents")
  21544. , x = e("./enum/WarpStyle")
  21545. , S = e("./enum/BlackoutStyle")
  21546. , M = e("./exception/BasicException")
  21547. , R = e("./enum/PanoSizeClass")
  21548. , P = (e("./tile/TileDownloader"),
  21549. e("./tile/TilePrioritizer"))
  21550. , O = (e("./enum/PanoramaEvents"),
  21551. e("./enum/ZoomEvents"))
  21552. , L = e("./util/ZoomStats")
  21553. , D = e("./constants")
  21554. , N = e("./util/common")
  21555. , B = e("./util/cameraLight")
  21556. //, Hot = e('hot')
  21557. , F = new o(i)
  21558. , V = Object.freeze({
  21559. FlyToPano: y.getUniqueId(),
  21560. FlyToNewMode: y.getUniqueId(),
  21561. FlyToSameMode: y.getUniqueId(),
  21562. FlyToViewFloor: y.getUniqueId(),
  21563. LookTransition: y.getUniqueId(),
  21564. ZoomTransition: y.getUniqueId()
  21565. });
  21566. n.prototype = Object.create(C.prototype),
  21567. n.prototype.init = function(e) {
  21568. this.modelManager = e.modelManager,
  21569. this.tileDownloader = e.tileDownloader,
  21570. this.panoRenderer = e.panoRenderer,
  21571. this.qualityManager = e.qualityManager,
  21572. this.domElement = e.container,
  21573. this.camera = e.camera,
  21574. this.tagManager = e.tagManager,
  21575. this.cameraControls = e.controls,
  21576. this.path = new l(e.director,this,e.controls),
  21577. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21578. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21579. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21580. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21581. this.tileDownloader.processPriorityQueue = !1,
  21582. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21583. this.bindEvents(e.container),
  21584. this.updateModel()
  21585. this.guider2 = new PanTransGuide(this)
  21586. this.guider3 = new UserGuide(this)
  21587. }
  21588. //xzw add: 截图
  21589. function dataURLtoBlob(dataurl) {
  21590. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21591. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21592. while(n--){
  21593. u8arr[n] = bstr.charCodeAt(n);
  21594. };
  21595. return new Blob([u8arr], {type:mime});
  21596. }
  21597. n.prototype.screenShot = function(o){
  21598. if(this.flying || this.flyingToTag) return;
  21599. var R = this.sceneRenderer;
  21600. R.updateScreenSize(o);
  21601. for(var i in this.model.panos.index){
  21602. if(!this.model.panos.index[i].marker) continue;
  21603. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21604. this.model.panos.index[i].marker.visible = false;
  21605. }
  21606. for(var i in this.model.hots){
  21607. this.model.hots[i].mesh.visible = false;
  21608. }
  21609. this.reticule.visible = false;
  21610. this.reticule.forceUnvisible = true;
  21611. this.path.currentPanoMarker.mesh.visible = false;
  21612. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21613. R.renderer.clear(true,true,true);
  21614. R.renderer.render(R.scene, R.camera);
  21615. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21616. o.f && o.f(imgData)
  21617. R.updateScreenSize({resize:true});
  21618. this.reticule.visible = true;
  21619. for(var i in this.model.hots){
  21620. this.model.hots[i].mesh.visible = true;
  21621. }
  21622. for(var i in this.model.panos.index){
  21623. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21624. }
  21625. this.path.currentPanoMarker.mesh.visible = true;
  21626. R.renderer.render(R.scene, R.camera);
  21627. }.bind(this),30) //这个数字不能太小
  21628. }
  21629. var scaleImg = e("scaleImg");
  21630. var ResizeImg = function(img, option){
  21631. var img2; //不能直接改img 否则可能触发第二次img.onload
  21632. var compress = function(ratio,type){
  21633. var image = img2 || img;
  21634. var c = document.createElement('canvas');
  21635. c.width = image.width; c.height = image.height;
  21636. var ctx = c.getContext('2d');
  21637. ctx.drawImage(image,0,0,image.width,image.height);
  21638. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21639. }
  21640. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21641. var image = img2 || img;
  21642. var blob = dataURLtoBlob(image.src);
  21643. if(option.maxWeight && blob.size > option.maxWeight){
  21644. compress(option.maxWeight/blob.size, "jpeg")
  21645. blob = dataURLtoBlob(image.src);
  21646. }
  21647. if(!img2){
  21648. img2 = new Image();
  21649. }
  21650. img2.base64Src = image.src;
  21651. img2.src = window.URL.createObjectURL(blob);
  21652. }
  21653. var oldSize = Math.max(img.width, img.height);
  21654. if(option.toType != "png"){//不是非要png的话
  21655. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21656. if(oldSize > option.maxSize){
  21657. compress(option.maxSize/oldSize, "jpeg");
  21658. }
  21659. reCom();
  21660. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21661. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21662. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21663. reCom();
  21664. }
  21665. }
  21666. }else{
  21667. //?貌似png会越压缩越大?
  21668. }
  21669. return img2 || img;
  21670. }
  21671. var _fixType=function(type) {
  21672. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21673. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21674. return 'image/' + r;
  21675. };
  21676. var saveFile=function(data, filename){
  21677. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21678. save_link.href = data;
  21679. save_link.download = filename;
  21680. var event = document.createEvent('MouseEvents');
  21681. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21682. save_link.dispatchEvent(event);
  21683. };
  21684. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21685. var info = this.getSnapAngleInfo();
  21686. var str = ',{\r\t' + info;
  21687. var arg = arguments[0];
  21688. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21689. if (arg && arg.__callback) {
  21690. return arg.__callback(imgData, info)
  21691. }
  21692. var img = new Image();
  21693. img.src = imgData;
  21694. img.onload = function(){
  21695. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21696. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21697. var filename = "snap" + (new Date()).getTime();
  21698. saveFile(img2.src,filename + ".jpg");
  21699. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21700. str +=('\r\t"sid":"'+filename+'",');
  21701. str +=('\r\t"name":"'+filename+'"\r}');
  21702. logData(str)
  21703. }
  21704. }});
  21705. }
  21706. ,
  21707. n.prototype.getSnapAngleInfo = function(){
  21708. var info = {};
  21709. var str = '"metadata":{';
  21710. var q = this.camera.quaternion.clone();
  21711. switch (this.mode) {
  21712. case "panorama":
  21713. info.scan_id = this.currentPano.id;
  21714. str += ('"scan_id":"'+this.currentPano.id+'",');
  21715. break;
  21716. case "floorplan":
  21717. info.camera_mode = 1;
  21718. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21719. q.multiply(this.camera.quaternion);
  21720. str += ('"camera_mode":1,');
  21721. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21722. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21723. break;
  21724. case "dollhouse":
  21725. info.camera_mode = 2;
  21726. str += ('"camera_mode":2,');
  21727. break;
  21728. }
  21729. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21730. console.log(info.camera_position)
  21731. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21732. /**fyz 对相机截屏的角度进行校对 */
  21733. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21734. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21735. out.x *= -1;
  21736. out.w *= -1;
  21737. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21738. }else{
  21739. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21740. }
  21741. info.zoom = this.zoomLevel;
  21742. console.log(info.camera_quaternion)
  21743. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21744. // fyz 扩展编辑页面, 加上导览点缩放值
  21745. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21746. return str;
  21747. }
  21748. //------end
  21749. n.prototype.setupCustomProperties = function(e) {
  21750. var t = e || u.PANORAMA;
  21751. Object.defineProperty(this, "mode", {
  21752. get: function() {
  21753. return t
  21754. },
  21755. set: function(e) {
  21756. var i = t;
  21757. t = e,
  21758. this.onModeUpdated(i, t)
  21759. }
  21760. })
  21761. }
  21762. ,
  21763. n.prototype.isInMode = function() {
  21764. for (var e = 0; e < arguments.length; e++)
  21765. if (this.mode === arguments[e])
  21766. return !0;
  21767. return !1
  21768. }
  21769. ,
  21770. n.prototype.isOutsideMode = function(e) {
  21771. return e = e || this.mode,
  21772. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21773. }
  21774. ,
  21775. n.prototype.is360View = function(e, t) {
  21776. return e === u.PANORAMA && t && !t.isAligned()
  21777. }
  21778. ,
  21779. n.prototype.setScene = function(e) {
  21780. this.sceneIntersectionPlane = e.plane,
  21781. this.path.setScene(e),
  21782. this.moveReticuleToScene(e)
  21783. }
  21784. ,
  21785. n.prototype.moveReticuleToScene = function(e) {
  21786. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21787. e.add(this.reticule)
  21788. }
  21789. ,
  21790. n.prototype.updateModel = function() {
  21791. function e(e, t, n) {
  21792. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21793. }
  21794. function t(e, t) {
  21795. if (this.mode === u.DOLLHOUSE) {
  21796. var n = e ? this.model.center.y : n = t.center.y;
  21797. i.call(this, n)
  21798. }
  21799. }
  21800. function i(e) {
  21801. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21802. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21803. , n = t.position.y + (e - i.target.y)
  21804. , r = f.showFloorDuration + f.showFloorDelay;
  21805. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21806. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21807. }
  21808. this.model = this.modelManager.getActiveModel(),
  21809. this.model.on("floor.changed", e.bind(this)),
  21810. this.model.on("allfloors.toggled", t.bind(this)),
  21811. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21812. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21813. var e2 = this;
  21814. this.model.panos.list.forEach(function(a) {
  21815. a.vrMarker.addEventListener("click", function() {
  21816. e2.flyToPano({
  21817. pano: a
  21818. })
  21819. })
  21820. })
  21821. /********************************************************************************************************************************************/
  21822. this.model.addHighMapCube()//add
  21823. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21824. }
  21825. ,
  21826. n.prototype.updateModelDependentData = function() {
  21827. this.cameraControls.setModelForControls(this.model),
  21828. this.getPanoMarkersFromModel(this.model)
  21829. }
  21830. ,
  21831. n.prototype.onModelChanged = function() {
  21832. this.updateModel(),
  21833. this.updateModelDependentData()
  21834. }
  21835. ,
  21836. n.prototype.getPanoMarkersFromModel = function(e) {
  21837. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21838. return t.marker ? e.concat(t.marker) : e
  21839. }, [])
  21840. }
  21841. ,
  21842. n.prototype.handleControlMove = function(e) {
  21843. this.emit(w.Move, e)
  21844. }
  21845. ,
  21846. n.prototype.handleControlInputStart = function(e) {
  21847. this.emit(w.InputStart, e)
  21848. }
  21849. ,
  21850. n.prototype.onModeUpdated = function(e, t) {
  21851. this.cameraControls.activateControls(t),
  21852. this.emit(w.ModeChanged, e, t)
  21853. }
  21854. ,
  21855. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21856. return this.path.warping
  21857. }
  21858. ,
  21859. n.prototype.isWaitingToWarp = function() {
  21860. return this.path.waitingToWarp
  21861. }
  21862. ,
  21863. n.prototype.getLabelScaleFactor = function() {
  21864. if (this.isOutsideMode()) {
  21865. var e = 10
  21866. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21867. return t
  21868. }
  21869. return .5
  21870. }
  21871. ,
  21872. /* n.prototype.changeMusic = function() {//xzw add
  21873. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21874. } */
  21875. n.prototype.bindEvents = function(e) {
  21876. e !== document && e.setAttribute("tabindex", -1),
  21877. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21878. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21879. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21880. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21881. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21882. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21883. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21884. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21885. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21886. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21887. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21888. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21889. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21890. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21891. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21892. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21893. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21894. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21895. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21896. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21897. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21898. // lzb
  21899. window.getSeft && getSeft(this);
  21900. }
  21901. ,
  21902. n.prototype.onMouseDown = function(e) {
  21903. e.currentTarget !== document && e.currentTarget.focus(),
  21904. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21905. this.updateIntersect())
  21906. }
  21907. ,
  21908. n.prototype.onMouseMove = function(e) {
  21909. this.isTouchEvent = !1,
  21910. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21911. }
  21912. ,
  21913. n.prototype.onMouseOver = function(e) {
  21914. this.containsMouse = !0,
  21915. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21916. }
  21917. ,
  21918. n.prototype.onMouseOut = function(e) {
  21919. this.containsMouse = !1
  21920. }
  21921. ,
  21922. n.prototype.onMouseUp = function(e) {
  21923. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21924. }
  21925. ,
  21926. n.prototype.onTouchStart = function(e) {
  21927. if (e.currentTarget !== document && e.currentTarget.focus(),
  21928. !this.mouseDown) {
  21929. this.couldBeLongTap = !0;
  21930. var t = g.average(e.changedTouches, "clientX")
  21931. , i = g.average(e.changedTouches, "clientY");
  21932. this.handleInputStart.call(this, t, i, !0),
  21933. this.mouseDownTimer = setTimeout(function() {
  21934. this.updateIntersect(),
  21935. this.handleInputEnd.call(this, t, i, !0)
  21936. }
  21937. .bind(this), f.input.longTapThreshold)
  21938. }
  21939. }
  21940. ,
  21941. n.prototype.onTouchMove = function(e) {
  21942. var t = g.average(e.changedTouches, "clientX")
  21943. , i = g.average(e.changedTouches, "clientY");
  21944. this.handleInputMove.call(this, t, i, !0)
  21945. }
  21946. ,
  21947. n.prototype.onTouchEnd = function(e) {
  21948. if (clearTimeout(this.mouseDownTimer),
  21949. this.mouseDown) {
  21950. this.couldBeLongTap = !1,
  21951. this.updateIntersect();
  21952. var t = g.average(e.changedTouches, "clientX")
  21953. , i = g.average(e.changedTouches, "clientY");
  21954. this.handleInputEnd.call(this, t, i, !0)
  21955. }
  21956. //add
  21957. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21958. this.intersectHot = null
  21959. Hot.mobileAutoPlay(this)
  21960. }
  21961. ,
  21962. n.prototype.onPointerDown = function(e) {
  21963. return e.currentTarget !== document && e.currentTarget.focus(),
  21964. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21965. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21966. void (this.mouseDownTimer = setTimeout(function() {
  21967. this.updateIntersect(),
  21968. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21969. }
  21970. .bind(this), f.input.longTapThreshold)))
  21971. }
  21972. ,
  21973. n.prototype.onPointerMove = function(e) {
  21974. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21975. }
  21976. ,
  21977. n.prototype.onPointerUp = function(e) {
  21978. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21979. this.couldBeLongTap = !1,
  21980. this.updateIntersect(),
  21981. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21982. }
  21983. ,
  21984. n.prototype.onPointerOut = function(e) {
  21985. this.mouseDown = !1
  21986. }
  21987. ,
  21988. n.prototype.onPointerCancel = function(e) {
  21989. this.mouseDown = !1
  21990. }
  21991. ,
  21992. n.prototype.onKeyDown = function(e) {
  21993. var t = function() {
  21994. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21995. }
  21996. .bind(this)
  21997. , i = e.which;
  21998. switch (i) {
  21999. case p.F:
  22000. t(),
  22001. this.changeFloor(-1);
  22002. break;
  22003. case p.R:
  22004. t(),
  22005. this.changeFloor(1)
  22006. }
  22007. if (this.mode === u.PANORAMA)
  22008. switch (i) {
  22009. case p.UPARROW:
  22010. case p.W:
  22011. this.flyLocalDirection(d.FORWARD.clone());
  22012. break;
  22013. case p.DOWNARROW:
  22014. case p.S:
  22015. this.flyLocalDirection(d.BACK.clone());
  22016. break;
  22017. case p.A:
  22018. this.flyLocalDirection(d.LEFT.clone());
  22019. break;
  22020. case p.D:
  22021. this.flyLocalDirection(d.RIGHT.clone())
  22022. }
  22023. }
  22024. ,
  22025. n.prototype.handleScrollPinchZoom = function() {
  22026. return function(e) {
  22027. var t = e
  22028. , i = this.zoomLevel;
  22029. this.zoomBy(t),
  22030. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22031. }
  22032. }(),
  22033. n.prototype.handleControlPinch = function(e) {
  22034. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22035. }
  22036. ,
  22037. n.prototype.handleControlScroll = function(e) {
  22038. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22039. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22040. }
  22041. ,
  22042. n.prototype.handleInputStart = function(e, t, i) {
  22043. //许钟文加
  22044. var pad = this.handelPadding(e, t);
  22045. e = pad.x;
  22046. t = pad.y;
  22047. this.isTouchEvent = i,
  22048. m.convertScreenPositionToNDC(e, t, this.mouse),
  22049. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22050. this.mouseCouldBeClickToMove = !0,
  22051. this.mouseDown = !0;
  22052. Hot.mobileAutoPlay(this)
  22053. }
  22054. ,
  22055. n.prototype.handelPadding = function(x, y) {
  22056. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22057. if (!this.pad)
  22058. this.pad = {
  22059. x: dom.getOffset("left", $("#player")[0]),
  22060. y: dom.getOffset("top", $("#player")[0])
  22061. }
  22062. return {
  22063. x: x - this.pad.x,
  22064. y: y - this.pad.y
  22065. }
  22066. }
  22067. n.prototype.handleInputMove = function(e, t, i) {
  22068. //许钟文加
  22069. var pad = this.handelPadding(e, t);
  22070. e = pad.x;
  22071. t = pad.y;
  22072. this.isTouchEvent = i,
  22073. m.convertScreenPositionToNDC(e, t, this.mouse),
  22074. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22075. this.couldBeLongTap = !1,
  22076. clearTimeout(this.mouseDownTimer)),
  22077. this.mouseLastMoveTime = Date.now(),
  22078. this.reticule.move(e, t, i)
  22079. }
  22080. ,
  22081. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22082. if (this.isTouchEvent = i,
  22083. this.mouseDown = !1,
  22084. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22085. !i && this.couldBeLongTap)
  22086. return !0;
  22087. if (this.handleLongTap())
  22088. return !0;
  22089. if (this.mouseCouldBeClickToMove) {
  22090. if (this.flying)
  22091. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  22092. !0;
  22093. //add----
  22094. if(this.checkHotClick())//add
  22095. return !0;
  22096. if(this.hoveringPlane){
  22097. this.clickOverlay(this.hoveringPlane)
  22098. return;
  22099. }
  22100. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22101. this.history.invalidate(),
  22102. this.intersect)
  22103. return this.flyToPanoClosestToMouse();
  22104. if (this.mode === u.PANORAMA) {
  22105. var n = this.closestPanoInDirection(this.getMouseDirection());
  22106. return n ? this.flyToPano({
  22107. pano: n
  22108. }) : this.bump(this.getMouseDirection())
  22109. }
  22110. }
  22111. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  22112. }
  22113. ,
  22114. n.prototype.handleLongTap = function() {
  22115. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22116. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22117. !0
  22118. }
  22119. ,
  22120. n.prototype.checktagClick = function() {
  22121. if (this.tagManager.intersectTag) {
  22122. var e = this.isTouchEvent
  22123. , t = this.tagManager.clickedOnTag(e, this);
  22124. return e || t || y.cancelById(V.LookTransition),
  22125. !0
  22126. }
  22127. if (this.tagManager.activeTag)
  22128. return this.tagManager.dismissActiveTag(),
  22129. !1
  22130. }
  22131. ,
  22132. n.prototype.rankedtagInDirection = function(e, t) {
  22133. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22134. }
  22135. ,
  22136. n.prototype.start = function(e) {
  22137. //-------------------
  22138. //-------------------
  22139. var t = e.mode
  22140. , i = e.pano
  22141. , n = e.position
  22142. , rr = e.quaternion
  22143. , o = e.tag
  22144. , a = e.quickstart
  22145. , s = $.Deferred();
  22146. this.updateModelDependentData(),
  22147. this.updateFromControls(),
  22148. this.findDefaultViews();
  22149. var l = this.is360View(t, i);
  22150. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  22151. s.done(function(e) {
  22152. this.emit(w.Ready, l, e, o)
  22153. }
  22154. .bind(this)),
  22155. s.promise()
  22156. }
  22157. ,
  22158. n.prototype.startOutside = function(e, t) {
  22159. var i = e.mode
  22160. , n = e.pano
  22161. , r = e.position
  22162. , o = e.quaternion
  22163. , a = e.zoom
  22164. , s = e.floorVisibility
  22165. , l = e.tag;
  22166. this.emit(w.StartOutside, f[i].transitionTime),
  22167. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22168. y.cancelById(V.FlyToViewFloor),
  22169. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22170. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22171. }
  22172. ,
  22173. n.prototype.startInside = function(e, t, i, n, r) {
  22174. r = r || $.Deferred(),
  22175. this.currentPano = e;
  22176. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22177. window.dispatchEvent(new CustomEvent('playerAndModelReady', { detail: this }));
  22178. this.ready = true
  22179. var o = e && !e.isAligned();
  22180. if (t = o ? e.position : t || e.position,
  22181. i = i || e.quaternion,
  22182. e) {
  22183. var a = this.startInside.bind(this, e, t, i, n, r);
  22184. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22185. return
  22186. }
  22187. //add
  22188. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22189. //this.updateHotVisible()
  22190. Hot.updateVisibles([this.currentPano])
  22191. this.modeTran = "panorama-panorama"
  22192. return this.mode = u.PANORAMA,
  22193. e.floor.enter(this.mode),
  22194. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22195. this.switchCameraMode(this.mode, i),
  22196. this.emit(w.StartInside, o),
  22197. r.resolve(!0),
  22198. r
  22199. }
  22200. ,
  22201. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22202. if (r = r || $.Deferred(),
  22203. this.dollhouseMode(),
  22204. !e)
  22205. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22206. r.resolve(!1),
  22207. r;
  22208. t = t || e.position;
  22209. var o = i || this.cameraControls.activeControl.camera.quaternion
  22210. , a = e.position;
  22211. return this.fitDollhouse(a, t, o),
  22212. setTimeout(function(t) {
  22213. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22214. var n = {
  22215. mode: u.PANORAMA,
  22216. pano: e,
  22217. quaternion: i,
  22218. callback: function() {
  22219. this.emit(w.FlyinFinished),
  22220. r.resolve(!0)
  22221. }
  22222. .bind(this)
  22223. };
  22224. this.flyToNewMode(n)
  22225. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22226. r
  22227. }
  22228. ,
  22229. n.prototype.checkAndWaitForPanoLoad = function() {
  22230. var e = {}
  22231. , t = {}
  22232. , i = 5e3
  22233. , n = function() {
  22234. for (var n in e)
  22235. if (e.hasOwnProperty(n) && e[n]) {
  22236. var r = performance.now() - t[n];
  22237. if (r < i)
  22238. return !0
  22239. }
  22240. return !1
  22241. };
  22242. return function(r, o, a, s, l, c, h, u, d, p) {
  22243. if (n())
  22244. return !0;
  22245. var f = function(t, i, n) {
  22246. N.delayOneFrame(function() {
  22247. e[t] = !1,
  22248. l && l(i, n)
  22249. }
  22250. .bind(this))
  22251. }
  22252. .bind(this, r.id)
  22253. , g = function(t, i) {
  22254. N.delayOneFrame(function() {
  22255. e[t] = !1,
  22256. c && c(i)
  22257. }
  22258. .bind(this))
  22259. }
  22260. .bind(this, r.id);
  22261. try {
  22262. return null !== u && void 0 !== u || (u = !0),
  22263. 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),
  22264. e[r.id] && (t[r.id] = performance.now()),
  22265. e[r.id]
  22266. } catch (n) {
  22267. throw e[r.id] = !1,
  22268. t[r.id] = performance.now() - i,
  22269. n
  22270. }
  22271. }
  22272. }(),
  22273. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22274. if (!e)
  22275. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22276. return r && this.model.waitForLoad(e, function() {
  22277. return e.isLoaded(i)
  22278. }),
  22279. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22280. !0)
  22281. }
  22282. ,
  22283. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22284. var e = new r.Vector3;
  22285. return function(t, i, n, r, o, a, s, l) {
  22286. if (!t)
  22287. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22288. // 周恩光加 loadTiledPano有时会在progress中卡住,此时判断为成功加载
  22289. let isDone = false
  22290. let handle
  22291. return e.copy(d.FORWARD),
  22292. this.getDirection(e),
  22293. !t.isLoaded(i) && (
  22294. a && this.model.waitForLoad(t, function() {
  22295. return t.isLoaded(i)
  22296. }),
  22297. t.loadTiledPano(i, e, null, s, l)
  22298. .done(function(e, t) {
  22299. isDone = true
  22300. n && n(e, t)
  22301. }.bind(this))
  22302. .fail(function(e) {
  22303. r && r(e)
  22304. }.bind(this))
  22305. .progress(function(e, t, i) {
  22306. handle && clearTimeout(handle)
  22307. handle = setTimeout(() => {
  22308. if(isDone == false) n && n(e, t)
  22309. }, 3000) // 卡住3秒判断为加载成功
  22310. o && o(e, t, i)
  22311. }.bind(this)),
  22312. !0
  22313. )
  22314. }
  22315. }(),
  22316. n.prototype.switchCameraMode = function(e, t) {
  22317. var i = this.cameraControls.controls[e]
  22318. , n = i.camera;
  22319. switch (e) {
  22320. case u.PANORAMA:
  22321. n.position.copy(this.currentPano.position);
  22322. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22323. i.lookAt(o.add(n.position));
  22324. break;
  22325. case u.DOLLHOUSE:
  22326. /* var a = this.position.clone();
  22327. 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),
  22328. n.position.copy(a),
  22329. i.target.copy(this.target.clone().setY(this.model.center.y));
  22330. break; */
  22331. //for多楼层 且 让模型刚好适应屏幕
  22332. var box = this.model.boundingBox.clone();
  22333. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22334. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22335. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22336. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22337. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22338. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22339. if(this.mode === u.PANORAMA){
  22340. i.target.copy(this.model.center);
  22341. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22342. }else{
  22343. i.target.copy(this.target.clone().setY(this.model.center.y))
  22344. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22345. }
  22346. vec.multiplyScalar(distance )
  22347. n.position.copy(i.target.clone().add(vec))
  22348. break
  22349. case u.FLOORPLAN:
  22350. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22351. i.target.copy(this.model.center).setY(0),
  22352. i.zoomToContain(this.model.size),
  22353. i.rotateToView(this.model.size, this.getDirection())
  22354. }
  22355. i.update(0)
  22356. }
  22357. ,
  22358. n.prototype.update = function() {
  22359. var e = (new r.Vector3,
  22360. {})
  22361. , t = [];
  22362. return function(i) {
  22363. this.updatePersistentZooming(i),
  22364. this.updateFromControls(i),
  22365. this.getCurrentNodePanos(t)
  22366. this.lastFrameChanged = false
  22367. if(this.hasChanged(e) ) {
  22368. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22369. this.lastChangeTime = Date.now(),
  22370. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22371. this.emit(w.ViewChanged, e),
  22372. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22373. }
  22374. if(e.cameraChanged2){ //变化要更大些
  22375. }
  22376. if(e.cameraChanged){
  22377. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22378. /* for(var i in this.model.hots){
  22379. this.model.hots[i].updateTitle(this)
  22380. } */
  22381. Hot.updateHots()
  22382. }
  22383. this.model.supportsTiles && (this.updateTileDownloader(t),
  22384. this.updatePanoRenderer(t)),
  22385. this.updatePreRendering(t),
  22386. this.reticule.update(),
  22387. this.path.update(),
  22388. this.spider.update(),
  22389. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22390. this.updateControlLocks(),
  22391. this.model.supportsTiles && this.updateZoomPano()
  22392. }
  22393. }(),
  22394. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22395. var lastMode, lastPano;
  22396. return function(){
  22397. var mode = this.mode;
  22398. var pano = mode == "panorama" ? this.currentPano : "";
  22399. if(mode != "panorama" || pano != lastPano){
  22400. overlay.noBlock = null
  22401. }
  22402. this.overlayGroup.children.forEach((overlay)=>{
  22403. if(overlay.overlayType == "video" ){
  22404. var matrix = overlay.plane.matrixWorld;
  22405. var inSight = false;
  22406. var cameraDir = this.getDirection();
  22407. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22408. var vertexes = []
  22409. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22410. for(let i=0; i<4; i++){
  22411. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22412. vertexes.push(vertex)
  22413. if(overlay.noBlock == null){
  22414. if(!m.ifShelter(vertex)){
  22415. overlay.noBlock = true
  22416. }
  22417. inSight = true; break;
  22418. }else{
  22419. overlay.noBlock = true
  22420. }
  22421. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22422. inSight = true; break;
  22423. }
  22424. }
  22425. }
  22426. overlay.inSight = inSight
  22427. if(!inSight)overlay.plane.material.map.image.pause()
  22428. else overlay.plane.material.map.image.play()//maybe fail
  22429. }
  22430. })
  22431. lastMode = mode, lastPano = pano
  22432. }
  22433. }() */
  22434. n.prototype.updatePersistentZooming = function(e) {
  22435. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22436. }
  22437. ,
  22438. n.prototype.updateControlLocks = function() {
  22439. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22440. }
  22441. ,
  22442. n.prototype.updatePanoRenderer = function() {
  22443. var e = new r.Vector3;
  22444. return function(t) {
  22445. var i = this.nextPano || this.currentPano;
  22446. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22447. this.getDirection(e),
  22448. this.panoRenderer.updateDirection(e))
  22449. }
  22450. }(),
  22451. n.prototype.cleanupInactivePanos = function() {
  22452. var e = []
  22453. , t = [];
  22454. return function() {
  22455. e.length = 0,
  22456. e.push(this.currentPano),
  22457. this.nextPano && e.push(this.nextPano),
  22458. t.length = 0;
  22459. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22460. t.push(this.panoRenderer.activePanos[i]);
  22461. for (var n = 0; n < t.length; n++) {
  22462. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22463. r.id === e[a].id && (o = !1);
  22464. o && r.exit()
  22465. }
  22466. }
  22467. }(),
  22468. n.prototype.updatePreRendering = function() {
  22469. var e = {};
  22470. return function(t) {
  22471. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22472. var i = this.nextPano || this.currentPano;
  22473. if (i && t && t.length > 1) {
  22474. var n = t.findIndex(function(e) {
  22475. if (e.id === i.id)
  22476. return !0
  22477. });
  22478. if (n >= 0 && n + 1 < t.length) {
  22479. var r = t[n + 1];
  22480. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22481. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22482. window.setTimeout(function(t) {
  22483. e[t.id] = !1
  22484. }
  22485. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22486. }
  22487. .bind(this, r), f.tiling.panoPreRenderDelay),
  22488. e[r.id] = !0)
  22489. }
  22490. }
  22491. }
  22492. }
  22493. }(),
  22494. n.prototype.enablePreRendering = function() {
  22495. this.preRenderingEnabled = !0
  22496. }
  22497. ,
  22498. n.prototype.disablePreRendering = function() {
  22499. this.preRenderingEnabled = !1,
  22500. this.cleanupInactivePanos()
  22501. }
  22502. ,
  22503. n.prototype.updateTileDownloader = function() {
  22504. var e = new r.Vector3;
  22505. return function(t) {
  22506. var i = this.nextPano || this.currentPano;
  22507. i && (e.copy(d.FORWARD),
  22508. this.getDirection(e),
  22509. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22510. this.tileDownloader.processPriorityQueue = !0)
  22511. }
  22512. }(),
  22513. n.prototype.updateFromControls = function(e) {
  22514. null !== e && void 0 !== e || (e = 0),
  22515. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22516. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22517. this.position.copy(this.cameraControls.activeControl.camera.position),
  22518. this.target.copy(this.cameraControls.activeControl.target),
  22519. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22520. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22521. this.camera.position.copy(this.position),
  22522. this.camera.quaternion.copy(this.quaternion),
  22523. this.camera.updateMatrix(),
  22524. this.camera.updateMatrixWorld()
  22525. }
  22526. ,
  22527. n.prototype.hasChanged = function(e) {
  22528. /* if (!this.previousState)
  22529. return this.previousState = {
  22530. allFloorsVisible: this.model.allFloorsVisible,
  22531. position: this.position.clone(),
  22532. quaternion: this.quaternion.clone(),
  22533. mouse: this.mouse.clone(),
  22534. labelScaleFactor: this.getLabelScaleFactor(),
  22535. currentFloor: this.model.currentFloor,
  22536. projectionMatrix: this.camera.projectionMatrix.clone(),
  22537. worldMatrix: this.camera.matrixWorld.clone(),
  22538. mode: this.mode,
  22539. modelPosition: this.model.position.clone(),
  22540. modelCenter: this.model.center.clone(),
  22541. zoomLevel: this.zoomLevel
  22542. },
  22543. !0;
  22544. 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;
  22545. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22546. e.moved = !this.position.equals(this.previousState.position),
  22547. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22548. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22549. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22550. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22551. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22552. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22553. e.modeChanged = this.mode !== this.previousState.mode,
  22554. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22555. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22556. e.nextPanoActive = null !== this.nextPano,
  22557. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22558. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22559. this.previousState.position.copy(this.position),
  22560. this.previousState.quaternion.copy(this.quaternion),
  22561. this.previousState.mouse.copy(this.mouse),
  22562. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22563. this.previousState.currentFloor = this.model.currentFloor,
  22564. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22565. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22566. this.previousState.mode = this.mode,
  22567. this.previousState.modelPosition.copy(this.model.position),
  22568. this.previousState.modelCenter.copy(this.model.center),
  22569. this.previousState.zoomLevel = this.zoomLevel,
  22570. !t */
  22571. if (!this.previousState)
  22572. {
  22573. this.previousState = {
  22574. allFloorsVisible: this.model.allFloorsVisible,
  22575. position: this.position.clone(),
  22576. quaternion: this.quaternion.clone(),
  22577. mouse: this.mouse.clone(),
  22578. //labelScaleFactor: this.getLabelScaleFactor(),
  22579. currentFloor: this.model.currentFloor,
  22580. projectionMatrix: this.camera.projectionMatrix.clone(),
  22581. worldMatrix: this.camera.matrixWorld.clone(),
  22582. mode: this.mode,
  22583. modelPosition: this.model.position.clone(),
  22584. modelCenter: this.model.center.clone(),
  22585. zoomLevel: this.zoomLevel
  22586. };
  22587. e.cameraChanged = e.cameraChanged2 = true;
  22588. return !0;
  22589. }
  22590. //许钟文改 分成相机是否改变cameraChanged 和其他
  22591. 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)
  22592. 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 ;
  22593. e.cameraChanged = !a;
  22594. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22595. e.moved = !this.position.equals(this.previousState.position),
  22596. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22597. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22598. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22599. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22600. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22601. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22602. e.modeChanged = this.mode !== this.previousState.mode,
  22603. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22604. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22605. e.nextPanoActive = null !== this.nextPano,
  22606. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22607. /* if(e.cameraChanged){//
  22608. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  22609. }else e.cameraChanged2 = false */
  22610. if(e.cameraChanged){
  22611. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22612. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22613. } else {
  22614. e.cameraChanged2 = false
  22615. e.cameraChanged3 = false
  22616. }
  22617. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22618. this.previousState.position.copy(this.position),
  22619. this.previousState.quaternion.copy(this.quaternion),
  22620. this.previousState.mouse.copy(this.mouse),
  22621. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22622. this.previousState.currentFloor = this.model.currentFloor,
  22623. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22624. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22625. this.previousState.mode = this.mode,
  22626. this.previousState.modelPosition.copy(this.model.position),
  22627. this.previousState.modelCenter.copy(this.model.center),
  22628. this.previousState.zoomLevel = this.zoomLevel;
  22629. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22630. return !t
  22631. }
  22632. ,
  22633. n.prototype.updateIntersect = function() {
  22634. var e = this.flying || this.isWarping()
  22635. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22636. , i = y.getById(V.LookTransition)
  22637. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22638. {//clear:
  22639. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22640. this.intersectHot = null
  22641. CursorDeal.remove('hoverHot')
  22642. }
  22643. var deal = ()=>{
  22644. if(this.intersect && this.intersect.object.visible ){
  22645. if("hotSprite" == this.intersect.object.type){
  22646. this.intersectHot = this.intersect.object
  22647. while(!(this.intersectHot instanceof Hot)){
  22648. this.intersectHot = this.intersectHot.parent
  22649. }
  22650. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22651. this.intersectHot.setHoverState(true)
  22652. }
  22653. }
  22654. }
  22655. if(this.model.hotGroup){
  22656. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22657. let colliders = this.model.floors.reduce(function(e, t) {
  22658. return t.hidden ? e : e.concat(t.collider.children)
  22659. }, this.mode === 'panorama' ? this.panoMarkers : [])
  22660. this.intersect = this.getMouseIntersect(null, hots.concat(colliders/* this.model.colliders */));
  22661. if(this.intersect){
  22662. deal()
  22663. let intersect = this.intersect
  22664. if(this.intersectHot){
  22665. this.intersect = null
  22666. CursorDeal.add('hoverHot')
  22667. }else{
  22668. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22669. this.intersect = null
  22670. }
  22671. }
  22672. }
  22673. }else{
  22674. this.intersect = this.getMouseIntersect()
  22675. }
  22676. this.intersect && this.updateClosestPano(this.intersect),
  22677. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22678. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22679. }
  22680. ,
  22681. n.prototype.checkHotClick = function() {
  22682. if(this.intersectHot){
  22683. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22684. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22685. }
  22686. this.intersectHot.examine(this)
  22687. return true;
  22688. }
  22689. },
  22690. n.prototype.getMouseDirection = function(e) {
  22691. e = e || this.mouse;
  22692. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22693. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22694. return i.sub(t).normalize()
  22695. }
  22696. ,
  22697. n.prototype.hoverOverlay = function(mesh){
  22698. if(!mesh){
  22699. this.hoveringPlane = null;
  22700. $("#player").css("cursor",this.currentCursor || "" );
  22701. }else{
  22702. var overlay = mesh.parent;
  22703. $("#player").css("cursor","pointer");
  22704. this.hoveringPlane = overlay;
  22705. return true;
  22706. }
  22707. },
  22708. n.prototype.clickOverlay = function(overlay){
  22709. if(this.openOverlay && !overlay)return;
  22710. var plane = overlay.plane;
  22711. /* if(overlay.overlayType == "video"){
  22712. if(plane.material.map.image.paused) plane.material.map.image.play()
  22713. else plane.material.map.image.pause()
  22714. } */
  22715. if(overlay.overlayType == "video"){
  22716. overlay.switchPlay(!!overlay.pausedByUser)
  22717. }
  22718. /* if(window.EditOverlay &&EditOverlay.editing){
  22719. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22720. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22721. EditOverlay.endAddPlane();
  22722. EditOverlay.updateOverlayPanel(overlay)
  22723. EditOverlay.controlSelectOverlay(overlay)
  22724. return;
  22725. } */
  22726. },
  22727. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22728. e = e || this.mouse.clone(),
  22729. t = t || this.model.floors.reduce(function(e, t) {
  22730. return t.hidden ? e : e.concat(t.collider.children)
  22731. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22732. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22733. this.raycaster.set(i, this.getMouseDirection(e));
  22734. var n = this.raycaster.intersectObjects(t, true);//add true
  22735. var o = n[0];
  22736. if(o){
  22737. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22738. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22739. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22740. o.horizontal = .8 < o.normal.y);
  22741. return o
  22742. }
  22743. }
  22744. ,
  22745. n.prototype.updateClosestPano = function(e) {
  22746. var t = [s.filters.isPanoAligned()];
  22747. if (this.mode === u.PANORAMA) {
  22748. if (!this.currentPano)
  22749. return;
  22750. t.push(s.filters.not(this.currentPano)),
  22751. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22752. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22753. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22754. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22755. } else{
  22756. t.push(s.filters.isOnVisibleFloor()),
  22757. t.push(this.checkHasNeighbor)//add
  22758. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22759. }
  22760. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22761. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22762. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22763. this.closestPano = i,
  22764. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano' ) : CursorDeal.remove('hoverPano' ) //add
  22765. ) : this.isPanoHover = !1
  22766. }
  22767. ,
  22768. n.prototype.dollhouseMode = function(e, t) {
  22769. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22770. this.mode = u.DOLLHOUSE,
  22771. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22772. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22773. , n = new r.Vector3(15,10,15);
  22774. if (e && t) {
  22775. var o = d.FORWARD.clone().applyQuaternion(t)
  22776. , a = this.model.center.clone().sub(e)
  22777. , s = a.dot(o);
  22778. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22779. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22780. }
  22781. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22782. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22783. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22784. this.updateFromControls(),
  22785. this.model.alpha = 1,
  22786. this.model.skybox.material.uniforms.opacity.value = 0
  22787. }
  22788. ,
  22789. n.prototype.insideMode = function(e, t) {
  22790. var i = $.Deferred()
  22791. , n = t || null;
  22792. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22793. var r = [s.filters.isPanoAligned()];
  22794. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22795. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22796. this.flyToNewMode({
  22797. mode: u.PANORAMA,
  22798. pano: e,
  22799. callback: n
  22800. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22801. } else {
  22802. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22803. i.reject(o)
  22804. }
  22805. return i.promise()
  22806. }
  22807. ,
  22808. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22809. //if(urlHasValue('oldEntry')){
  22810. //搬自一代。
  22811. var maxY = this.model.boundingBox.max.y;
  22812. var n = d.FORWARD.clone().applyQuaternion(i)
  22813. , i = n.clone().add(e);
  22814. this.cameraControls.activeControl.target.copy(i),
  22815. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22816. //return;
  22817. /* //this.camera.position.copy(this.model.center);
  22818. //this.camera.updateMatrixWorld()
  22819. this.switchCameraMode("dollhouse", i) */
  22820. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22821. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22822. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22823. this.cameraControls.activeControl.target.copy(n).add(e);
  22824. var o = d.RIGHT.clone().applyQuaternion(i)
  22825. , a = d.UP.clone()
  22826. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22827. , l = this.model.boundingBox.max.clone()
  22828. , c = this.model.boundingBox.min.clone()
  22829. , 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)]
  22830. , u = 0
  22831. , p = 0
  22832. , g = 0;
  22833. h.forEach(function(e, t, i) {
  22834. var n = Math.abs(e.dot(o))
  22835. , r = e.dot(s);
  22836. n > u && (u = n,
  22837. p = r),
  22838. r > g && (g = r)
  22839. });
  22840. 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)))
  22841. , v = s.clone().multiplyScalar(p).add(t)
  22842. , A = s.clone().multiplyScalar(g).add(t);
  22843. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22844. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22845. p = Math.max(p, 10),
  22846. g = Math.max(g, 10);
  22847. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22848. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22849. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22850. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22851. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22852. */
  22853. }
  22854. ,
  22855. n.prototype.floorplanMode = function(e, t, i) {
  22856. this.mode = u.FLOORPLAN;
  22857. var n = this.cameraControls.controls[u.FLOORPLAN];
  22858. n.reset();
  22859. var r = e ? e : this.model.center;
  22860. if (n.target.copy(r).setY(0),
  22861. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22862. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22863. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22864. t) {
  22865. var o = d.LEFT.clone().applyQuaternion(t);
  22866. n.rotateLeft(-Math.atan2(o.x, o.z))
  22867. } else
  22868. n.rotateToView(this.model.size, this.getDirection());
  22869. n.update(0)
  22870. }
  22871. ,
  22872. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22873. return e.skipWarpingCheck = !0,
  22874. this.flyToPano(e, t)
  22875. }
  22876. ,
  22877. n.prototype.updateMarkerVisi = function() {//加
  22878. if(this.mode != "panorama")return;
  22879. this.model.panos.list.forEach((pano)=>{
  22880. if(!pano.marker)return;
  22881. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22882. })
  22883. }
  22884. ,
  22885. /* n.prototype.updateHotVisible = function(pano){
  22886. var hots = this.model.hots;
  22887. pano = pano || this.currentPano;
  22888. for (var index in hots){
  22889. var visible;
  22890. if(this.mode != "panorama"){
  22891. visible = true;
  22892. }else{
  22893. //hots[index].mesh.material.depthTest = false;
  22894. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22895. }
  22896. hots[index].mesh.visible = visible;
  22897. }
  22898. }
  22899. */
  22900. n.prototype.flyToPano = function(e, t) {
  22901. var i = e.pano
  22902. , aim = e.lookAtPoint
  22903. , aimQua = e.quaternion //ADD
  22904. , o = e.duration
  22905. , a = e.aimDuration
  22906. , s = e.maxDistanceOverride
  22907. , l = e.skipWarpingCheck
  22908. , c = e.constantMoveSpeed
  22909. , h = null
  22910. , p = null
  22911. //-----add-------
  22912. let blackList = ['1','2','3']
  22913. if(blackList.includes(this.currentPano.id) || blackList.includes(i.id)){
  22914. return this.blackToPano(e)
  22915. }
  22916. //-------------------
  22917. if (aim){
  22918. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22919. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22920. }
  22921. else aimQua = aimQua
  22922. var zoomLevel = e.zoomLevel || 1 //add
  22923. if(this.flying) return t && t(e)
  22924. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22925. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22926. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22927. t && t(),
  22928. !1;
  22929. if (this.updateLastView(),
  22930. this.mode !== u.PANORAMA) {
  22931. var m;
  22932. return void this.flyToNewMode({
  22933. mode: u.PANORAMA,
  22934. pano: i,
  22935. duration: o,
  22936. quaternion: aimQua ,
  22937. callback: t
  22938. })
  22939. }
  22940. if (!i || (h = g.deepExtend(e),
  22941. p = function() {
  22942. N.delayOneFrame(function() {
  22943. this.flyToPano(h, t)
  22944. }
  22945. .bind(this))
  22946. }
  22947. .bind(this),
  22948. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22949. var C = function(e) {
  22950. t && t(e)
  22951. }
  22952. .bind(this);
  22953. this.currentPano || (this.currentPano = i,
  22954. this.path.placeCpm(),
  22955. this.path.fadeOutCpm(f.path.fadeOutTime),
  22956. this.spider.draw());
  22957. var I = o;
  22958. if ("number" != typeof o) {
  22959. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22960. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22961. }
  22962. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22963. zoomLevel !== this.zoomLevel)
  22964. switch (f.zoom.transitionStyle) {
  22965. case 1:
  22966. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22967. break;
  22968. case 2:
  22969. return h = g.deepExtend(e),
  22970. p = this.flyToPano.bind(this, h, t),
  22971. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22972. }
  22973. if (aimQua) {
  22974. y.cancelById(V.LookTransition),
  22975. I *= f.transition.aimSlowFactor;
  22976. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22977. , S = b.clone()
  22978. , M = new r.Vector3;
  22979. if (i === this.currentPano) {
  22980. var R = d.FORWARD.clone().applyQuaternion(b)
  22981. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22982. , O = R.angleTo(P);
  22983. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22984. void y.start(function(e) {
  22985. S.copy(b),
  22986. v.quaternion(S, aimQua)(e),
  22987. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22988. this.cameraControls.activeControl.lookAt(M)
  22989. }
  22990. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22991. }
  22992. }
  22993. if (i === this.currentPano )
  22994. return void C();
  22995. this.flying = !0;
  22996. var L = this.position.clone()
  22997. , D = this.currentPano;
  22998. F.debug("Flying to pano ", i.position),
  22999. this.emit(w.PanoChosen, this.currentPano, i),
  23000. this.emit(w.FlyingStarted, i.position, L, i, D)
  23001. //---------before fly--------------- add
  23002. //this.updateHotVisible(i); //更新热点显示
  23003. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  23004. Hot.updateVisibles([this.currentPano, i],'every')
  23005. //地标变化
  23006. if(this.model.floorLogos){
  23007. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  23008. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  23009. //this.model.adjustfloorLogoHeight();
  23010. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  23011. this.model.floorLogos[1].visible = true;
  23012. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  23013. }
  23014. //=======================================
  23015. this.nextPano = i
  23016. aimQua && y.start(function(e) {
  23017. S.copy(b),
  23018. v.quaternion(S, aimQua)(e),
  23019. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23020. this.cameraControls.activeControl.lookAt(M)
  23021. }
  23022. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  23023. var B = c ? null : A[f.transition.movementEasing];
  23024. this.nextPano = i,
  23025. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  23026. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  23027. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  23028. this.flying = !1,
  23029. this.currentPano !== i && this.currentPano.exit(),
  23030. i.enter(),
  23031. this.currentPano = i,
  23032. this.nextPano = null,
  23033. this.path.placeCpm(),
  23034. this.path.fadeOutCpm(f.path.fadeOutTime),
  23035. this.spider.draw(),
  23036. this.emit(w.FlyingEnded, i.position, L, i, D),
  23037. this.updateMarkerVisi(),//add
  23038. C(e)
  23039. //add:
  23040. if(this.mode == "panorama" ){
  23041. if(this.model.floorLogos){
  23042. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23043. //this.model.adjustfloorLogoHeight()
  23044. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23045. this.model.floorLogos[1].visible = false;
  23046. }
  23047. this.model.fadePanoMarkers()//add
  23048. Hot.updateVisibles([this.currentPano])//add
  23049. }
  23050. }
  23051. .bind(this), 0, B, "camFly", V.FlyToPano)
  23052. }
  23053. }
  23054. ,
  23055. n.prototype.warpToPano = function(o={}) {
  23056. }
  23057. n.prototype.blackToPano = function(o={},callback) {//add 瞬间过渡
  23058. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  23059. if(this.flying || this.isWarping() )return;
  23060. let pano = o.pano || this.model.panos.index[o.panoId]
  23061. if (this.mode !== u.PANORAMA) {
  23062. var m;
  23063. void this.flyToNewMode({
  23064. mode: u.PANORAMA,
  23065. pano ,
  23066. duration: o.duration,
  23067. quaternion: o.quaternion ,
  23068. callback
  23069. })
  23070. }
  23071. let oldPos = this.position.clone();
  23072. let oldPano = this.currentPano
  23073. this.path.warpDestPano = pano
  23074. var retry = ()=>{
  23075. this.waitingToWarp = !1,
  23076. this.blackToPano(o,callback)
  23077. }
  23078. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  23079. return void (this.waitingToWarp = !0)
  23080. /* if(window.momentTourBlackNewType == 1) { */
  23081. this.flying = true
  23082. this.nextPano = pano //提前加载高清图片
  23083. this.path.warpDestHeroLoc = {
  23084. panoId : pano.id,
  23085. position: pano.position,
  23086. quaternion: o.quaternion || this.quaternion.clone()
  23087. }
  23088. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  23089. pano != this.currentPano && this.currentPano.exit()
  23090. pano.enter()
  23091. this.currentPano = pano
  23092. this.flying = false
  23093. this.nextPano = null
  23094. this.updateMarkerVisi();//add
  23095. callback && callback()
  23096. } )
  23097. }
  23098. window._transitionPosId = 9999
  23099. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23100. y.cancelById(_transitionPosId)
  23101. var begin = function(object, pos, qua, scale){
  23102. if(pos){
  23103. if(!same(object.position, pos, 0.01)){
  23104. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23105. object.updateScale()
  23106. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23107. }
  23108. if(qua && !same(object.quaternion, qua, 1e-6)){
  23109. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23110. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23111. }
  23112. if(scale && !same(object.scale, scale, 0.001)){
  23113. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23114. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23115. }
  23116. }
  23117. }
  23118. var same = function(vec1, vec2, diff){
  23119. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23120. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23121. return s
  23122. }
  23123. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23124. for(let i in this.model.hots){//是否判断visible?
  23125. var hot = this.model.hots[i];
  23126. var panoData = hot.info.transformAtPanos[sid];
  23127. var useCustom = !panoData
  23128. //if(hot.usingTransformData || !useCustom){
  23129. var pos = useCustom ? hot.info.position : panoData.pos;
  23130. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  23131. var scale = useCustom ? hot.info.scale : panoData.scale;
  23132. begin(hot, pos , qua, scale )
  23133. //}
  23134. }
  23135. if(o.callback){
  23136. setTimeout(()=>{
  23137. o.callback()
  23138. },o.dur + 16) ;//姑且这么写
  23139. }
  23140. }
  23141. window._tranOutsideFocus = 4399
  23142. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23143. console.log("focusPoint")
  23144. if(this.mode == "floorplan"){
  23145. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23146. var control = this.cameraControls.controls.floorplan;
  23147. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23148. var currentScale = control.absoluteScale;
  23149. var currentTarget = control.target.clone()
  23150. y.cancelById(window._tranOutsideFocus, true);
  23151. y.start(function(progress){
  23152. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23153. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23154. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23155. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23156. }else if(player.mode == "dollhouse"){
  23157. var control = player.cameraControls.controls.dollhouse;
  23158. var radius = o.radius || 8;
  23159. var currentTarget = control.target.clone()
  23160. var dir = control.offset.clone().normalize()
  23161. var currentRadius = control.offset.length();
  23162. y.cancelById(window._tranOutsideFocus, true);
  23163. y.start(function(progress){
  23164. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23165. let radius_ = radius*progress+currentRadius*(1-progress)
  23166. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23167. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23168. }else if(this.mode == 'panorama'){
  23169. this.flyToPano({
  23170. lookAtPoint: o.aim.clone() ,
  23171. pano: this.currentPano,
  23172. aimDuration: o.dur || 600
  23173. })
  23174. }
  23175. }
  23176. /*
  23177. 切换到某个模式后再执行函数
  23178. */
  23179. n.prototype.FlyToMode = function(mode, f1, duration){
  23180. var f2;
  23181. if (this.mode == mode) {
  23182. f1 && f1()
  23183. } else {
  23184. f2 = f1;
  23185. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  23186. this.afterCModeFuc = function() {
  23187. /* objects.gui.modeChange[mode](null, {
  23188. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  23189. }); */
  23190. this.afterCModeFuc = f2
  23191. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  23192. //callback : f2
  23193. });
  23194. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  23195. }.bind(this)
  23196. } else {
  23197. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  23198. this.afterCModeFuc = f2;//飞入后执行
  23199. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  23200. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  23201. }catch(e){
  23202. console.log('FlyToMode遇到问题?')
  23203. }
  23204. }
  23205. }
  23206. }
  23207. n.prototype.fastForwardActivePanoFlight = function(e) {
  23208. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  23209. y.adjustSpeed(V.FlyToPano, e)
  23210. y.adjustSpeed(V.LookTransition, e)
  23211. }
  23212. ,
  23213. n.prototype.flyToPanoClosestToMouse = function() {
  23214. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23215. this.intersect && this.updateClosestPano(this.intersect)),
  23216. this.closestPano)
  23217. return this.flyToPano({
  23218. pano: this.closestPano
  23219. });
  23220. var e = this.getMouseDirection();
  23221. this.flyDirection(e) || this.flyToPano({
  23222. pano: this.currentPano
  23223. })
  23224. }
  23225. ,
  23226. n.prototype.flyLocalDirection = function(e) {
  23227. var t = this.getDirection(e)
  23228. , i = 1 === e.z ? .4 : .75
  23229. , n = 1 === Math.abs(e.x);
  23230. return this.flyDirection(t, i, n)
  23231. }
  23232. ,
  23233. n.prototype.flyDirection = function(e, t, i) {
  23234. Hot.closePopup();//xzw add
  23235. var n = $.Deferred();
  23236. this.history.invalidate();
  23237. var r = this.closestPanoInDirection(e, t, i);
  23238. return r ? this.flyToPano({
  23239. pano: r
  23240. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23241. n.resolve(!1)),
  23242. n.promise()
  23243. }
  23244. ,
  23245. n.prototype.closestPanoInDirection = function(e, t, i) {
  23246. return this.rankedPanoInDirection(0, e, t, i)
  23247. }
  23248. ,
  23249. n.prototype.rankedPanoInDirection = function() {
  23250. var e = {
  23251. pano: null,
  23252. candidates: []
  23253. };
  23254. return function(t, i, n, r) {
  23255. t || (t = 0),
  23256. n = void 0 !== n ? n : .75;
  23257. var o = r ? "angle" : "direction";
  23258. return this.model.panos.findRankedByScore(t,
  23259. [s.filters.isPanoAligned(),
  23260. s.filters.not(this.currentPano),
  23261. s.filters.isNeighbourPanoTo(this.currentPano),
  23262. s.filters.inPanoDirection(this.position, i, n)],
  23263. [s.scoreFunctions.distanceSquared(this.currentPano),
  23264. s.scoreFunctions[o](this.position, i)], e),
  23265. this.cachedPanoCandidates = e.candidates,
  23266. e.pano
  23267. }
  23268. }(),
  23269. n.prototype.bump = function(e) {
  23270. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23271. 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;
  23272. if (s)
  23273. t = function() {
  23274. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23275. }
  23276. .bind(this),
  23277. i = function() {
  23278. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23279. }
  23280. .bind(this);
  23281. else {
  23282. var l = this.camera.position.clone()
  23283. , c = e.clone();
  23284. this.raycaster.set(l, c);
  23285. var h = this.model.floors.reduce(function(e, t) {
  23286. return e.concat(t.collider.children)
  23287. }, [])
  23288. , d = this.raycaster.intersectObjects(h)
  23289. , p = d.length > 0 ? d[0].distance / 25 : .04
  23290. , g = l.clone().add(c.multiplyScalar(p));
  23291. t = function() {
  23292. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23293. }
  23294. .bind(this),
  23295. i = function() {
  23296. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23297. }
  23298. .bind(this)
  23299. }
  23300. n = function() {
  23301. this.flying = !1
  23302. }
  23303. .bind(this),
  23304. this.flying = !0,
  23305. t()
  23306. }
  23307. }
  23308. ,
  23309. n.prototype.changeFloor = function(e) {
  23310. if (!this.is360View(this.mode, this.currentPano))
  23311. if (this.mode === u.PANORAMA) {
  23312. var t = this.history.reversePano(e);
  23313. t && t.isAligned() ? this.flyToPano({
  23314. pano: t
  23315. }) : this.changeFloorByScore(e)
  23316. } else
  23317. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23318. }
  23319. ,
  23320. n.prototype.changeFloorByScore = function() {
  23321. var e = {
  23322. pano: null,
  23323. candidates: []
  23324. };
  23325. return function(t) {
  23326. var i = this.model.nextFloor(t);
  23327. 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),
  23328. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23329. this.history.push(t, this.currentPano),
  23330. this.flyToPano({
  23331. pano: e.pano
  23332. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23333. }
  23334. }(),
  23335. n.prototype.gotoFloor = function(e) {
  23336. var t = e - this.model.currentFloor.floorIndex;
  23337. this.changeFloor(t)
  23338. }
  23339. ,
  23340. n.prototype.getDirection = function(e) {
  23341. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23342. e.applyQuaternion(this.camera.quaternion)
  23343. }
  23344. ,
  23345. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23346. if (o = o || $.Deferred(),
  23347. this.mode === u.TRANSITIONING)
  23348. return F.warn("should not be transitioning here"),
  23349. n && n(!1),
  23350. o.reject().promise();
  23351. var a = i || !1
  23352. , s = i ? i.position : this.position
  23353. , l = this.position.clone()
  23354. , c = this.currentPano;
  23355. if (F.debug("New pose in mode " + this.mode),
  23356. !e || (retryCallback = function() {
  23357. N.delayOneFrame(function() {
  23358. this.flyToSameMode(e, t, i, n, o)
  23359. }
  23360. .bind(this))
  23361. }
  23362. .bind(this),
  23363. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23364. var h = function() {
  23365. this.emit(w.FlyingEnded, s, l, e, c),
  23366. n && n(!0)
  23367. }
  23368. .bind(this)
  23369. , d = f[this.mode]
  23370. , p = void 0 !== t ? t : d.transitionTime
  23371. , g = new r.Vector3
  23372. , C = new r.Vector3;
  23373. if (this.emit(w.FlyingStarted, s, l, e, c),
  23374. this.mode === u.PANORAMA)
  23375. F.warn("we should not be here for panorama views");
  23376. else if (this.mode === u.DOLLHOUSE)
  23377. if (a) {
  23378. var I = new r.Vector3(0,1,0);
  23379. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23380. this.model.warpDestFloors(i.floorVisibility),
  23381. C.copy(i.position);
  23382. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23383. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23384. , _ = b.intersectObjects(this.model.colliders)
  23385. , T = 3;
  23386. _.length ? (g.copy(_[0].point),
  23387. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23388. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23389. var x = (new r.Matrix4).lookAt(C, g, I)
  23390. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23391. , M = g.distanceTo(C)
  23392. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23393. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23394. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23395. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23396. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23397. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23398. this.path.burnsDir = Math.sign(L.y);
  23399. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23400. , B = new r.Vector3;
  23401. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23402. y.start(function(e, t) {
  23403. D.x = P.x + e * L.x,
  23404. D.y = P.y + e * L.y,
  23405. D.z = P.z + e * L.z;
  23406. var i = O + e * (M - O);
  23407. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23408. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23409. }
  23410. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23411. y.start(function(e, t) {
  23412. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23413. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23414. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23415. }
  23416. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23417. } else
  23418. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23419. else if (this.path.placeCpm(),
  23420. this.path.fadeInCpm(f.path.fadeInTime),
  23421. i) {
  23422. this.model.warpDestFloors(i.floorVisibility);
  23423. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23424. , k = this.cameraControls.controls[u.FLOORPLAN]
  23425. , H = k.target.clone()
  23426. , G = i.position.clone().sub(H)
  23427. , z = U.position.clone().sub(k.target)
  23428. , W = z.length()
  23429. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23430. , Y = Math.atan2(k.offset.x, k.offset.z)
  23431. , X = Math.atan2(j.x, j.z)
  23432. , Z = k.absoluteScale
  23433. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23434. y.start(function(e, t) {
  23435. k.target.copy(G).multiplyScalar(e).add(H);
  23436. var i = Y + (X - Y) * e;
  23437. k.offset.x = W * Math.sin(i),
  23438. k.offset.z = W * Math.cos(i),
  23439. U.position.copy(k.target).add(k.offset),
  23440. k.absoluteScale = Z + e * (q - Z),
  23441. k.update(),
  23442. this.quaternion.copy(U.quaternion),
  23443. this.position.copy(U.position),
  23444. this.target.copy(k.target),
  23445. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23446. }
  23447. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23448. } else
  23449. F.info("flyToSameMode() funny floorplan view? skipping");
  23450. return y.setTimeout(function(e) {
  23451. this.mode = e,
  23452. h(),
  23453. o.resolve(!0)
  23454. }
  23455. .bind(this, this.mode), p, V.FlyToSameMode),
  23456. this.mode = u.TRANSITIONING,
  23457. o.promise()
  23458. }
  23459. }
  23460. ,
  23461. n.prototype.flyToNewMode = function(e, t) {
  23462. Hot.closePopup();//xzw add
  23463. e = e || {};
  23464. var i = e.mode
  23465. , n = e.pano
  23466. , o = e.duration
  23467. , a = e.warpDest
  23468. , s = e.callback
  23469. , l = e.force
  23470. , c = e.quaternion;
  23471. if (t = t || $.Deferred(),
  23472. this.isWarping())
  23473. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23474. s && s(!1),
  23475. t.reject("Cannot change mode during tour transition").promise();
  23476. if (this.mode === u.TRANSITIONING)
  23477. return s && s(!1),
  23478. t.reject("Cannot change mode during mode transition").promise();
  23479. if (i === this.mode)
  23480. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23481. t.promise()) : (s && s(!1),
  23482. t.reject("Already in " + i + " mode").promise());
  23483. var h = a || !1;
  23484. F.debug("Switching mode to " + i);
  23485. if (window.vrEnabled && i != 'panorama'){
  23486. return s && s(!1), t.reject("vr不允许飞出").promise();
  23487. }
  23488. var d = function() {
  23489. N.delayOneFrame(function() {
  23490. this.flyToNewMode(e, t)
  23491. }
  23492. .bind(this))
  23493. }
  23494. .bind(this);
  23495. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23496. return t.promise();
  23497. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23498. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23499. this.model.waitForLoad(this.model, function() {
  23500. return this.model.meshTexturesLoaded;
  23501. }
  23502. .bind(this)),
  23503. this.model.loadMeshTextures().done(d),
  23504. t.promise();
  23505. this.history.invalidate(),
  23506. this.updateLastView();
  23507. var p = this.mode
  23508. , C = this.cameraControls.cameras[i];
  23509. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23510. var I = void 0 !== o ? o : e.transitionTime;
  23511. this.emit(w.ModeChanging, p, i, n, I),
  23512. n && (this.currentPano = n),
  23513. this.switchCameraMode(i, c),
  23514. y.cancelById(V.LookTransition);
  23515. //before fly---------------------
  23516. this.modeTran = p + "-" + i; //add
  23517. if(this.mode == "panorama"){
  23518. if(this.model.floorLogos){
  23519. this.model.floorLogos[0].visible = false;
  23520. this.model.floorLogos[1].visible = false;
  23521. }
  23522. }
  23523. if(i == "panorama"){
  23524. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23525. }else{
  23526. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23527. }
  23528. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23529. window.dispatchEvent(new CustomEvent('playerAndModelReady', { detail: this }));
  23530. this.ready = true
  23531. //------------------------------------
  23532. var _ = (new r.Vector3).copy(this.position);
  23533. if (i === u.PANORAMA){
  23534. this.emit(w.PanoChosen, n, n),
  23535. setTimeout(function() {
  23536. n.floor.enter(i)
  23537. }
  23538. .bind(this), I / 2),
  23539. this.path.fadeOutCpm(f.path.fadeOutTime);
  23540. if(this.model.floorLogos){
  23541. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23542. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23543. }
  23544. }else if (i === u.DOLLHOUSE) {
  23545. if (h && (this.model.stayPut = !0),
  23546. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23547. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23548. this.path.placeCpm(),
  23549. this.path.fadeInCpm(f.path.fadeInTime),
  23550. h) {
  23551. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23552. _.set(15, 10, 15);
  23553. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23554. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23555. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23556. P.length ? (T.copy(P[0].point),
  23557. _.copy(a.position),
  23558. 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),
  23559. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23560. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23561. _.add(this.model.position),
  23562. C.position.copy(_),
  23563. this.cameraControls.controls[u.DOLLHOUSE].update()
  23564. }
  23565. } else if (this.path.placeCpm(),
  23566. this.path.fadeInCpm(f.path.fadeInTime),
  23567. a) {
  23568. this.model.warpDestFloors(a.floorVisibility);
  23569. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23570. , L = this.cameraControls.controls[u.FLOORPLAN]
  23571. , D = O.position.clone().sub(L.target)
  23572. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23573. , U = Math.atan2(B.x, B.z);
  23574. L.target.copy(a.position);
  23575. var k = D.length();
  23576. L.offset.x = k * Math.sin(U),
  23577. L.offset.y = 0,
  23578. L.offset.z = k * Math.cos(U),
  23579. O.position.copy(L.target).add(L.offset);
  23580. L.target.clone().sub(C.position);
  23581. C.quaternion.copy(a.quaternion),
  23582. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23583. L.absoluteScale = L.currentScale,
  23584. L.update()
  23585. } else
  23586. this.model.currentFloor.enter(i);
  23587. var H = this.currentPano
  23588. , G = this.position.clone();
  23589. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23590. this.flying = !0,
  23591. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23592. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23593. C.controls.update()),
  23594. e.blackoutStyle = S.FADEIN,
  23595. I = f.show360Views.transitionTime,
  23596. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23597. this.mode = i,
  23598. this.path && this.path.popOutCpm(),
  23599. e.blackoutStyle = S.END,
  23600. I = f.show360Views.transitionTime,
  23601. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23602. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23603. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23604. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23605. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23606. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23607. y.setTimeout(function() {
  23608. this.flying = !1,
  23609. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23610. this.currentPano.enter(),
  23611. this.path.placeCpm(),
  23612. this.path.fadeOutCpm(f.path.fadeOutTime),
  23613. this.spider.draw()),
  23614. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23615. this.mode = i,
  23616. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23617. //add:
  23618. this.updateMarkerVisi() ;
  23619. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23620. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23621. this.model.floorLogos[0].visible = true
  23622. )
  23623. if (this.afterCModeFuc) {
  23624. //手动加的函数
  23625. var cf = this.afterCModeFuc;
  23626. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23627. cf();
  23628. }
  23629. if(this.mode == u.PANORAMA){
  23630. Hot.updateVisibles([this.currentPano])
  23631. this.model.fadePanoMarkers()
  23632. }else{
  23633. Hot.updateVisibles(true)
  23634. this.model.hotGroup.children.forEach(overlay=>{
  23635. if(overlay.animateInfo){
  23636. GifTexDeal.start(overlay.animation)
  23637. }
  23638. })
  23639. }
  23640. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23641. t.resolve())
  23642. }
  23643. .bind(this), I, V.FlyToNewMode),
  23644. this.mode = u.TRANSITIONING,
  23645. t.promise()
  23646. }
  23647. ,
  23648. n.prototype.fade360View = function(e, t, i) {
  23649. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23650. $(this.domElement).fadeOut(.5 * e, function() {
  23651. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23652. this.model.alpha = i.modelAlpha,
  23653. this.position.copy(t.position),
  23654. this.quaternion.copy(t.quaternion),
  23655. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23656. $(this.domElement).fadeIn(.5 * e)
  23657. }
  23658. .bind(this))
  23659. }
  23660. ,
  23661. n.prototype.findDefaultViews = function() {
  23662. this.findDefaultView(this.lastInsideView, !0),
  23663. this.findDefaultView(this.last360View, !1)
  23664. }
  23665. ,
  23666. n.prototype.findDefaultView = function(e, t) {
  23667. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23668. if (e.cameraMode !== u.PANORAMA)
  23669. return !1;
  23670. var i = r.get(e.panoId);
  23671. return i && i.isAligned() === t
  23672. });
  23673. o >= 0 ? (i = r.get(n[o].panoId),
  23674. e.update({
  23675. cameraMode: u.PANORAMA,
  23676. pano: i,
  23677. position: n[o].position,
  23678. quaternion: n[o].quaternion
  23679. })) : (o = r.list.findIndex(function(e) {
  23680. return e.isAligned() === t
  23681. }),
  23682. o >= 0 ? (i = r.list[o],
  23683. e.update({
  23684. cameraMode: u.PANORAMA,
  23685. pano: i,
  23686. position: i.position
  23687. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23688. }
  23689. ,
  23690. n.prototype.updateLastView = function() {
  23691. if (this.mode === u.PANORAMA) {
  23692. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23693. e.update({
  23694. pano: this.currentPano,
  23695. position: this.position,
  23696. quaternion: this.quaternion
  23697. })
  23698. }
  23699. }
  23700. ,
  23701. n.prototype.goToLastView = function(e, t) {
  23702. var i = $.Deferred()
  23703. , n = i.resolve.bind(i)
  23704. , r = i.reject.bind(i)
  23705. , o = e ? this.lastInsideView : this.last360View;
  23706. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23707. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23708. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23709. mode: o.cameraMode,
  23710. pano: o.pano,
  23711. quaternion: o.quaternion,
  23712. callback: t
  23713. }).done(n).fail(r),
  23714. i.promise()
  23715. }
  23716. ,
  23717. n.prototype.fadeToView = function(e, t, i, n) {
  23718. var r = $.Deferred()
  23719. , o = r.resolve.bind(r)
  23720. , a = r.reject.bind(r);
  23721. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23722. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23723. a("Cannot go to illegal view"),
  23724. r.promise();
  23725. var s = (f[t.cameraMode],
  23726. function() {
  23727. $(this.domElement).fadeIn(.5 * i),
  23728. n && n(),
  23729. o()
  23730. }
  23731. .bind(this))
  23732. , l = e ? S.FADEIN : S.END;
  23733. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23734. $(this.domElement).fadeOut(.5 * i, function() {
  23735. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23736. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23737. pano: t.pano,
  23738. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23739. duration: 0
  23740. }, s) : this.flyToNewMode({
  23741. mode: t.cameraMode,
  23742. quaternion: t.quaternion,
  23743. duration: 0,
  23744. callback: s
  23745. })
  23746. }
  23747. .bind(this)),
  23748. r.promise()
  23749. }
  23750. ,
  23751. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23752. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23753. this.flying)
  23754. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23755. o && o(),
  23756. !1;
  23757. null !== e && void 0 !== e || (e = b.Show),
  23758. this.history.invalidate()
  23759. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23760. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23761. return this.emit(w.WarpStarted, a, i, n, r),
  23762. n = n || S.MIDDLE,
  23763. this.path.warpToPano(i, n, r, function() {
  23764. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23765. this.emit(w.WarpEnded, i),
  23766. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23767. o && o()
  23768. }
  23769. .bind(this)),
  23770. e === b.Hide && this.path.discardPathObject(),
  23771. !0
  23772. }
  23773. ,
  23774. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23775. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23776. s && s(),
  23777. !1)
  23778. }
  23779. ,
  23780. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23781. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23782. a && a(),
  23783. !1)
  23784. }
  23785. ,
  23786. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23787. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23788. }
  23789. ,
  23790. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23791. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23792. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23793. t && t(),
  23794. !1)
  23795. }
  23796. ,
  23797. n.prototype.aimTourCamera = function(e, t, i, n) {
  23798. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23799. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23800. }
  23801. ,
  23802. n.prototype.showPathToHeroLocation = function(e) {
  23803. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23804. }
  23805. ,
  23806. n.prototype.tourInterlude = function(e, t) {
  23807. return //xzw add
  23808. this.history.invalidate();
  23809. this.path.discardSlow();
  23810. //xzw:
  23811. var defaultRotTime = DATA.tourRotTime * 1000
  23812. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23813. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23814. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23815. //zeg 标注一下
  23816. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23817. var rotTime
  23818. if( currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23819. var hasMusic
  23820. //if(!settings.tourSoundUnable){
  23821. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  23822. hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23823. if(hasMusic){
  23824. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23825. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23826. rotTime = currentLocation0.musicInfo.time - current
  23827. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23828. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23829. }
  23830. }else{
  23831. rotTime = defaultRotTime
  23832. }
  23833. //}else{//区域音频 好难写。因为我不知道会不会导览的时候走重复的路
  23834. //hasMusic =
  23835. //}
  23836. rotTime = Math.max(0, rotTime)
  23837. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E")
  23838. }else{
  23839. rotTime = currentLocation.rotTime * 1000
  23840. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23841. }
  23842. this.path.waitNextStep(e, function() {
  23843. t && t()
  23844. }.bind(this), rotTime)
  23845. }
  23846. ,
  23847. n.prototype.stopInterlude = function() {
  23848. this.interruptAndFastForward(null, 0)
  23849. }
  23850. ,
  23851. n.prototype.interruptAndFastForward = function(e, t) {
  23852. //Log('interruptAndFastForward' , '#f00')
  23853. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23854. this.flying && this.emit(w.FlyingInterrupted),
  23855. this.path.interruptAndFastForward(e, t)
  23856. }
  23857. ,
  23858. n.prototype.setSize = function(e, t) {
  23859. var i = e / t;
  23860. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23861. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23862. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23863. for (var r in this.cameraControls.cameras) {
  23864. var o = this.cameraControls.cameras[r];
  23865. o.fov = this.baseFov * (1 / this.zoomLevel),
  23866. o.updateAspect(i)
  23867. }
  23868. }
  23869. ,
  23870. n.prototype.toJSON = function() {
  23871. var e = {};
  23872. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23873. e.camera_mode = u.toInt(this.mode),
  23874. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23875. return e.hidden ? 0 : 1
  23876. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23877. e) : e
  23878. }
  23879. ,
  23880. n.prototype.getCurrentNodePanos = function(e) {
  23881. this.model.panos.map;
  23882. if (e.length = 0, this.path.nodes){
  23883. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23884. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23885. if(this.path.nodes.length){
  23886. e.push(this.model.panos.get(this.path.nodes[0]))
  23887. }
  23888. if(this.path.nodes.length>1){
  23889. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23890. }
  23891. }else{
  23892. for (var t = 0; t < this.path.nodes.length; t++) {
  23893. var i = this.path.nodes[t];
  23894. e.push(this.model.panos.get(i))
  23895. }
  23896. }
  23897. }
  23898. }
  23899. ,
  23900. n.prototype.zoomIncrementally = function(e) {
  23901. var t = this.zoomLevel;
  23902. this.zoomTo(this.zoomLevel + e),
  23903. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23904. }
  23905. ,
  23906. n.prototype.zoomInIncrementally = function(e) {
  23907. e = e || this.defaultZoomIncrement,
  23908. this.zoomIncrementally(e)
  23909. }
  23910. ,
  23911. n.prototype.zoomOutIncrementally = function(e) {
  23912. e = e || -this.defaultZoomIncrement,
  23913. this.zoomIncrementally(e)
  23914. }
  23915. ,
  23916. n.prototype.zoomBy = function(e) {
  23917. this.zoomTo(this.zoomLevel * e)
  23918. }
  23919. ,
  23920. n.prototype.zoomIn = function() {
  23921. this.zoomBy(1 + this.zoomSpeed)
  23922. }
  23923. ,
  23924. n.prototype.zoomOut = function() {
  23925. this.zoomBy(1 - this.zoomSpeed)
  23926. }
  23927. ,
  23928. n.prototype.zoomTo = function(e, t) {
  23929. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23930. if (e < f.zoom.min && (e = f.zoom.min),
  23931. e > f.zoom.max && (e = f.zoom.max),
  23932. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23933. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23934. e === f.zoom.min && this.emit(O.ZoomMin)),
  23935. this.cameraControls.activeControl) {
  23936. var i = this.cameraControls.activeControl.camera;
  23937. this.zoomLevel = e,
  23938. i.fov = this.baseFov * (1 / this.zoomLevel),
  23939. i.updateProjectionMatrix(),
  23940. this.zoomFov = i.fov
  23941. }
  23942. }
  23943. }
  23944. ,
  23945. n.prototype.increaseZoomSpeed = function() {
  23946. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23947. }
  23948. ,
  23949. n.prototype.decreaseZoomSpeed = function() {
  23950. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23951. }
  23952. ,
  23953. n.prototype.clampZoomSpeed = function(e) {
  23954. return e < 0 ? 0 : e
  23955. }
  23956. ,
  23957. n.prototype.activatePersistentZooming = function(e) {
  23958. this.zooming = e ? 1 : -1
  23959. }
  23960. ,
  23961. n.prototype.deactivatePersistentZooming = function() {
  23962. this.zooming = 0
  23963. }
  23964. ,
  23965. n.prototype.zoomDefault = function() {
  23966. this.zoomTo(1, !0)
  23967. }
  23968. ,
  23969. window.fovTranId = 333;//add
  23970. n.prototype.smoothZoomToDefault = function(e, t) {
  23971. y.cancelById(window.fovTranId)
  23972. var i, n = this.zoomLevel,
  23973. r = function(e) {
  23974. e > 1 && (e = 1),
  23975. i = n * (1 - e) + e,
  23976. this.zoomTo(i, !0)
  23977. }.bind(this),
  23978. o = function() {
  23979. this.zoomDefault(),
  23980. t && window.setTimeout(t, 50)
  23981. }.bind(this);
  23982. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23983. }
  23984. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23985. y.cancelById(window.fovTranId)
  23986. console.log("smoothZoomFovTo "+zoomLevel)
  23987. var i,
  23988. n = this.zoomLevel,
  23989. aimLevel = zoomLevel || this.baseFov / fov
  23990. if (n == aimLevel) return
  23991. var fun = function (e) {
  23992. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23993. this.zoomTo(i, !0)
  23994. }.bind(this)
  23995. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23996. }
  23997. n.prototype.updateZoomPano = function() {
  23998. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23999. let navTileClass = this.qualityManager.getNavZoomClass()
  24000. let tileClass = this.qualityManager.getMaxZoomClass()
  24001. if(navTileClass == '4k'){
  24002. var r = true
  24003. }else{
  24004. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  24005. var t = this.zoomLevel > levelThreshold1
  24006. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  24007. , n = !i && !this.isWarping()
  24008. , r = t //&& n ; // 允许flying状态下加载4K图
  24009. }
  24010. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  24011. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  24012. var o = function(pano, ifZoom) {
  24013. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  24014. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  24015. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  24016. pano.setZoomed(ifZoom)
  24017. }.bind(this);
  24018. if(navTileClass == '4k'){
  24019. if (!this.currentPano.zoomed) {
  24020. o(this.currentPano, !0);
  24021. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  24022. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  24023. o(this.currentPano, !0)
  24024. }
  24025. .bind(this));
  24026. }
  24027. }else{
  24028. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  24029. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  24030. this.currentPano.zoomed || o(this.currentPano, !0);
  24031. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  24032. this.panoRenderer.enableHighQuality( function() {//开启2k
  24033. if(tileClass != '4k'){
  24034. o(this.currentPano, !0);
  24035. }
  24036. }.bind(this));
  24037. }else{
  24038. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  24039. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  24040. o(this.currentPano, !0)
  24041. }.bind(this));
  24042. }
  24043. } else {
  24044. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  24045. }
  24046. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  24047. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  24048. var change = (zoomedFlag)=>{
  24049. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  24050. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  24051. //this.currentPano.setZoomed(t);//更新uniforms贴图
  24052. if(this.qualityManager.zoomLevelResolution == '4k'){
  24053. this.model.showHighMap()
  24054. }else{
  24055. this.model.hideHighMap()
  24056. }
  24057. }
  24058. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  24059. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  24060. change()
  24061. o(this.currentPano, t)
  24062. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  24063. change()
  24064. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  24065. change()
  24066. o(this.currentPano, t)
  24067. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  24068. change()
  24069. }
  24070. this.oldZoomLevel = this.zoomLevel
  24071. }
  24072. }
  24073. }
  24074. }
  24075. n.prototype.checkHasNeighbor = function(pano){//add
  24076. for(var i in pano.neighbourPanos ){
  24077. if(i == pano.id)continue;
  24078. if(pano.neighbourPanos[i]){
  24079. return true;
  24080. }
  24081. }
  24082. }
  24083. ,
  24084. t.exports = n
  24085. }
  24086. ).call(this, "/js/player.js")
  24087. }
  24088. , {
  24089. "./constants": 8,
  24090. "./enum/AlignmentType": 17,
  24091. "./enum/BlackoutStyle": 18,
  24092. "./enum/ControlEvents": 21,
  24093. "./enum/Keys": 30,
  24094. "./enum/ModelManagerEvents": 33,
  24095. "./enum/PanoSizeClass": 36,
  24096. "./enum/PanoramaEvents": 37,
  24097. "./enum/PathDiscardMode": 38,
  24098. "./enum/PathDisplayMode": 39,
  24099. "./enum/PlayerEvents": 40,
  24100. "./enum/TagStates": 44,
  24101. "./enum/Vectors": 50,
  24102. "./enum/Viewmode": 51,
  24103. "./enum/WarpStyle": 52,
  24104. "./enum/ZoomEvents": 53,
  24105. "./exception/BasicException": 55,
  24106. "./model/ModelManager": 140,
  24107. "./objects/NSpider": 147,
  24108. "./objects/Panorama": 148,
  24109. "./objects/Reticule": 149,
  24110. "./objects/ShowPath": 151,
  24111. "./objects/Snapshot": 153,
  24112. "./objects/View": 154,
  24113. "./settings": 166,
  24114. "./shaders": 167,
  24115. "./tile/TileDownloader": 171,
  24116. "./tile/TilePrioritizer": 172,
  24117. "./util/ZoomStats": 179,
  24118. "./util/browser": 182,
  24119. "./util/camera": 183,
  24120. "./util/cameraLight": 184,
  24121. "./util/common": 185,
  24122. "./util/easing": 186,
  24123. "./util/history": 187,
  24124. "./util/lerp": 188,
  24125. "./util/logger": 189,
  24126. "./util/math": 190,
  24127. "./util/transitions": 195,
  24128. "hot":"hot",
  24129. "scaleImg":"scaleImg",
  24130. events: 202,
  24131. three: 217
  24132. }],
  24133. "scaleImg":[function(t, e){// xzw
  24134. var OUTPUT = e;
  24135. (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")}
  24136. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24137. 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}
  24138. return G.getImageData(0,0,s,f)}
  24139. 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}
  24140. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24141. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24142. 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}
  24143. else
  24144. 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)
  24145. 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)
  24146. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24147. 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)
  24148. 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)
  24149. W=new Float32Array(at);else
  24150. for(W=[],et=0;at>et;++et)
  24151. W[et]=0;for(b=0;w>b;b++)
  24152. 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)
  24153. 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;}
  24154. delete p,h(),J=n(W)}
  24155. 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}
  24156. if("png-src"===i||"jpeg-src"===i)
  24157. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24158. return B}
  24159. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24160. OUTPUT.exports = c;
  24161. }, {}
  24162. ],
  24163. 156: [function(e, t, i) {
  24164. (function(i) {
  24165. "use strict";
  24166. function n(e, t) {
  24167. this.model = e,
  24168. this.panos = e.panos,
  24169. this.player = t,
  24170. this.imagePanos = this.listImagePanos(),
  24171. this.retryMinimumTime = 1e4
  24172. }
  24173. var r = (e("three"),
  24174. e("./enum/Viewmode"))
  24175. , o = (e("./settings"),
  24176. e("./objects/Panorama"))
  24177. , a = e("./util/logger")
  24178. , s = new a(i);
  24179. n.prototype.start = function() {
  24180. this.loadNextPano(function(e) {
  24181. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24182. setTimeout(function() {
  24183. this.start()
  24184. }
  24185. .bind(this), 1e3))
  24186. }
  24187. .bind(this))
  24188. }
  24189. ,
  24190. n.prototype.validLoadTarget = function(e) {
  24191. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24192. }
  24193. ,
  24194. n.prototype.listImagePanos = function() {
  24195. var e = []
  24196. , t = this;
  24197. return this.model.images.forEach(function(i) {
  24198. if (i.metadata && i.metadata.scan_id) {
  24199. var n = t.model.panos.get(i.metadata.scan_id);
  24200. n && !n.isLoaded("high") && e.push(n)
  24201. }
  24202. }),
  24203. e
  24204. }
  24205. ,
  24206. n.prototype.nextNotLoadedImage = function() {
  24207. for (; this.imagePanos.length > 0; ) {
  24208. var e = this.imagePanos[0];
  24209. if (!e.isLoaded("high"))
  24210. return e;
  24211. this.imagePanos.shift()
  24212. }
  24213. return null
  24214. }
  24215. ,
  24216. n.prototype.loadNextPano = function(e) {
  24217. var t, i, n = this.model.waitQueue.filter(function(e) {
  24218. return e.object instanceof o
  24219. });
  24220. n.length > 0 ? (t = n[0].object,
  24221. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24222. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24223. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24224. t = this.imagePanos[0],
  24225. 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())]),
  24226. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24227. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24228. s.debug("Preloading " + i + "-res pano " + t.id),
  24229. t.loadCube(i).done(e).fail(function() {
  24230. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24231. e()
  24232. })) : e && e(null)
  24233. }
  24234. ,
  24235. t.exports = n
  24236. }
  24237. ).call(this, "/js/preloaders.js")
  24238. }
  24239. , {
  24240. "./enum/Viewmode": 51,
  24241. "./objects/Panorama": 148,
  24242. "./settings": 166,
  24243. "./util/logger": 189,
  24244. three: 217
  24245. }],
  24246. 157: [function(e, t, i) {
  24247. (function(i) {
  24248. "use strict";
  24249. function n(e, t, i, n, r) {
  24250. this.qualityManager = e,
  24251. this.scene = t,
  24252. this.camera = i,
  24253. this.container = r,
  24254. this.controls = n,
  24255. this.controls.enabled = !0,
  24256. this.controls.locked = !0,
  24257. this.quickstartCamera = n.camera,
  24258. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24259. this.skybox = null
  24260. }
  24261. var r = e("three")
  24262. , o = e("../util/logger")
  24263. , a = e("../constants")
  24264. , s = (e("../util/transitions"),
  24265. e("../util/lerp"),
  24266. e("../util/easing"),
  24267. e("../enum/Vectors"))
  24268. , l = e("../enum/PanoSizeClass")
  24269. , c = (e("../materials/ModelTextureMaterial"),
  24270. e("../materials/CubemapMaterial"))
  24271. , h = (e("../cameras/PanoramaCamera"),
  24272. e("../controls/PanoramaControls"),
  24273. e("../tile/TileUtils"),
  24274. e("../util/camera"),
  24275. e("../util/cameraLight"))
  24276. , u = (e("../util/browser"),
  24277. e("../settings"),
  24278. e("../gui/helpManager"),
  24279. new o(i));
  24280. n.prototype.load = function(e) {
  24281. e.pano.shouldRedrawOnBaseLoaded = !0;
  24282. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24283. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24284. var a = this.qualityManager.getPanoSize(l.BASE)
  24285. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24286. if (e.pano.tiled) {
  24287. u.warn("Loading startPano, TILED", e.pano.id);
  24288. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24289. , p = this.quickstartCamera.fov;
  24290. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24291. t = e.pano.loadTiledPano(c, r, {
  24292. hFov: d,
  24293. vFov: p
  24294. }, !1, !1, !0),
  24295. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24296. } else
  24297. u.warn("Loading startPano", e.pano.id),
  24298. t = e.pano.loadCube("high");
  24299. return $.when(t).then(function() {
  24300. n.init(e.pano, e.quaternion),
  24301. e.pano.tiled ? i.done(function() {
  24302. e.pano.lockUntilRenderingComplete = !1,
  24303. this.controls.locked = !1
  24304. }
  24305. .bind(this)) : this.controls.locked = !1
  24306. }
  24307. .bind(this))
  24308. }
  24309. ,
  24310. n.prototype.init = function(e, t) {
  24311. u.info("Quickstart done loading, adding scene objects"),
  24312. e.lockUntilRenderingComplete = !0,
  24313. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24314. side: r.BackSide
  24315. })),
  24316. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24317. this.skybox.quaternion.copy(e.quaternion),
  24318. this.scene.add(this.skybox),
  24319. $(this.container).show()
  24320. }
  24321. ,
  24322. n.prototype.update = function(e) {
  24323. this.controls.update(e),
  24324. this.camera.copy(this.quickstartCamera)
  24325. }
  24326. ,
  24327. n.prototype.setSize = function(e, t) {
  24328. this.quickstartCamera.updateAspect(e / t)
  24329. }
  24330. ,
  24331. n.prototype.destroy = function() {
  24332. this.scene.remove(this.skybox)
  24333. }
  24334. ,
  24335. t.exports = n
  24336. }
  24337. ).call(this, "/js/scene/QuickstartManager.js")
  24338. }
  24339. , {
  24340. "../cameras/PanoramaCamera": 7,
  24341. "../constants": 8,
  24342. "../controls/PanoramaControls": 13,
  24343. "../enum/PanoSizeClass": 36,
  24344. "../enum/Vectors": 50,
  24345. "../gui/helpManager": 68,
  24346. "../materials/CubemapMaterial": 117,
  24347. "../materials/ModelTextureMaterial": 118,
  24348. "../settings": 166,
  24349. "../tile/TileUtils": 174,
  24350. "../util/browser": 182,
  24351. "../util/camera": 183,
  24352. "../util/cameraLight": 184,
  24353. "../util/easing": 186,
  24354. "../util/lerp": 188,
  24355. "../util/logger": 189,
  24356. "../util/transitions": 195,
  24357. three: 217
  24358. }],
  24359. 158: [function(e, t, i) {
  24360. "use strict";
  24361. function n(e, t, i) {
  24362. this.scene = e,
  24363. this.camera = t,
  24364. this.renderer = null,
  24365. this.effects = i,
  24366. this.animateCallback = null,
  24367. this.composer = null,
  24368. this.qualityManager = null,
  24369. e.renderWidth = 0,
  24370. e.renderHeight = 0,
  24371. this.updateClock = new r.Clock,
  24372. this.components = [],
  24373. this.updateListeners = [],
  24374. this.resizeListeners = [],
  24375. this.forceUpdateSize = !1,
  24376. this.started = !1,
  24377. this.textures = {},
  24378. this.suspendedObjects = []
  24379. }
  24380. var r = e("three")
  24381. , o = e("../shaders")
  24382. , a = e("../enum/SceneRendererEvents")
  24383. , s = e("../enum/GLTextureType")
  24384. , l = e("../enum/GLCubeFaces")
  24385. , c = e("../exception/BasicException")
  24386. , h = e("../exception/RendererCreationException")
  24387. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24388. , m = e("../util/browser")
  24389. /**************************************************************************************************************************************************/
  24390. , u = e("../settings")
  24391. , d = e("events").EventEmitter;
  24392. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24393. n.prototype = Object.create(d.prototype),
  24394. n.prototype.addComponent = function(e) {
  24395. this.components.push(e),
  24396. e.update && this.updateListeners.push(e),
  24397. e.setSize && (this.resizeListeners.push(e),
  24398. this.forceUpdateSize = !0)
  24399. }
  24400. ,
  24401. n.prototype.removeComponent = function(e) {
  24402. var t = function(t) {
  24403. return t !== e
  24404. };
  24405. this.components = this.components.filter(t),
  24406. this.updateListeners = this.updateListeners.filter(t),
  24407. this.resizeListeners = this.resizeListeners.filter(t)
  24408. }
  24409. ,
  24410. n.prototype.start = function(e) {
  24411. if (this.started)
  24412. throw new c("Can't start SceneRenderer, already started");
  24413. this.createContext(e),
  24414. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24415. m.isMobile() && this.boluoVrInit(),
  24416. /*******************************************************************************************************************************/
  24417. this.initComposer(),
  24418. this.started = !0,
  24419. (p = p.bind(this))()
  24420. }
  24421. ,
  24422. n.prototype.createContext = function(e) {
  24423. var transparent = !!(settings.transparentBg || settings.bgImg)
  24424. try {
  24425. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24426. this.renderer.autoClear = !0,
  24427. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24428. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24429. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24430. this.emit(a.ContextCreated)
  24431. } catch (e) {
  24432. throw new h("Unable to create a WebGL rendering context")
  24433. }
  24434. u.profiling.enabled && this.overrideTextures(),
  24435. e.appendChild(this.renderer.domElement)
  24436. /* window.stats = new Stats();
  24437. e.appendChild( stats.dom ); */
  24438. }
  24439. ,
  24440. n.prototype.overrideTextures = function() {
  24441. var e = this.renderer.context
  24442. , t = 0
  24443. , i = e.createTexture;
  24444. e.createTexture = function() {
  24445. var n = i.call(e);
  24446. return n.id = t++,
  24447. this.textures[n.id] = n,
  24448. n
  24449. }
  24450. .bind(this);
  24451. var n = e.texImage2D;
  24452. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24453. var d, p = this.getTextureTypeFromTarget(e, t);
  24454. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24455. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24456. h = a,
  24457. u = l,
  24458. o = u.naturalWidth,
  24459. a = u.naturalHeight,
  24460. n.call(e, t, i, r, c, h, u));
  24461. var f = this.textures[d.id];
  24462. f.width = p === s.TextureCube ? 6 * o : o,
  24463. f.height = a
  24464. }
  24465. .bind(this);
  24466. var r = e.deleteTexture;
  24467. e.deleteTexture = function(t) {
  24468. delete this.textures[t.id],
  24469. r.call(e, t)
  24470. }
  24471. .bind(this)
  24472. }
  24473. ,
  24474. n.prototype.updateTextureMemory = function() {
  24475. var e = null;
  24476. return function() {
  24477. var t = 0;
  24478. for (var i in this.textures) {
  24479. var n = this.textures[i];
  24480. n.width && n.height && (t += n.width * n.height * 4)
  24481. }
  24482. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24483. e = t
  24484. }
  24485. }(),
  24486. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24487. switch (t) {
  24488. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24489. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24490. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24491. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24492. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24493. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24494. return s.TextureCube;
  24495. case e.TEXTURE_2D:
  24496. return s.Texture2D;
  24497. default:
  24498. return null
  24499. }
  24500. }
  24501. ,
  24502. n.prototype.initComposer = function() {
  24503. this.composer = new r.EffectComposer(this.renderer),
  24504. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24505. //this.composer.addPass(this.effects.hblurPass),
  24506. //this.composer.addPass(this.effects.vblurPass)
  24507. this.composer.addPass(this.effects.transitionMaskPass)//add
  24508. }
  24509. ,
  24510. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24511. this.renderWidth = e,
  24512. this.renderHeight = t,
  24513. this.effects.aspect = e / t,
  24514. /* this.renderer.setSize(e, t), -----MP */
  24515. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24516. this.composer.setSize(e, t);
  24517. for (var i = 0; i < this.resizeListeners.length; i++)
  24518. this.resizeListeners[i].setSize(e, t)
  24519. }
  24520. ,
  24521. n.prototype.render = function() {
  24522. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24523. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24524. }
  24525. /******************************************************************************************************徐世廷**********************************************************************/
  24526. var vrPermission = {};
  24527. var vrPermissionCallBack = function(info1,info2){
  24528. if(info1 == "reset"){
  24529. vrPermission = {};
  24530. }else{
  24531. vrPermission[info1] = info2
  24532. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24533. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24534. }
  24535. }
  24536. }
  24537. n.prototype.boluoVrInit = function() {
  24538. console.log("boluoVrInit")
  24539. this.isHuawei5X = m.detectHUAWEI5X(),
  24540. this.oldRenderer = this.renderer,
  24541. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24542. window.panoCamera = this.camera;
  24543. var a = this;
  24544. window._vrEnabled = !1,
  24545. Object.defineProperty(window, "vrEnabled", {
  24546. get: function() {
  24547. return window._vrEnabled
  24548. },
  24549. set: function(b) {
  24550. b = !!b,
  24551. b ? (a.renderer = a.newRenderer,
  24552. window.vrMarkers.forEach(function(a) {
  24553. a.visible = !0
  24554. })) : (a.renderer = a.oldRenderer,
  24555. window.vrMarkers.forEach(function(a) {
  24556. a.visible = !1
  24557. })),
  24558. a.cursor.visible = b,
  24559. a.setSize(window.innerWidth, window.innerHeight),
  24560. window._vrEnabled = b
  24561. $('.cad').css('visibility',b?'hidden':'')
  24562. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24563. if(b){
  24564. setTimeout(function(){
  24565. console.log("orientEnable"+window.orientEnable)
  24566. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24567. if(m.detectIOS()/* && m.detectSafari() */){
  24568. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24569. console.log("开始获取权限 major"+b.major)
  24570. if(b.major == 12 && b.minor>=2){
  24571. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24572. else{//app??
  24573. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24574. }
  24575. }else if(b.major >= 13){
  24576. if(!window.location.href.includes("https://")){
  24577. console.log("需要https");
  24578. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24579. return;
  24580. }
  24581. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24582. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24583. if(!window.vrEnabled || window.orientEnable)return;
  24584. vrPermissionCallBack("reset")
  24585. console.log(window.DeviceMotionEvent)
  24586. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24587. console.log("开始获取权限1")
  24588. ///注意:需要https 本地服务器permissionState会得到denied
  24589. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24590. console.log("permissionState1: "+permissionState)
  24591. vrPermissionCallBack("deviceMotion", permissionState)
  24592. }).catch(function(e){
  24593. vrPermissionCallBack("deviceMotion", false)
  24594. console.log(e)
  24595. })
  24596. }else{
  24597. console.log("window.DeviceMotionEvent undefined")
  24598. vrPermissionCallBack("deviceMotion", false)
  24599. }
  24600. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24601. console.log("开始获取权限2")
  24602. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24603. console.log("permissionState2: "+permissionState)
  24604. vrPermissionCallBack("deviceOrientation", permissionState)
  24605. }).catch(function(e){
  24606. vrPermissionCallBack("deviceOrientation", false)
  24607. console.log(e)
  24608. })
  24609. }else{
  24610. console.log("window.DeviceOrientationEvent undefined")
  24611. vrPermissionCallBack("deviceOrientation", false)
  24612. }
  24613. },hasFailed ? 0 : 150)
  24614. /* /* setTimeout(function(){
  24615. if(settings.vrEnabled && !window.orientEnable){
  24616. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24617. }
  24618. },4000) */
  24619. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24620. }else{
  24621. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24622. }
  24623. }else{
  24624. //已经触发了
  24625. }
  24626. },200);
  24627. }
  24628. }
  24629. }),
  24630. this.createCursor(.5, !1, 1, 16777215, 0);
  24631. var b = {
  24632. setSize: function(b, c) {
  24633. a.camera.aspect = b / c
  24634. }
  24635. };
  24636. this.resizeListeners.push(b),
  24637. this.vrLoadingInit()
  24638. }
  24639. ,
  24640. n.prototype.vrLoadingInit = function() {
  24641. var a = function(camera) {
  24642. var a = this
  24643. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24644. , c = new r.MeshBasicMaterial({
  24645. color: 4967932,
  24646. side: r.DoubleSide
  24647. })
  24648. , d = new r.Mesh(b,c);
  24649. this.mesh = d,
  24650. d.position.z = -2,
  24651. d.scale.set(.08, .08, .08),
  24652. d.visible = !1,
  24653. camera.add(d),
  24654. //window.player.camera.add(d),
  24655. a.enabled = !1,
  24656. this.update = function(b) {
  24657. 1 == a.enabled && (d.rotation.z += 15 * b)
  24658. }
  24659. }
  24660. , a = new a(this.camera);
  24661. window.Loading = a,
  24662. this.updateListeners.push(a)
  24663. }
  24664. ,
  24665. n.prototype.createCursor = function(a, b, c, d, e) {
  24666. var g, h = new r.SpriteMaterial({
  24667. opacity: c,
  24668. color: d,
  24669. transparent: b,
  24670. map: this.boluoGetTexture("static/images/cursor.png"),
  24671. needsUpdate: !0,
  24672. side: r.DoubleSide
  24673. });
  24674. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24675. h.map.repeat = new r.Vector2(1 / 17,1),
  24676. h.depthTest = !1,
  24677. h.blending = r.AdditiveBlending,
  24678. g = new r.Sprite(h),
  24679. // g.scale.set(a, a, a),
  24680. g.scale.set(.3,.3,.3)
  24681. g.position.z = -2,
  24682. g.visible = !1,
  24683. g.name = "cursor",
  24684. this.camera.add(g),
  24685. this.scene.add(this.camera),
  24686. this.cursor = g;
  24687. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24688. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24689. this.updateListeners.push(i)
  24690. }
  24691. ,
  24692. window.orientEnable = 0; //是否能触发deviceorientation
  24693. n.prototype.CursorAnimation = function(a, b, c) {
  24694. function d() {
  24695. g.orient = r.Math.degToRad(window.orientation || 0)
  24696. }
  24697. function e(a) {
  24698. if(!window.vrEnabled && window.orientEnable) return;
  24699. window.orientEnable || (window.orientEnable = 1);
  24700. var b = r.Math.degToRad(a.alpha)
  24701. , c = r.Math.degToRad(a.beta)
  24702. , d = r.Math.degToRad(a.gamma);
  24703. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24704. -1e3 === g.beta && (g.beta = c),
  24705. -1e3 === g.gamma && (g.gamma = d),
  24706. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24707. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24708. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24709. g.beta = c,
  24710. g.gamma = d),
  24711. n.vrDebug) {
  24712. $("#info-device-orientation").css("display", "block");
  24713. var e = "";
  24714. e += "alpha=(" + g.alpha + ")<BR/>",
  24715. e += "beta=(" + g.beta + ")<BR/>",
  24716. e += "gamma=" + g.gamma + "<BR/>",
  24717. document.getElementById("info-device-orientation").innerHTML = e
  24718. }
  24719. }
  24720. this.cursor = b,
  24721. this.raycaster = new r.Raycaster,
  24722. this.targetEventObj = {},
  24723. this.type = 1,
  24724. this.tweenFlag = !0;
  24725. var g = this;
  24726. this.target = c,
  24727. console.log(c.uuid),
  24728. this.euler = new r.Euler,
  24729. this.q0 = new r.Quaternion,
  24730. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24731. this.zee = new r.Vector3(0,0,1),
  24732. this.alpha = -1e3,
  24733. this.beta = -1e3,
  24734. this.gamma = -1e3,
  24735. this.orient = r.Math.degToRad(window.orientation || 0),
  24736. window.addEventListener("orientationchange", d),
  24737. window.addEventListener("deviceorientation", e),
  24738. this.setObjectQuaternion = function(a, b, d, e, f) {
  24739. g.euler.set(d, b, -e, "YXZ"),
  24740. a.setFromEuler(g.euler),
  24741. a.multiply(g.q1),
  24742. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24743. c.updateMatrixWorld()
  24744. }
  24745. ,
  24746. parent !== window && window.addEventListener("message", function(a) {
  24747. var b = JSON.parse(a.data)
  24748. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24749. b && b.alpha && b.beta && b.gamma && function(a) {
  24750. var c = r.Math.degToRad(b.alpha)
  24751. , d = r.Math.degToRad(b.beta)
  24752. , e = r.Math.degToRad(b.gamma);
  24753. a ? (-1e3 === g.alpha && (g.alpha = c),
  24754. -1e3 === g.beta && (g.beta = d),
  24755. -1e3 === g.gamma && (g.gamma = e),
  24756. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24757. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24758. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24759. g.beta = d,
  24760. g.gamma = e)
  24761. }(c)
  24762. }),
  24763. this.update = function(a) {
  24764. TWEEN.update();
  24765. if (window.vrEnabled) {
  24766. if (window.ifTest) this.triggerTargetEvent()//测试时不根据陀螺仪来转向
  24767. else {
  24768. console.log('his.update ')
  24769. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24770. this.triggerTargetEvent()
  24771. }
  24772. }
  24773. }
  24774. ,
  24775. this.triggerTargetEvent = function() {
  24776. var a = this.choseObj()
  24777. , b = a ? a.object : void 0;
  24778. this.targetEventObj.currentObj = b,
  24779. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24780. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24781. b && b.enabled && this.startAnimate(function() {
  24782. this.clickCallback(b)
  24783. }
  24784. .bind(this))) : this.type,
  24785. this.targetEventObj.lastObj = b)
  24786. }
  24787. ,
  24788. this.choseObj = function() {
  24789. this.raycaster.setFromCamera({
  24790. x: 0,
  24791. y: 0
  24792. }, c);
  24793. var a = (this.raycaster.ray,
  24794. window.vrMarkers)
  24795. , b = this.raycaster.intersectObjects(a);
  24796. if (b.length > 0)
  24797. return b[0]
  24798. }
  24799. ,
  24800. this.clickCallback = function(a) {
  24801. this.runTHREEAction(a, "onclick")
  24802. }
  24803. ,
  24804. this.runTHREEAction = function(a, b) {
  24805. switch (b) {
  24806. case "onclick":
  24807. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24808. a()
  24809. });
  24810. break;
  24811. case "onhover":
  24812. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24813. a()
  24814. });
  24815. break;
  24816. case "onout":
  24817. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24818. a()
  24819. })
  24820. }
  24821. }
  24822. ,
  24823. this.startAnimate = function(a) {
  24824. this.tweenFlag && this.initAnimation(a)
  24825. }
  24826. ,
  24827. this.initAnimation = function(a) {
  24828. var b = this
  24829. , c = this.cursor.material.map.offset
  24830. , d = function(a) {
  24831. return Math.floor(17 * a) / 17
  24832. };
  24833. b.tweenFlag = !1,
  24834. this.cursorAnimate = new TWEEN.Tween(c).to({
  24835. x: 1
  24836. }, 1e3).onStart(function() {
  24837. b.tweenFlag = !1
  24838. }).onStop(function() {
  24839. b.tweenFlag = !0,
  24840. this.x = 0,
  24841. c.x = 0
  24842. }).onUpdate(function() {}).onComplete(function() {
  24843. a(),
  24844. c.x = 0,
  24845. setTimeout(function() {
  24846. b.tweenFlag = !0
  24847. }, 1500)
  24848. }),
  24849. this.cursorAnimate.easing(d),
  24850. this.cursorAnimate.start()
  24851. }
  24852. ,
  24853. this.autoCursorPosition = function(a) {
  24854. // var b = Math.abs(a.distance - 10);
  24855. // this.cursor.position.z = -b,
  24856. // b /= 10;
  24857. // alert(b);
  24858. // this.cursor.scale.set(b, b, b)
  24859. this.cursor.scale.set(.3,.3,.3)
  24860. }
  24861. }
  24862. ,
  24863. n.prototype.vrRenderer = function(a, b, c) {
  24864. var d = new b.vrCamera(c);
  24865. d.bananaAspect = .8,
  24866. this.width,
  24867. this.height;
  24868. var b = this;
  24869. this.setSize = function(c, d) {
  24870. a.setSize.call(this, c, d),
  24871. b.width = c,
  24872. b.height = d
  24873. }
  24874. ,
  24875. this.render = function(b, c, e, f) {
  24876. window.cameraQua = c.quaternion.clone();
  24877. var g, h;
  24878. if (c.__RESS__SKIP__STEREO__)
  24879. return a.render(b, c, e, f);
  24880. if ("PerspectiveCamera" === c.type)
  24881. g = d.cameraL,
  24882. h = d.cameraR,
  24883. b.updateMatrixWorld(),
  24884. null === c.parent && c.updateMatrixWorld(),
  24885. d.vrCameraUpdate(c);
  24886. else {
  24887. if ("OrthographicCamera" !== c.type)
  24888. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24889. g = h = c
  24890. }
  24891. a.setScissorTest(!0),
  24892. a.setScissor(0, 0, this.width / 2, this.height),
  24893. a.setViewport(0, 0, this.width / 2, this.height),
  24894. a.render.call(this, b, g, e, f),
  24895. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24896. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24897. a.render.call(this, b, h, e, f),
  24898. a.setScissorTest(!1)
  24899. }
  24900. ,
  24901. this.__proto__ = {
  24902. __proto__: a
  24903. }
  24904. }
  24905. ,
  24906. n.prototype.vrCamera = function(a) {
  24907. this.type = "StereoCamera",
  24908. this._aspect = 1,
  24909. this._overlap = .064,
  24910. this.cameraL = new r.PerspectiveCamera,
  24911. this.cameraL.layers.enable(1),
  24912. this.cameraL.near = 0.01,//xzw add
  24913. this.cameraL.matrixAutoUpdate = !1,
  24914. this.cameraR = new r.PerspectiveCamera,
  24915. this.cameraR.layers.enable(2),
  24916. this.cameraR.near = 0.01,//xzw add
  24917. this.cameraR.matrixAutoUpdate = !1,
  24918. this.eyeRight = new r.Matrix4,
  24919. this.eyeLeft = new r.Matrix4,
  24920. this.vrCameraNeedsUpdate = !0,
  24921. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24922. Object.defineProperty(this, "bananaAspect", {
  24923. get: function() {
  24924. return this._aspect
  24925. },
  24926. set: function(a) {
  24927. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24928. this._aspect = a
  24929. }
  24930. }),
  24931. Object.defineProperty(this, "overlap", {
  24932. get: function() {
  24933. return this._overlap
  24934. },
  24935. set: function(a) {
  24936. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24937. this._overlap = a
  24938. }
  24939. }),
  24940. this.vrCameraUpdate = function(a) {
  24941. this.vrCameraNeedsUpdate = true;
  24942. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24943. this.vrCameraNeedsUpdate) {
  24944. this.vrCameraNeedsUpdate = !1,
  24945. //console.debug("vrCameraUpdate"),
  24946. this.bananaFocus = a.focus,
  24947. this.bananaFov = a.fov,
  24948. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24949. this.bananaNear = a.near,
  24950. this.bananaFar = a.far,
  24951. //console.debug(a.aspect),
  24952. this.bananaFocus = 10;
  24953. 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);
  24954. this.eyeLeft.elements[12] = -e,
  24955. this.eyeRight.elements[12] = e,
  24956. b = -g * this.bananaReal_aspect + f,
  24957. c = g * this.bananaReal_aspect + f,
  24958. d.elements[0] = 2 * this.bananaNear / (c - b),
  24959. d.elements[8] = (c + b) / (c - b),
  24960. this.cameraL.projectionMatrix.copy(d),
  24961. b = -g * this.bananaReal_aspect - f,
  24962. c = g * this.bananaReal_aspect - f,
  24963. d.elements[0] = 2 * this.bananaNear / (c - b),
  24964. d.elements[8] = (c + b) / (c - b),
  24965. this.cameraR.projectionMatrix.copy(d)
  24966. }
  24967. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24968. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24969. }
  24970. }
  24971. ,
  24972. n.prototype.boluoGetTexture = function(a) {
  24973. var b = new r.TextureLoader;
  24974. return b.crossOrigin = "anonymous",
  24975. b.load(a)
  24976. }
  24977. ,
  24978. /***********************************************************************************************************************************************************************************/
  24979. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24980. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24981. return function(o){
  24982. var render = false;
  24983. var ratio;
  24984. var w, h; //记录应当render的大小
  24985. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24986. w = o.width, h = o.height, render = true, ratio=1;
  24987. }else{
  24988. w = $('#player').width();
  24989. h = $('#player').height();
  24990. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24991. (w !== W || h !== H || this.forceUpdateSize) &&
  24992. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24993. }
  24994. if(render){
  24995. this.setSize(w, h, ratio);
  24996. this.forceUpdateSize = !1
  24997. }
  24998. }
  24999. }()
  25000. ,
  25001. n.prototype.updateComponents = function() {
  25002. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25003. this.updateListeners[t].update(e)
  25004. }
  25005. ,
  25006. n.prototype.suspend = function() {
  25007. this.started = !1,
  25008. this.suspendedObjects = this.scene.children.map(function(e) {
  25009. return this.scene.remove(e),
  25010. e
  25011. }
  25012. .bind(this)),
  25013. this.render()
  25014. }
  25015. ,
  25016. n.prototype.resume = function() {
  25017. this.suspendedObjects.forEach(function(e) {
  25018. this.scene.add(e)
  25019. }
  25020. .bind(this)),
  25021. this.suspendedObjects = [],
  25022. this.started = !0,
  25023. p()
  25024. }
  25025. ;
  25026. var p = function() {
  25027. this.started && (window.requestAnimationFrame(p),
  25028. this.updateScreenSize(), // fyz resize
  25029. this.updateComponents(),
  25030. this.updateTextureMemory(),
  25031. this.render(),
  25032. window.stats && (window.fps = stats.update()),
  25033. this.emit(a.AfterRender))
  25034. };
  25035. n.prototype.getImageData = function() {
  25036. var e = document.createElement("canvas")
  25037. , t = e.getContext("2d");
  25038. return function(i, n, r) {
  25039. return e.width === n && e.height === r || (e.width = n,
  25040. e.height = r),
  25041. t.drawImage(i, 0, 0, n, r),
  25042. t.getImageData(0, 0, n, r)
  25043. }
  25044. }(),
  25045. n.prototype.initSizedTexture2D = function(e, t, i) {
  25046. var n = this.renderer
  25047. , o = n.context
  25048. , a = n.state
  25049. , s = new r.Texture(null);
  25050. s.flipY = !1,
  25051. i !== !0 && (i = !1),
  25052. s.generateMipmaps = i;
  25053. var l = n.paramThreeToGL(s.format)
  25054. , c = n.paramThreeToGL(s.type)
  25055. , h = n.properties.get(s)
  25056. , u = o.createTexture();
  25057. a.bindTexture(o.TEXTURE_2D, u),
  25058. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25059. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25060. s.wrapS = t,
  25061. s.wrapT = t;
  25062. var d = n.paramThreeToGL(t);
  25063. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25064. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25065. i ? (s.magFilter = r.LinearFilter,
  25066. s.minFilter = r.LinearMipMapLinearFilter,
  25067. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25068. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25069. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25070. s.minFilter = r.LinearFilter,
  25071. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25072. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25073. a.bindTexture(o.TEXTURE_2D, null),
  25074. h.__webglTexture = u,
  25075. s
  25076. }
  25077. ,
  25078. n.prototype.initSizedCubeMap = function(e, t) {
  25079. var i = this.renderer
  25080. , n = i.context
  25081. , o = i.state
  25082. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25083. a.flipY = !1,
  25084. a.generateMipmaps = t;
  25085. var s = i.paramThreeToGL(a.format)
  25086. , l = i.paramThreeToGL(a.type)
  25087. , c = i.properties.get(a)
  25088. , h = n.createTexture();
  25089. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25090. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25091. for (var u = 0; u < 6; u++)
  25092. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25093. return t ? (a.magFilter = r.LinearFilter,
  25094. a.minFilter = r.LinearMipMapLinearFilter,
  25095. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25096. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25097. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25098. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25099. a.minFilter = r.LinearFilter,
  25100. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25101. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25102. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25103. c.__image__webglTextureCube = h,
  25104. a
  25105. }
  25106. ,
  25107. n.prototype.deallocateCubeTexture = function(e) {
  25108. var t = this.renderer
  25109. , i = t.context
  25110. , n = t.properties.get(e);
  25111. i.deleteTexture(n.__image__webglTextureCube)
  25112. }
  25113. ,
  25114. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25115. var a = this.renderer
  25116. , s = a.context
  25117. , l = a.state
  25118. , c = a.properties.get(t);
  25119. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25120. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25121. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25122. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25123. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25124. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25125. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25126. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25127. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25128. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25129. l.bindTexture(s.TEXTURE_2D, null)
  25130. }
  25131. ,
  25132. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25133. var s = this.renderer
  25134. , l = s.context
  25135. , c = s.state
  25136. , h = s.properties.get(t);
  25137. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25138. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25139. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25140. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25141. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25142. }
  25143. ,
  25144. n.prototype.rebuildMipMaps2D = function(e) {
  25145. var t = this.renderer
  25146. , i = t.context
  25147. , n = t.state;
  25148. t.properties.get(e);
  25149. i.generateMipmap(i.TEXTURE_2D),
  25150. n.bindTexture(i.TEXTURE_2D, null)
  25151. }
  25152. ,
  25153. n.prototype.rebuildMipMaps3D = function(e) {
  25154. var t = this.renderer
  25155. , i = t.context
  25156. , n = t.state
  25157. , r = t.properties.get(e);
  25158. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25159. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25160. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25161. }
  25162. ,
  25163. n.prototype.renderToCubeMap = function() {
  25164. var e = !1
  25165. , t = null
  25166. , i = null
  25167. , n = null
  25168. , a = null
  25169. , s = null
  25170. , l = 1;
  25171. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25172. var _ = this.renderer;
  25173. _.context;
  25174. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25175. i.position.z = 150,
  25176. t = new r.Scene,
  25177. t.add(i),
  25178. n = new r.ShaderMaterial({
  25179. uniforms: {
  25180. tDiffuse: {
  25181. type: "t",
  25182. value: null
  25183. },
  25184. alpha: {
  25185. type: "f",
  25186. value: 1
  25187. }
  25188. },
  25189. vertexShader: o.basicTextured.vertexShader,
  25190. fragmentShader: o.basicTextured.fragmentShader,
  25191. depthWrite: !1,
  25192. depthTest: !1,
  25193. side: r.DoubleSide
  25194. }),
  25195. a = new r.PlaneBufferGeometry(l,l),
  25196. s = new r.Mesh(a,n),
  25197. s.position.z = 0,
  25198. t.add(s),
  25199. e = !0);
  25200. var T = a.getAttribute("uv");
  25201. T.setDynamic(!0),
  25202. T.needsUpdate = !0;
  25203. var x = T.array
  25204. , S = p / u
  25205. , M = f / d
  25206. , R = g / u
  25207. , P = m / d;
  25208. x[0] = S,
  25209. x[1] = M + P,
  25210. x[2] = S + R,
  25211. x[3] = M + P,
  25212. x[4] = S,
  25213. x[5] = M,
  25214. x[6] = S + R,
  25215. x[7] = M;
  25216. var O = a.getAttribute("position");
  25217. O.setDynamic(!0),
  25218. O.needsUpdate = !0;
  25219. var L = O.array
  25220. , D = v / h.width - l / 2
  25221. , N = A / h.height - l / 2
  25222. , B = y / h.width
  25223. , F = C / h.height;
  25224. L[0] = D,
  25225. L[1] = N + F,
  25226. L[3] = D + B,
  25227. L[4] = N + F,
  25228. L[6] = D,
  25229. L[7] = N,
  25230. L[9] = D + B,
  25231. L[10] = N;
  25232. this.renderer.properties.get(c);
  25233. n.uniforms.tDiffuse.value = c,
  25234. n.blending = E || r.NoBlending,
  25235. n.transparent = !!b,
  25236. void 0 !== w && null !== w || (w = 1),
  25237. n.uniforms.alpha.value = w,
  25238. n.needUpdate = !0,
  25239. h.activeCubeFace = I,
  25240. h.viewport.set(0, 0, h.width, h.height);
  25241. var V = this.renderer.autoClear;
  25242. this.renderer.autoClear = !1,
  25243. this.renderer.render(t, i, h, !1),
  25244. this.renderer.autoClear = V
  25245. }
  25246. }(),
  25247. n.prototype.copyCubeMap = function() {
  25248. var e = !1
  25249. , t = null
  25250. , i = null
  25251. , a = null
  25252. , s = null
  25253. , l = null
  25254. , c = new r.Euler;
  25255. new r.Vector3;
  25256. return function(h, u, d, p, f, g, m, v, A) {
  25257. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  25258. this.renderer;
  25259. if (!e) {
  25260. var y = 2;
  25261. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25262. i.position.set(0, 0, 0),
  25263. t = new r.Scene,
  25264. t.add(i),
  25265. a = new r.ShaderMaterial({
  25266. uniforms: {
  25267. tDiffuse: {
  25268. type: "t",
  25269. value: null
  25270. },
  25271. alpha: {
  25272. type: "f",
  25273. value: 1
  25274. }
  25275. },
  25276. vertexShader: o.copyCubeMap.vertexShader,
  25277. fragmentShader: o.copyCubeMap.fragmentShader,
  25278. depthWrite: !1,
  25279. depthTest: !1,
  25280. side: r.DoubleSide
  25281. }),
  25282. s = new r.BoxGeometry(y,y,y),
  25283. l = new r.Mesh(s,a),
  25284. t.add(l),
  25285. e = !0
  25286. }
  25287. for (var C = 0; C < 6; C++)
  25288. n.getCubeOrientationForCubeFace(C, c),
  25289. l.rotation.copy(c),
  25290. l.matrixWorldNeedsUpdate = !0,
  25291. l.updateMatrixWorld(),
  25292. a.uniforms.tDiffuse.value = h,
  25293. a.blending = m || r.NoBlending,
  25294. a.transparent = !!v,
  25295. void 0 !== A && null !== A || (A = 1),
  25296. a.uniforms.alpha.value = A,
  25297. a.needUpdate = !0,
  25298. u.activeCubeFace = C,
  25299. u.viewport.set(0, 0, f, g),
  25300. this.renderer.render(t, i, u, !1)
  25301. }
  25302. }(),
  25303. n.getLookAtForCubeFace = function(e, t) {
  25304. switch (e) {
  25305. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25306. t.set(1, 0, 0);
  25307. break;
  25308. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25309. t.set(-1, 0, 0);
  25310. break;
  25311. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25312. t.set(0, 1, 0);
  25313. break;
  25314. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25315. t.set(0, -1, 0);
  25316. break;
  25317. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25318. t.set(0, 0, 1);
  25319. break;
  25320. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25321. t.set(0, 0, -1)
  25322. }
  25323. }
  25324. ,
  25325. n.getCubeOrientationForCubeFace = function(e, t) {
  25326. switch (e) {
  25327. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25328. t.set(0, -Math.PI / 2, 0);
  25329. break;
  25330. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25331. t.set(0, Math.PI / 2, 0);
  25332. break;
  25333. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25334. t.set(Math.PI / 2, Math.PI, 0);
  25335. break;
  25336. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25337. t.set(-Math.PI / 2, Math.PI, 0);
  25338. break;
  25339. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25340. t.set(0, -Math.PI, 0);
  25341. break;
  25342. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25343. t.set(0, 0, 0)
  25344. }
  25345. }
  25346. ,
  25347. t.exports = n
  25348. }
  25349. , {
  25350. "../enum/GLCubeFaces": 25,
  25351. "../enum/GLTextureType": 26,
  25352. "../enum/SceneRendererEvents": 43,
  25353. "../exception/BasicException": 55,
  25354. "../exception/RendererCreationException": 57,
  25355. "../settings": 166,
  25356. "../shaders": 167,
  25357. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25358. "../util/browser": 182,
  25359. /************************************************************************************************************************************************/
  25360. events: 202,
  25361. three: 217
  25362. }],
  25363. 159: [function(e, t, i) {
  25364. "use strict";
  25365. function n(e) {
  25366. this.messenger = new a(e),
  25367. this.clientKey = null
  25368. }
  25369. var r = e("../util/ajax")
  25370. , o = e("./PostMessageType")
  25371. , a = e("./postmessage")
  25372. , s = e("./VersionInfo")
  25373. , l = e("events").EventEmitter
  25374. , c = window.location.origin + "/api/v1/user/";
  25375. n.prototype = Object.create(l.prototype),
  25376. n.prototype.bindEvents = function() {
  25377. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25378. }
  25379. ,
  25380. n.prototype.waitForConnection = function() {
  25381. var e = new Promise(function(e, t) {
  25382. this.messenger.on(o.CONNECT, function(i) {
  25383. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25384. }
  25385. .bind(this))
  25386. }
  25387. .bind(this));
  25388. return e
  25389. }
  25390. ,
  25391. n.prototype.onConnectionReceived = function(e) {
  25392. return this.messenger.setTarget(e.source, e.origin),
  25393. this.verifyConnection(e).then(function(t, i) {
  25394. this.messenger.send({
  25395. type: o.ACCEPT,
  25396. toId: e.fromId,
  25397. warning: i
  25398. }),
  25399. this.clientKey = t,
  25400. this.messenger.removeAllListeners(o.CONNECT),
  25401. this.bindEvents()
  25402. }
  25403. .bind(this), function(t) {
  25404. this.messenger.send({
  25405. type: o.REJECT,
  25406. toId: e.fromId,
  25407. reason: t
  25408. }),
  25409. this.messenger.setTarget()
  25410. }
  25411. .bind(this))
  25412. }
  25413. ,
  25414. n.prototype.verifyConnection = function(e) {
  25415. return new Promise(function(t, i) {
  25416. var n;
  25417. if (s.isDeprecated(e.sdkVersion))
  25418. n = "这个版本正在被弃用";
  25419. else if (!s.isSupported(e.sdkVersion))
  25420. return i("不支持此版本的SDK");
  25421. var o = {
  25422. cache: !1,
  25423. headers: {
  25424. "X-port-Application-Key": e.applicationKey,
  25425. "X-port-Referrer": e.origin
  25426. }
  25427. };
  25428. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25429. }
  25430. )
  25431. }
  25432. ,
  25433. n.prototype.onMessageReceived = function(e) {
  25434. if (this.validateClientApplicationKey(e.applicationKey)) {
  25435. var t = this;
  25436. e.onDone = function(i) {
  25437. i.toId = e.fromId,
  25438. i.uid = e.uid,
  25439. i.type = o.RESPONSE,
  25440. t.messenger.send(i)
  25441. }
  25442. ,
  25443. this.emit(o.ACTION, e)
  25444. }
  25445. }
  25446. ,
  25447. n.prototype.validateClientApplicationKey = function(e) {
  25448. return this.clientKey === e
  25449. }
  25450. ,
  25451. n.prototype.sendEvent = function(e, t) {
  25452. this.messenger.send({
  25453. type: o.EVENT,
  25454. eventType: e,
  25455. eventData: t
  25456. })
  25457. }
  25458. ,
  25459. t.exports = n
  25460. }
  25461. , {
  25462. "../util/ajax": 181,
  25463. "./PostMessageType": 160,
  25464. "./VersionInfo": 163,
  25465. "./postmessage": 165,
  25466. events: 202
  25467. }],
  25468. 160: [function(e, t, i) {
  25469. "use strict";
  25470. t.exports = Object.freeze({
  25471. CONNECT: "postmessage.connect",
  25472. ACCEPT: "postmessage.accept",
  25473. REJECT: "postmessage.reject",
  25474. ACTION: "postmessage.action",
  25475. RESPONSE: "postmessage.response",
  25476. EVENT: "postmessage.event"
  25477. })
  25478. }
  25479. , {}],
  25480. 161: [function(e, t, i) {
  25481. "use strict";
  25482. t.exports = Object.freeze({
  25483. MOVE: "sdk.move",
  25484. ENTER_PANO: "sdk.enterpano",
  25485. MODEL_LOADED: "sdk.modelloaded"
  25486. })
  25487. }
  25488. , {}],
  25489. 162: [function(e, t, i) {
  25490. "use strict";
  25491. t.exports = Object.freeze({
  25492. FLY: "transition.fly",
  25493. FADEOUT: "transition.fade",
  25494. INSTANT: "transition.instant"
  25495. })
  25496. }
  25497. , {}],
  25498. 163: [function(e, t, i) {
  25499. "use strict";
  25500. t.exports = {
  25501. current: "1.0",
  25502. supported: ["1.0"],
  25503. deprecated: [],
  25504. isSupported: function(e) {
  25505. return this.supported.indexOf(e) !== -1
  25506. },
  25507. isDeprecated: function(e) {
  25508. return this.deprecated.indexOf(e) !== -1
  25509. },
  25510. isValid: function(e) {
  25511. return this.isSupported(e) || this.isDeprecated(e)
  25512. }
  25513. }
  25514. }
  25515. , {}],
  25516. 164: [function(e, t, i) {
  25517. (function(i) {
  25518. "use strict";
  25519. function n(e, t, i) {
  25520. e && (e = e.toLowerCase().trim());
  25521. var n = new I.UP.clone
  25522. , r = Math.PI / 3
  25523. , o = Math.PI / 2;
  25524. switch (e) {
  25525. case "left":
  25526. i.copy(t),
  25527. i.applyAxisAngle(n, o);
  25528. break;
  25529. case "right":
  25530. i.copy(t),
  25531. i.applyAxisAngle(n, -o);
  25532. break;
  25533. case "forwardleft":
  25534. i.copy(t),
  25535. i.applyAxisAngle(n, r);
  25536. break;
  25537. case "forwardright":
  25538. i.copy(t),
  25539. i.applyAxisAngle(n, -r);
  25540. break;
  25541. case "forward":
  25542. default:
  25543. i.copy(t)
  25544. }
  25545. return i
  25546. }
  25547. function r(e, t) {
  25548. if (e) {
  25549. var i = {
  25550. pano: e,
  25551. lookAtPoint: null,
  25552. duration: null,
  25553. maxDistanceOverride: null,
  25554. skipWarpingCheck: !1
  25555. };
  25556. this.player.flyToPano(i, function() {
  25557. t && t({
  25558. success: !0,
  25559. message: "Transition complete."
  25560. })
  25561. })
  25562. } else
  25563. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25564. t && t({
  25565. success: !1,
  25566. error: "Unable to find pano."
  25567. })
  25568. }
  25569. function o(e, t) {
  25570. var i = this.findRankedPano(e, t);
  25571. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25572. null)
  25573. }
  25574. function a(e, t) {
  25575. var i = this.findRankedtag(e, t);
  25576. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25577. null)
  25578. }
  25579. function s(e, t) {
  25580. t.copy(I.FORWARD),
  25581. e.getDirection(t)
  25582. }
  25583. function l(e) {
  25584. function t(e) {
  25585. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25586. return {
  25587. x: c.Math.radToDeg(t._x),
  25588. y: c.Math.radToDeg(t._y),
  25589. z: c.Math.radToDeg(t._z)
  25590. }
  25591. }
  25592. var i = function(e) {
  25593. return e.alignmentType !== m.ALIGNED ? null : {
  25594. x: e.position.x,
  25595. y: e.position.y,
  25596. z: e.position.z
  25597. }
  25598. };
  25599. return {
  25600. panos: e.panos.list.map(function(n) {
  25601. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25602. return {
  25603. uuid: n.id,
  25604. aligned: n.alignmentType === m.ALIGNED,
  25605. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25606. position: i(n),
  25607. rotation: t(n),
  25608. thumbnail: r
  25609. }
  25610. })
  25611. }
  25612. }
  25613. var c = e("three")
  25614. , h = e("./ApiHost")
  25615. , u = e("../util/logger")
  25616. , d = e("../util/common")
  25617. , p = e("../util/math")
  25618. , f = e("../enum/ModelManagerEvents")
  25619. , g = e("./PostMessageType")
  25620. , m = e("../enum/AlignmentType")
  25621. , v = e("../enum/Direction")
  25622. , A = e("./TransitionStyles")
  25623. , y = e("../util/panorama")
  25624. , C = e("../enum/GLCubeFaces")
  25625. , I = e("../enum/Vectors")
  25626. , E = e("../enum/Viewmode")
  25627. , b = e("../enum/WarpStyle")
  25628. , w = (e("../enum/Keys"),
  25629. e("../enum/PlayerEvents"))
  25630. , _ = e("../sdk/SdkEvents")
  25631. , I = e("../enum/Vectors")
  25632. , T = e("../enum/ControlEvents")
  25633. , x = e("../enum/RenderLayers")
  25634. , S = (e("../constants"),
  25635. e("../settings"))
  25636. , M = e("../lib/jpeg_encoder")
  25637. , R = new u(i)
  25638. , P = function() {
  25639. var e = function e() {
  25640. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25641. e.player.getDirection(e.playerDirection),
  25642. e.projectVectors();
  25643. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25644. if (e.angleTravelled += Math.abs(t),
  25645. e.angleTravelled >= Math.abs(e.angle)) {
  25646. if (e.active = !1,
  25647. e.onDone) {
  25648. var i = e.onDone;
  25649. i()
  25650. }
  25651. } else
  25652. e.lastFacingDirection.copy(e.playerDirection),
  25653. window.setTimeout(e, 4)
  25654. };
  25655. return e.active = !1,
  25656. e.angle = 0,
  25657. e.angleTravelled = 0,
  25658. e.playerDirection = new c.Vector3,
  25659. e.lastFacingDirection = new c.Vector3,
  25660. e.onDone = null,
  25661. e.player = null,
  25662. e.start = function(t, i, n, r) {
  25663. e.active = !0,
  25664. t && i && (i = 0),
  25665. e.angle = t || i,
  25666. e.xAngle = t,
  25667. e.yAngle = i,
  25668. e.angleTravelled = 0,
  25669. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25670. n.getDirection(e.playerDirection),
  25671. e.lastFacingDirection.copy(e.playerDirection),
  25672. e.projectVectors(),
  25673. e.onDone = r,
  25674. e.player = n,
  25675. e()
  25676. }
  25677. ,
  25678. e.projectVectors = function() {
  25679. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25680. e.lastFacingDirection.projectOnPlane(I.UP))
  25681. }
  25682. ,
  25683. e
  25684. }()
  25685. , O = function() {
  25686. var e = new c.Vector3;
  25687. return function(t) {
  25688. t ? (e.copy(t.position),
  25689. e.add(t.discPosition),
  25690. p.projectPositionToCanvas(e, this.player.camera, e),
  25691. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25692. }
  25693. }()
  25694. , L = function() {
  25695. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25696. }
  25697. , D = function() {
  25698. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25699. }
  25700. , N = function(e) {
  25701. var t = new c.Vector3;
  25702. return function(e) {
  25703. var i = this.player.getDirection();
  25704. t.copy(i);
  25705. var n = t.y;
  25706. t.y = 0,
  25707. t.normalize();
  25708. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25709. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25710. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25711. 0;
  25712. this.player.mode === E.DOLLHOUSE && (r = -r);
  25713. var o = L.call(this) - .1
  25714. , a = D.call(this) + .1
  25715. , s = r + e;
  25716. s > o ? s = o : s < a && (s = a);
  25717. var l = s - r;
  25718. return e > 0 && l < .01 && (l = 0),
  25719. e < 0 && l > -.01 && (l = 0),
  25720. l
  25721. }
  25722. }()
  25723. , B = function() {
  25724. var e = new c.Euler;
  25725. return function(t) {
  25726. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25727. {
  25728. position: {
  25729. x: t.position.x,
  25730. y: t.position.y,
  25731. z: t.position.z
  25732. },
  25733. rotation: {
  25734. x: c.Math.radToDeg(e.x),
  25735. y: c.Math.radToDeg(e.y),
  25736. z: 0
  25737. },
  25738. pano: t.currentPano ? t.currentPano.id : null,
  25739. mode: t.mode
  25740. }
  25741. }
  25742. }()
  25743. , F = null;
  25744. t.exports = {
  25745. init: function(e, t, i, n, r) {
  25746. V.init(e, t, i, r),
  25747. F = new Promise(function(e, t) {
  25748. i.on(w.Ready, function() {
  25749. e()
  25750. })
  25751. }
  25752. .bind(this));
  25753. var o = new h(window)
  25754. , a = o.waitForConnection();
  25755. a.then(function(e) {
  25756. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25757. });
  25758. var s = function() {
  25759. var e = Date.now();
  25760. return function() {
  25761. if (!(Date.now() - e < 100)) {
  25762. var t = B(i);
  25763. o.sendEvent(_.MOVE, {
  25764. state: t
  25765. }),
  25766. e = Date.now()
  25767. }
  25768. }
  25769. }();
  25770. i.on(w.Move, s),
  25771. i.on(w.ViewChanged, s),
  25772. n.on(f.ActiveModelChanged, function(e) {
  25773. function t(e) {
  25774. var t, i = e.newPano.id;
  25775. e.oldPano && (t = e.oldPano.id),
  25776. i !== t && o.sendEvent(_.ENTER_PANO, {
  25777. oldPano: t,
  25778. newPano: i
  25779. })
  25780. }
  25781. var i = e.model
  25782. , n = e.oldModel;
  25783. V.model = i,
  25784. a.then(function() {
  25785. o.sendEvent(_.MODEL_LOADED, {
  25786. metadata: l(i)
  25787. })
  25788. }),
  25789. n && n.panos.forEach(function(e) {
  25790. e.removeEventListener("enter", t)
  25791. }),
  25792. i.panos.forEach(function(e) {
  25793. e.on("enter", t)
  25794. })
  25795. })
  25796. }
  25797. };
  25798. var V = {
  25799. director: null,
  25800. player: null,
  25801. controls: null,
  25802. sceneRenderer: null,
  25803. model: null,
  25804. init: function(e, t, i, n) {
  25805. this.director = e,
  25806. this.player = i,
  25807. this.controls = t,
  25808. this.sceneRenderer = n
  25809. },
  25810. handleToObject: {},
  25811. objectToHandle: {},
  25812. handleCount: 0,
  25813. onMessageReceive: function(e) {
  25814. if (e) {
  25815. var t = e.targetFunction
  25816. , i = e.params
  25817. , n = e.onDone;
  25818. t && this[t] && this[t](i, n)
  25819. }
  25820. },
  25821. waitForInit: function(e, t) {
  25822. F.then(t.bind({
  25823. success: !0,
  25824. message: "Init complete."
  25825. }))
  25826. },
  25827. moveToPano: function(e, t) {
  25828. var i = new c.Euler(0,0,0,"YXZ")
  25829. , n = new c.Quaternion;
  25830. return function(e, t) {
  25831. var r = e.pano
  25832. , o = e.rotation
  25833. , a = e.transition;
  25834. if (!this.model)
  25835. return t({
  25836. success: !1,
  25837. error: "The model has not been loaded yet"
  25838. });
  25839. var s = this.model.panos.get(r);
  25840. if (!s)
  25841. return t({
  25842. success: !1,
  25843. error: r + " does not exist in this model"
  25844. });
  25845. if (!o)
  25846. return t({
  25847. sucess: !1,
  25848. erorr: o + " is not a valid rotation"
  25849. });
  25850. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25851. console.log(o.z);
  25852. var l = {
  25853. success: !0,
  25854. message: r
  25855. };
  25856. if (a === A.FADEOUT)
  25857. n.setFromEuler(i),
  25858. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25859. else {
  25860. var h, u;
  25861. a === A.INSTANT && (h = 0,
  25862. u = 0);
  25863. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25864. this.player.flyToPano({
  25865. pano: s,
  25866. lookAtPoint: d,
  25867. duration: h,
  25868. aimDuration: u
  25869. }, t.bind(this, l))
  25870. }
  25871. }
  25872. }(),
  25873. moveInDirection: function(e, t) {
  25874. var i = e.direction;
  25875. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25876. void (t && t({
  25877. success: !1,
  25878. error: "Invalid direction."
  25879. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25880. t(e ? {
  25881. success: !0,
  25882. message: "moved " + i
  25883. } : {
  25884. success: !1,
  25885. error: "Cannot move in direction: " + i
  25886. })
  25887. })
  25888. },
  25889. getPose: function(e, t) {
  25890. this.player.camera.position,
  25891. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25892. return t({
  25893. success: !0,
  25894. message: B(this.player)
  25895. })
  25896. },
  25897. takeScreenShot: function() {
  25898. var e = new c.PerspectiveCamera
  25899. , t = new c.WebGLRenderTarget;
  25900. return function(i, n) {
  25901. if (!i.resolution)
  25902. return n({
  25903. success: !1,
  25904. error: "An invalid resolution was specified"
  25905. });
  25906. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25907. var r = this.sceneRenderer.renderer.getSize();
  25908. i.resolution.width = r.width,
  25909. i.resolution.height = r.height
  25910. }
  25911. e.layers.set(x.DEFAULT),
  25912. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25913. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25914. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25915. var o = i.resolution.width
  25916. , a = i.resolution.height
  25917. , s = o / a;
  25918. e.position.copy(this.sceneRenderer.camera.position),
  25919. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25920. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25921. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25922. t.setSize(o, a),
  25923. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25924. var l = new Uint8Array(o * a * 4);
  25925. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25926. var c = M.encode({
  25927. data: l,
  25928. width: o,
  25929. height: a,
  25930. heading: 180,
  25931. pitch: 0
  25932. }, {
  25933. quality: 75,
  25934. flipY: !0
  25935. })
  25936. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25937. n({
  25938. success: !0,
  25939. message: h
  25940. })
  25941. }
  25942. }(),
  25943. findRankedPano: function(e, t) {
  25944. var i = new c.Vector3
  25945. , r = new c.Vector3;
  25946. return function(e, t) {
  25947. s(this.player, r),
  25948. n(t, r, i);
  25949. var o = this.player.rankedPanoInDirection(e, i);
  25950. if (o) {
  25951. var a = this.objectToHandle[o.id];
  25952. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25953. this.handleToObject[a] = o),
  25954. a
  25955. }
  25956. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25957. -1
  25958. }
  25959. }(),
  25960. findRankedtag: function(e, t) {
  25961. var i = new c.Vector3
  25962. , r = new c.Vector3;
  25963. return function(e, t) {
  25964. s(this.player, r),
  25965. n(t, r, i);
  25966. var o = this.player.rankedtagInDirection(e, i);
  25967. if (o) {
  25968. var a = this.objectToHandle[o.sid];
  25969. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25970. this.handleToObject[a] = o),
  25971. a
  25972. }
  25973. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25974. -1
  25975. }
  25976. }(),
  25977. clickNearesttag: function(e) {
  25978. this.clickRankedtag(0, e)
  25979. },
  25980. clickRankedtag: function(e, t) {
  25981. var i = a.call(this, e, t);
  25982. i && O.call(this, i)
  25983. },
  25984. clickNearestPano: function(e, t) {
  25985. this.clickRankedPano(0, e, t)
  25986. },
  25987. clickRankedPano: function(e, t, i) {
  25988. var n = o.call(this, e, t);
  25989. n ? r.call(this, n, i) : i(null)
  25990. },
  25991. clickPano: function(e, t) {
  25992. var i = this.handleTable[e];
  25993. i ? r.call(this, i, t) : t(null)
  25994. },
  25995. rotateDirection: function() {
  25996. return function(e, t) {
  25997. var i = e.direction
  25998. , n = e.angle;
  25999. if (!P.active) {
  26000. var r = 0
  26001. , o = 0
  26002. , a = 0
  26003. , s = 0;
  26004. if (!n || isNaN(n))
  26005. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26006. void (t && t({
  26007. success: !1,
  26008. error: "Invalid rotation angle."
  26009. }));
  26010. if (this.player.mode === E.TRANSITIONING)
  26011. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26012. void (t && t({
  26013. success: !1,
  26014. error: "Cannot rotate while transitioning"
  26015. }));
  26016. if (i === v.RIGHT || i === v.LEFT)
  26017. i === v.RIGHT && (n = -n),
  26018. r = n > 0 ? -1 : 1,
  26019. a = n;
  26020. else {
  26021. if (i !== v.UP && i !== v.DOWN)
  26022. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26023. void (t && t({
  26024. success: !1,
  26025. error: "Invalid direction for rotation."
  26026. }));
  26027. if (this.player.mode === E.FLOORPLAN)
  26028. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26029. void (t && t({
  26030. success: !1,
  26031. error: "Cannot rotate " + i + " in floorplan mode"
  26032. }));
  26033. if (i === v.DOWN && (n = -n),
  26034. n = N.call(this, n),
  26035. 0 === n)
  26036. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26037. void (t && t({
  26038. success: !1,
  26039. error: "Already at maximum rotation in direction: " + i
  26040. }));
  26041. o = n > 0 ? 1 : -1,
  26042. s = n
  26043. }
  26044. var l = n;
  26045. n = c.Math.degToRad(n),
  26046. a = c.Math.degToRad(a),
  26047. s = c.Math.degToRad(s);
  26048. var h = this.controls.activeControl
  26049. , u = function() {
  26050. h.stopRotating(!0),
  26051. t && t({
  26052. success: !0,
  26053. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26054. })
  26055. };
  26056. h.startRotating(r, o),
  26057. P.start(a, s, this.player, u)
  26058. }
  26059. }
  26060. }(),
  26061. rotate: function() {
  26062. var e = new c.Vector3
  26063. , t = new c.Vector3;
  26064. return function(i, n) {
  26065. var r = i.xAngle
  26066. , o = i.yAngle;
  26067. if (!P.active) {
  26068. if (r = r || 0,
  26069. o = o || 0,
  26070. isNaN(r) || isNaN(o))
  26071. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26072. void (n && n({
  26073. success: !1,
  26074. error: "Invalid rotation angle."
  26075. }));
  26076. if (this.player.mode === E.TRANSITIONING)
  26077. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26078. void (n && n({
  26079. success: !1,
  26080. error: "Cannot rotate while transitioning"
  26081. }));
  26082. Math.abs(r) < .01 && (r = 0),
  26083. Math.abs(o) < .01 && (o = 0);
  26084. var a = o;
  26085. o = N.call(this, o),
  26086. r = -r;
  26087. var s = a > 0 ? "UP" : "DOWN";
  26088. if (!r && a && !o)
  26089. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26090. void (n && n({
  26091. success: !1,
  26092. error: "Already at maximum rotation in direction: " + s
  26093. }));
  26094. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26095. var l = o;
  26096. o = c.Math.degToRad(o),
  26097. r = c.Math.degToRad(r),
  26098. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26099. this.player.getDirection(e),
  26100. t.copy(e).applyAxisAngle(I.UP, r),
  26101. t.applyAxisAngle(I.RIGHT, o);
  26102. var h = (e.angleTo(t),
  26103. r > 0 ? -1 : r < 0 ? 1 : 0)
  26104. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26105. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26106. var d = this.controls.activeControl
  26107. , p = function() {
  26108. d.stopRotating(!0),
  26109. n && n({
  26110. success: !0,
  26111. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26112. })
  26113. };
  26114. d.startRotating(h, u),
  26115. P.start(r, o, this.player, p)
  26116. }
  26117. }
  26118. }(),
  26119. panCamera: function(e, t) {
  26120. function i(e) {
  26121. switch (r.removeAllListeners(T.AutoPanComplete),
  26122. r.removeAllListeners(T.AutoPanInterrupt),
  26123. r.removeAllListeners(T.AutoPanClamped),
  26124. e) {
  26125. case T.AutoPanInterrupt:
  26126. t({
  26127. success: !0,
  26128. message: "Camera panning interrupted."
  26129. });
  26130. break;
  26131. case T.AutoPanClamped:
  26132. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26133. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26134. return void t({
  26135. success: !1,
  26136. error: "Already at edge of current model bounds."
  26137. });
  26138. var i = "The view point is outside the bounds for the current model. ";
  26139. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26140. console.warn(i)
  26141. }
  26142. case T.AutoPanComplete:
  26143. t({
  26144. success: !0,
  26145. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26146. })
  26147. }
  26148. }
  26149. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26150. return t({
  26151. success: !1,
  26152. error: "Camera panning is not available in the current mode: " + this.player.mode
  26153. });
  26154. var n = e.position
  26155. , r = this.player.control;
  26156. r.setAutoPanPosition(n.x, n.z),
  26157. r.autoPan = !0;
  26158. var o = function(e, t) {
  26159. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26160. };
  26161. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26162. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26163. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26164. },
  26165. click: function(e, t) {
  26166. var i = e.x
  26167. , n = e.y
  26168. , r = e.percentage;
  26169. r === !0 && (i = i / 100 * $("#player").width(),
  26170. n = n / 100 * $("#player").height()),
  26171. this.player.handleInputStart(i, n),
  26172. this.player.updateIntersect(),
  26173. this.player.handleInputEnd(i, n)
  26174. },
  26175. mouseOver: function(e, t) {
  26176. var i = e.x
  26177. , n = e.y
  26178. , r = e.percentage;
  26179. r === !0 && (i = i / 100 * $("#player").width(),
  26180. n = n / 100 * $("#player").height()),
  26181. this.player.handleInputMove(i, n),
  26182. this.player.updateIntersect()
  26183. },
  26184. moveToMode: function(e, t) {
  26185. function i(e) {
  26186. t(e ? {
  26187. success: !1,
  26188. error: "Failed to load new mode: " + e
  26189. } : {
  26190. success: !0,
  26191. message: "Moved to new mode: " + n
  26192. })
  26193. }
  26194. var n = e.mode;
  26195. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26196. i()
  26197. }, function(e) {
  26198. i(e)
  26199. }) : t({
  26200. success: !1,
  26201. error: "Invalid mode selection"
  26202. })
  26203. }
  26204. }
  26205. }
  26206. ).call(this, "/js/sdk/automation.js")
  26207. }
  26208. , {
  26209. "../constants": 8,
  26210. "../enum/AlignmentType": 17,
  26211. "../enum/ControlEvents": 21,
  26212. "../enum/Direction": 22,
  26213. "../enum/GLCubeFaces": 25,
  26214. "../enum/Keys": 30,
  26215. "../enum/ModelManagerEvents": 33,
  26216. "../enum/PlayerEvents": 40,
  26217. "../enum/RenderLayers": 41,
  26218. "../enum/Vectors": 50,
  26219. "../enum/Viewmode": 51,
  26220. "../enum/WarpStyle": 52,
  26221. "../lib/jpeg_encoder": 94,
  26222. "../sdk/SdkEvents": 161,
  26223. "../settings": 166,
  26224. "../util/common": 185,
  26225. "../util/logger": 189,
  26226. "../util/math": 190,
  26227. "../util/panorama": 191,
  26228. "./ApiHost": 159,
  26229. "./PostMessageType": 160,
  26230. "./TransitionStyles": 162,
  26231. three: 217
  26232. }],
  26233. 165: [function(e, t, i) {
  26234. "use strict";
  26235. function n(e) {
  26236. this.sourceWindow = e,
  26237. this.targetWindow = null,
  26238. this.targetOrigin = null,
  26239. this.id = Math.floor(1e5 * Math.random()),
  26240. this.bindEvents()
  26241. }
  26242. var r = e("./PostMessageType")
  26243. , o = e("events").EventEmitter;
  26244. n.prototype = Object.create(o.prototype),
  26245. n.prototype.bindEvents = function() {
  26246. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26247. }
  26248. ,
  26249. n.prototype.setTarget = function(e, t) {
  26250. this.targetWindow = e,
  26251. this.targetOrigin = t
  26252. }
  26253. ,
  26254. n.prototype.onPostmessageReceived = function(e) {
  26255. var t = e.origin || e.originalEvent.origin
  26256. , i = e.source;
  26257. switch (e.data.type) {
  26258. case r.CONNECT:
  26259. break;
  26260. case r.RESPONSE:
  26261. if (this.id !== e.data.toId)
  26262. return;
  26263. default:
  26264. if (!this.validateMessageOrigin(t))
  26265. return
  26266. }
  26267. var n = e.data;
  26268. n.source = i,
  26269. n.origin = t,
  26270. n.timestamp = Date.now(),
  26271. this.emit(e.data.type, n)
  26272. }
  26273. ,
  26274. n.prototype.validateMessageOrigin = function(e) {
  26275. return "*" === this.targetOrigin || e === this.targetOrigin
  26276. }
  26277. ,
  26278. n.prototype.send = function(e) {
  26279. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26280. this.targetWindow.postMessage(e, this.targetOrigin))
  26281. }
  26282. ,
  26283. t.exports = n
  26284. }
  26285. , {
  26286. "./PostMessageType": 160,
  26287. events: 202
  26288. }],
  26289. 166: [function(e, t, i) {
  26290. "use strict";
  26291. var n = e("three")
  26292. , r = e("./util/browser")
  26293. , o = e("./enum/Viewmode")
  26294. , a = e("./enum/VROption")
  26295. , s = e("./enum/Colors")
  26296. , l = e("./enum/WarpStyle")
  26297. , c = e("./util/easing")
  26298. , h = e("./util/common")
  26299. , u = e("./util/showcase")
  26300. , d = e("./constants")
  26301. , p = {
  26302. debug: !1,
  26303. version: "2.25.6-0-gd87e5b1",
  26304. languageTag: r.valueFromHash("lang", null),
  26305. pageTitle: "四维虚拟漫游",
  26306. authorizationHeader: u.getAuthorizationHeader(),
  26307. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26308. logLevel: r.valueFromHash("log", 2),
  26309. skyboxRadius: 2500,
  26310. modelBoundsPadding: 5,
  26311. showNeighbors: !1,
  26312. brand: r.valueFromHash("brand", !0),
  26313. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26314. startHighlights: r.valueFromHash("hl", -1),
  26315. specialEdition: r.valueFromHash("bn", 0),
  26316. useWheel: r.valueFromHash("wh", !0),
  26317. crossOrigin: "anonymous",
  26318. fancierTransition: !1,
  26319. wireframe: !1,
  26320. skyboxWireframe: !1,
  26321. modelAlpha: 1,
  26322. highlightPanoSelection: !1,
  26323. showSweeps: !0,
  26324. showSkyboxes: !1,
  26325. showMesh: !0,
  26326. showFloors: !1,
  26327. showFloorDuration: 300,
  26328. showFloorDelay: 300,
  26329. hideFloorDuration: 300,
  26330. hideFloorDelay: 0,
  26331. reticuleOpacityTransitionTime: 250,
  26332. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26333. markerOpacityTransitionTime: 500,
  26334. guiAnimationSpeed: 250,
  26335. highlightAnimationDuration: 500,
  26336. modelComponentLoadSpinnerDelay: 150,
  26337. captureErrors: !1,
  26338. maxMobileTextures: 6,
  26339. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26340. startupFlyinDelay: 3e3,
  26341. dollhouseDefault: {
  26342. minDistance: 15,
  26343. maxDistance: 50,
  26344. minPolarAngle: n.Math.degToRad(10),
  26345. maxPolarAngle: n.Math.degToRad(90)
  26346. },
  26347. hideReticuleTimeout: 1e3,
  26348. analytics: {
  26349. inactivityThreshold: 30,
  26350. sessionTrackingRate: .15,
  26351. maxTrackedErrors: 20,
  26352. sessionDurationPingFrequency: 10,
  26353. sessionDurationTimeout: 15
  26354. },
  26355. flydown: {
  26356. movementEasing: "easeInOutQuad",
  26357. movementDelay: .001,
  26358. rotationEasing: "easeInOutQuad",
  26359. rotationDelay: .5,
  26360. modelTextureDelay: .75,
  26361. skyboxDelay: .75
  26362. },
  26363. transition: {
  26364. flySpeed: .001,
  26365. flyTime: 750,
  26366. flytimeMaxDistanceThreshold: 5,
  26367. flytimeDistanceMultiplier: 150,
  26368. aimTime: 1500,
  26369. aimSlowFactor: 1.5,
  26370. blur: 0.8,
  26371. movementEasing: "easeInOutQuad",
  26372. blendEasing: "easeInOutQuad",
  26373. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26374. },
  26375. show360Views: {
  26376. enabled: !0,
  26377. transitionTime: 1e3
  26378. },
  26379. quickstart: {
  26380. enabled: true,
  26381. animation: 1400,
  26382. showTextDelay: 500,
  26383. fadeOutDelay: 3e3,
  26384. fovChange: 10
  26385. },
  26386. appConfig: {
  26387. webvr_version: null,
  26388. segment_key: null,
  26389. embedly_key: null,
  26390. branch_key: null,
  26391. keen_write_key: null,
  26392. keen_project_id: null
  26393. },
  26394. vr: {
  26395. enabled: !0,
  26396. allowWebVR: !1,
  26397. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26398. },
  26399. share: {
  26400. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26401. },
  26402. input: {
  26403. longTapThreshold: 200,
  26404. moveToleranceNDC: .01,
  26405. touchMoveThreshold: 25
  26406. },
  26407. help: {
  26408. modalStayDuration: 600
  26409. },
  26410. immersive: {
  26411. timeToShowAgain: 1250,
  26412. uiStayDuration: 600
  26413. },
  26414. tourInteraction: {
  26415. disabled: "0" === r.valueFromHash("tourcta", null),
  26416. showPauseButton: 1e3,
  26417. showModal: 1500,
  26418. allowNextClick: 200,
  26419. largeModal: "1" === r.valueFromHash("tourcta", null),
  26420. smallModal: "2" === r.valueFromHash("tourcta", null)
  26421. },
  26422. labels: {
  26423. enabled: !1,
  26424. hideUntilStart: !0,
  26425. fadeInDuration: 250,
  26426. fadeInDelay: 250,
  26427. fadeOutDuration: 250,
  26428. fadeOutDelay: 0,
  26429. zoomHideThreshhold: {
  26430. mobile: r.isSmallScreen() ? .45 : .6,
  26431. desktop: 2
  26432. },
  26433. zoomTruncateThreshhold: {
  26434. mobile: r.isSmallScreen() ? .35 : .45,
  26435. desktop: .85
  26436. },
  26437. minLengthForTruncate: 16,
  26438. truncateLength: 12,
  26439. truncateSuffix: "..."
  26440. },
  26441. tags: {
  26442. enabled: r.valueFromHash("mt", 1),
  26443. startup: {
  26444. hideUntilStart: !0,
  26445. fadeInDuration: 500,
  26446. fadeInDelay: 100
  26447. },
  26448. visibility: {
  26449. anyDistance: !0,
  26450. visibleDistance: 8,
  26451. cameraClearance: .1,
  26452. alphaTestLevel: .05,
  26453. hideViaFloor: !0,
  26454. hideOffScreenDisc: !1,
  26455. hideOffScreenObject: !1
  26456. },
  26457. disc: {
  26458. opacity: 1,
  26459. disabledOpacity: .5,
  26460. scale: {
  26461. nearBound: 1.5,
  26462. farBound: 4.8,
  26463. linkFarBound: !1,
  26464. linkPercent: 40,
  26465. maxSize: 80,
  26466. minSize: 40,
  26467. baseViewportSize: 800,
  26468. responsiveness: 100
  26469. }
  26470. },
  26471. pole: {
  26472. enabled: !0,
  26473. height: .5,
  26474. width: 2,
  26475. opacity: .5,
  26476. color: "white"
  26477. },
  26478. navigate: {
  26479. nearestPano: !0,
  26480. lineOfSight: !0,
  26481. reactivate: !0,
  26482. aimAt: "disc",
  26483. tiltTolerance: 25,
  26484. rotateSpeedFactor: .6
  26485. }
  26486. },
  26487. path: {
  26488. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26489. colorUp: s._desat(s.newBlue, .5),
  26490. colorDown: s._darken(s.newBlue, .35),
  26491. opacity: .5,
  26492. style: "ribbon",
  26493. height: .025,
  26494. ribbonWidth: .24,
  26495. outsideHeight: .5,
  26496. waypointRadius: .5,
  26497. waypointIndoorRadius: .24,
  26498. waypointPulse: 1e3,
  26499. typ: l.BLACK,
  26500. meshFree: r.valueFromHash("mf", 1),
  26501. mapGuides: r.valueFromHash("guides", !0),
  26502. fadeInTime: 400,
  26503. fadeOutTime: 300
  26504. },
  26505. warp: {
  26506. nearPanoDist: .1,
  26507. matchCam: !1,
  26508. blur: .33,
  26509. fastTime: 1500,
  26510. teleportTime: 1500,//瞬间过渡的时间
  26511. flytimeDistanceMultiplier:150,//add
  26512. flyTime:750,//add
  26513. outsideTime: 2e3,
  26514. lookAheadMax: .3,
  26515. lookAheadDist: 2.5,
  26516. softPushDist: .37,
  26517. softPushEnd: .3,
  26518. softBendAngle: 8,
  26519. softBendTilt: 4,
  26520. softBendEnd: .3,
  26521. doBurns: true, //r.valueFromHash("kb", !0),
  26522. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26523. minBurnsAngle: 35,
  26524. minDownAngle: -35,
  26525. maxTurnPerSec: 280,
  26526. maxAimPerSec: 35,
  26527. minRotation: 12,
  26528. maxAimRotation: 33.2,
  26529. turnFriction: .2,
  26530. flySpeed: .01,
  26531. minWarpTime: 1200,
  26532. warpInterruptionRedirectTime: 500,
  26533. tourStepDelay: r.valueFromHash("st", 0),
  26534. walkDelay: 0,
  26535. walkMaxDist: 50,
  26536. walkMinDist: .8,
  26537. walkSlideShowThreshhold: 3000,
  26538. walkExtraPanosDistance: .4,
  26539. timePerMeter: 1200,
  26540. motionLeadTime: 5000,
  26541. movementEasing: "easeInOutQuad",
  26542. blendEasing: "easeInOutQuad",
  26543. showBunny: !1,
  26544. loop: r.valueFromHash("lp", !1),
  26545. auto: r.valueFromHash("ts", -1),
  26546. eOrder: 'YXZ', //"YXZ",
  26547. stepFactor: .25,
  26548. brakeStrength: 2,
  26549. minBrakeAngle: .1,
  26550. maxBrakeAngle: 1.8,
  26551. climbEffort: 4
  26552. },
  26553. rotationFriction: .05,
  26554. rotationAccelerationInside: 4.5,
  26555. rotationAccelerationOutside: .15,
  26556. rotationAfterMoveMultiplier: 40,
  26557. rotationAfterMoveHistoryCount: 5,
  26558. panFriction: .09,
  26559. panAccelerationOutside: 60,
  26560. onload: r.valueFromHash("onload", o.PANORAMA),
  26561. zoomNearLimit: .1,
  26562. zoomFarLimit: 50,
  26563. navigation: {
  26564. panoScores: !1,
  26565. mouseDirection: !0,
  26566. filterStrictness: .75,
  26567. angleFactor: -30,
  26568. directionFactor: 10,
  26569. distanceFactor: -1,
  26570. optionalityFactor: 3
  26571. },
  26572. sdkInit: !1,
  26573. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26574. console: r.valueFromHash("console", !1),
  26575. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26576. panoramaNeighbourMaxDistance: 5,
  26577. panoFloorClickRadius: .35,
  26578. showScreenshotLocations: !1,
  26579. showAxis: !1,
  26580. showNeighbourRaycasts: !1,
  26581. colorMarkerOnLoad: !1,
  26582. colorMarkerByFloor: !1,
  26583. tiling: {
  26584. panoPreRenderRepeatDelay: 2500,
  26585. panoPreRenderDelay: 500,
  26586. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26587. tilingFlagNames: ["usetiles", "tiles"],
  26588. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26589. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26590. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26591. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26592. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26593. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1),
  26594. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26595. customCompression: r.valueFromHash("tilecustcomp", 0),
  26596. // mobileHighQualityOverride: !1,
  26597. mobileHighQualityOverride: 1,
  26598. allowUltraHighResolution: true
  26599. },
  26600. zoom: {
  26601. enabled: true,
  26602. forceOff: r.valueFromHash("nozoom", 0),
  26603. overridemax: r.valueFromHash("maxzoom", null),
  26604. overridemin: r.valueFromHash("minzoom", null),
  26605. max: d.highQualityMaxZoom,
  26606. min: 1,
  26607. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26608. activationThreshold: 1.1,
  26609. restoreTime: 500
  26610. },
  26611. profiling: {
  26612. enabled: r.valueFromHash("mem", !1)
  26613. }
  26614. };
  26615. p = h.deepExtend(p, d, {
  26616. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26617. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26618. panorama: {
  26619. transitionTime: 1e3,
  26620. modelAlpha: 0,
  26621. modelAlphaDelay: p.flydown.modelTextureDelay,
  26622. modelAlphaLength: 1,
  26623. skyboxOpacity: 1,
  26624. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26625. skyboxOpacityLength: .9,
  26626. fovLength: 1,
  26627. fovDelay: 0,
  26628. cameraMatrixDuration: .8,
  26629. cameraMatrixDelay: 0,
  26630. cameraMatrixEase: c.easeInCubic,
  26631. reticuleOpacity: 1,
  26632. markerOpacity: .3,
  26633. markerOpacityOnHover: 1
  26634. },
  26635. dollhouse: {
  26636. transitionTime: 1e3,
  26637. modelAlpha: 1,
  26638. modelAlphaDelay: 0,
  26639. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26640. skyboxOpacity: 0,
  26641. skyboxOpacityDelay: 0,
  26642. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26643. fovLength: 1,
  26644. fovDelay: 0,
  26645. cameraMatrixDuration: .8,
  26646. cameraMatrixDelay: .3,
  26647. cameraMatrixEase: c.easeInCubic,
  26648. reticuleOpacity: 1,
  26649. markerOpacity: 0,
  26650. markerOpacityOnHover: 0
  26651. },
  26652. floorplan: {
  26653. transitionTime: 1e3,
  26654. modelAlpha: 1,
  26655. modelAlphaDelay: 0,
  26656. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26657. skyboxOpacity: 0,
  26658. skyboxOpacityDelay: 0,
  26659. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26660. fovLength: 1,
  26661. fovDelay: 0,
  26662. cameraMatrixDuration: .5,
  26663. cameraMatrixDelay: 0,
  26664. cameraMatrixEase: c.easeOutCubic,
  26665. reticuleOpacity: 1,
  26666. markerOpacity: 0,
  26667. markerOpacityOnHover: 0,
  26668. cameraHeight: 50
  26669. },
  26670. transitioning: {
  26671. reticuleOpacity: 0,
  26672. markerOpacity: .3,
  26673. markerOpacityOnHover: 1
  26674. },
  26675. "floorplan-dollhouse": {
  26676. rotationDelay: 0,
  26677. rotationDuration: 1
  26678. },
  26679. "floorplan-panorama": {
  26680. rotationDelay: .5,
  26681. rotationDuration: 1
  26682. },
  26683. "dollhouse-panorama": {
  26684. rotationDelay: .5,
  26685. rotationDuration: 1
  26686. },
  26687. "dollhouse-floorplan": {
  26688. rotationDelay: 0,
  26689. rotationDuration: 1,
  26690. cameraMatrixDuration: 1.05,
  26691. cameraMatrixDelay: .5
  26692. },
  26693. "panorama-dollhouse": {
  26694. rotationDelay: 0,
  26695. rotationDuration: .5
  26696. },
  26697. "panorama-floorplan": {
  26698. transitionTime: 1500,
  26699. rotationDelay: 0,
  26700. rotationDuration: .5
  26701. }
  26702. }),
  26703. p.path.meshFree && (p.path.typ = l.WALK),
  26704. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26705. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26706. window._settings = t.exports = p
  26707. }
  26708. , {
  26709. "./constants": 8,
  26710. "./enum/Colors": 19,
  26711. "./enum/VROption": 47,
  26712. "./enum/Viewmode": 51,
  26713. "./enum/WarpStyle": 52,
  26714. "./util/browser": 182,
  26715. "./util/common": 185,
  26716. "./util/easing": 186,
  26717. "./util/showcase": 193,
  26718. three: 217
  26719. }],
  26720. 167: [function(e, t, i) {
  26721. "use strict";
  26722. var n = e("three")
  26723. , r = e("./settings")
  26724. , 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"
  26725. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26726. t.exports = {
  26727. basicTextured: {
  26728. uniforms: {
  26729. tDiffuse: {
  26730. type: "t",
  26731. value: null
  26732. },
  26733. alpha: {
  26734. type: "f",
  26735. value: 1
  26736. }
  26737. },
  26738. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26739. 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}"
  26740. },
  26741. copyCubeMap: {
  26742. uniforms: {
  26743. tDiffuse: {
  26744. type: "t",
  26745. value: null
  26746. },
  26747. alpha: {
  26748. type: "f",
  26749. value: 1
  26750. }
  26751. },
  26752. 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}",
  26753. 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}"
  26754. },
  26755. cube: {
  26756. uniforms: {
  26757. map: {
  26758. type: "t",
  26759. value: null
  26760. },
  26761. opacity: {
  26762. type: "f",
  26763. value: 1
  26764. }
  26765. },
  26766. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26767. 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"
  26768. },
  26769. model: {
  26770. uniforms: {
  26771. map: {
  26772. type: "t",
  26773. value: null
  26774. },
  26775. modelAlpha: {
  26776. type: "f",
  26777. value: r.modelAlpha
  26778. },
  26779. opacity: {
  26780. type: "f",
  26781. value: 1
  26782. },
  26783. progress: {
  26784. type: "f",
  26785. value: 0
  26786. },
  26787. blackout: {
  26788. type: "i",
  26789. value: 0
  26790. },
  26791. pano0Map: {
  26792. type: "t",
  26793. value: null
  26794. },
  26795. pano0Position: {
  26796. type: "v3",
  26797. value: new n.Vector3
  26798. },
  26799. pano0Matrix: {
  26800. type: "m4",
  26801. value: new n.Matrix4
  26802. },
  26803. pano1Map: {
  26804. type: "t",
  26805. value: null
  26806. },
  26807. pano1Position: {
  26808. type: "v3",
  26809. value: new n.Vector3
  26810. },
  26811. pano1Matrix: {
  26812. type: "m4",
  26813. value: new n.Matrix4
  26814. }
  26815. },
  26816. vertexShader: o + `uniform vec3 pano0Position;
  26817. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26818. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26819. varying vec3 vWorldPosition0;
  26820. varying vec3 vWorldPosition1;
  26821. uniform int blackout;
  26822. void main() {
  26823. vUv = uv;
  26824. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26825. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26826. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26827. vWorldPosition0.x *= -1.0;
  26828. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26829. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26830. vWorldPosition1.x *= -1.0;
  26831. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26832. }`,
  26833. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26834. 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
  26835. void main() {
  26836. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26837. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26838. vec4 colorFromPanos;
  26839. if (blackout == 5){
  26840. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26841. }else{
  26842. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26843. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26844. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26845. else if (blackout == 1) {
  26846. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26847. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26848. }
  26849. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26850. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26851. }
  26852. vec4 colorFromTexture = texture2D( map, vUv );
  26853. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26854. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26855. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26856. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26857. }`
  26858. },
  26859. hot:{
  26860. uniforms:{
  26861. color:{
  26862. type: "c",
  26863. value: new n.Color( 0xff2200 )
  26864. },
  26865. opac:{
  26866. type: "f",
  26867. value: 0
  26868. },
  26869. texture1:{
  26870. type: "t",
  26871. value: null
  26872. },
  26873. texture2:{
  26874. type: "t",
  26875. value: null
  26876. }
  26877. },
  26878. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26879. 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"
  26880. },
  26881. modelOutside: {
  26882. uniforms: {
  26883. map: {
  26884. type: "t",
  26885. value: null
  26886. },
  26887. opacity: {
  26888. type: "f",
  26889. value: 1
  26890. }
  26891. },
  26892. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26893. 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"
  26894. },
  26895. ribbon: {
  26896. uniforms: {
  26897. map: {
  26898. type: "t",
  26899. value: null
  26900. },
  26901. opacity: {
  26902. type: "f",
  26903. value: 1
  26904. },
  26905. color: {
  26906. type: "c",
  26907. value: new n.Color(r.path.color)
  26908. }
  26909. },
  26910. 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",
  26911. 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"
  26912. },
  26913. waypoint: {
  26914. uniforms: {
  26915. map: {
  26916. type: "t",
  26917. value: null
  26918. },
  26919. opacity: {
  26920. type: "f",
  26921. value: 1
  26922. },
  26923. pulse: {
  26924. type: "f",
  26925. value: 1
  26926. },
  26927. nearFade: {
  26928. type: "v2",
  26929. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26930. },
  26931. color: {
  26932. type: "c",
  26933. value: new n.Color(r.reticuleColor)
  26934. }
  26935. },
  26936. 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",
  26937. 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"
  26938. },
  26939. modelDebug: {
  26940. uniforms: {
  26941. map: {
  26942. type: "t",
  26943. value: null
  26944. },
  26945. modelAlpha: {
  26946. type: "f",
  26947. value: r.modelAlpha
  26948. },
  26949. depthmapRatio: {
  26950. type: "f",
  26951. value: 0
  26952. },
  26953. opacity: {
  26954. type: "f",
  26955. value: 1
  26956. },
  26957. progress: {
  26958. type: "f",
  26959. value: 0
  26960. },
  26961. considerOcclusion: {
  26962. type: "i",
  26963. value: r.fancierTransition
  26964. },
  26965. highlightPanoSelection: {
  26966. type: "i",
  26967. value: 0
  26968. },
  26969. useThirdPano: {
  26970. type: "i",
  26971. value: r.useThirdPano
  26972. },
  26973. pano0Map: {
  26974. type: "t",
  26975. value: null
  26976. },
  26977. pano0Depth: {
  26978. type: "t",
  26979. value: null
  26980. },
  26981. pano0Position: {
  26982. type: "v3",
  26983. value: new n.Vector3
  26984. },
  26985. pano0Matrix: {
  26986. type: "m4",
  26987. value: new n.Matrix4
  26988. },
  26989. pano0Weight: {
  26990. type: "f",
  26991. value: r.transition.pano0Weight
  26992. },
  26993. pano1Map: {
  26994. type: "t",
  26995. value: null
  26996. },
  26997. pano1Depth: {
  26998. type: "t",
  26999. value: null
  27000. },
  27001. pano1Position: {
  27002. type: "v3",
  27003. value: new n.Vector3
  27004. },
  27005. pano1Matrix: {
  27006. type: "m4",
  27007. value: new n.Matrix4
  27008. },
  27009. pano1Weight: {
  27010. type: "f",
  27011. value: r.transition.pano1Weight
  27012. },
  27013. pano2Map: {
  27014. type: "t",
  27015. value: null
  27016. },
  27017. pano2Depth: {
  27018. type: "t",
  27019. value: null
  27020. },
  27021. pano2Position: {
  27022. type: "v3",
  27023. value: new n.Vector3
  27024. },
  27025. pano2Matrix: {
  27026. type: "m4",
  27027. value: new n.Matrix4
  27028. },
  27029. pano2Weight: {
  27030. type: "f",
  27031. value: r.transition.pano2Weight
  27032. }
  27033. },
  27034. 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",
  27035. 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"
  27036. },
  27037. customDepth: {
  27038. uniforms: {
  27039. panoPosition: {
  27040. type: "v3",
  27041. value: new n.Vector3
  27042. }
  27043. },
  27044. 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",
  27045. 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"
  27046. },
  27047. skysphere: {
  27048. uniforms: {
  27049. radius: {
  27050. type: "f",
  27051. value: 0
  27052. }
  27053. },
  27054. 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",
  27055. 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"
  27056. },
  27057. tagDisc: {
  27058. uniforms: {
  27059. opacity: {
  27060. type: "f",
  27061. value: 0
  27062. },
  27063. color: {
  27064. type: "c",
  27065. value: new n.Color
  27066. },
  27067. bg: {
  27068. type: "t",
  27069. value: null
  27070. },
  27071. mask: {
  27072. type: "t",
  27073. value: null
  27074. }
  27075. },
  27076. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27077. 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"
  27078. }
  27079. }
  27080. }
  27081. , {
  27082. "./settings": 166,
  27083. three: 217
  27084. }],
  27085. 168: [function(e, t, i) {
  27086. (function(i) {
  27087. "use strict";
  27088. var n = e("three")
  27089. , r = (e("url"),
  27090. e("./util/ajax"))
  27091. , o = e("./settings")
  27092. , a = e("./util/logger")
  27093. , s = e("./util/math")
  27094. , l = e("./util/showcase")
  27095. , c = e("./objects/Panorama")
  27096. , h = new a(i)
  27097. , u = e("./model/Model")
  27098. , d = e("./shaders")
  27099. , p = e("./util/transitions")
  27100. , f = e("./objects/Chunk")
  27101. , g = e("./objects/Reticule")
  27102. , m = e("./objects/Skybox")
  27103. , v = e("./objects/Floor")
  27104. , A = e("./cameras/DollhouseCamera")
  27105. , y = e("./cameras/FloorplanCamera")
  27106. , C = e("./cameras/PanoramaCamera")
  27107. , I = e("./controls/DollhouseControls")
  27108. , E = e("./controls/FloorplanControls")
  27109. , b = e("./controls/PanoramaControls");
  27110. n.ImageUtils.crossOrigin = o.crossOrigin,
  27111. t.exports = {
  27112. shaders: d,
  27113. transitions: p,
  27114. Model: u,
  27115. Chunk: f,
  27116. Floor: v,
  27117. Skybox: m,
  27118. Reticule: g,
  27119. Panorama: c,
  27120. DollhouseCamera: A,
  27121. FloorplanCamera: y,
  27122. PanoramaCamera: C,
  27123. DollhouseControls: I,
  27124. FloorplanControls: E,
  27125. PanoramaControls: b,
  27126. getModel: function(e) {
  27127. if (!e.url)
  27128. throw 'getModel(): missing parameter "url"';
  27129. e.autoload = void 0 === e.autoload || e.autoload;
  27130. var t = l.parseSidUrl(e.url);
  27131. e.urlBase = t.urlBase,
  27132. e.urlModel = t.urlModel,
  27133. e.urlFiles = t.urlFiles;
  27134. var i = this._getPlatformError();
  27135. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27136. this._loadModel().then(this._buildModel.bind(this)))
  27137. },
  27138. _getPlatformError: function() {
  27139. 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"
  27140. },
  27141. _loadModel: function() {
  27142. return r.get(this.options.urlModel, {
  27143. responseType: "json",
  27144. prefetchFrom: "model",
  27145. auth: l.getAuthorizationHeader()
  27146. }).then(null, function() {
  27147. return h.warn("Model loading failed at initial metadata load"),
  27148. "loading-failed"
  27149. })
  27150. },
  27151. _buildModel: function(e) {
  27152. e = l.normalizeModeldata(e, s);
  27153. var t = new u(this.options,e);
  27154. return this.options.autoload ? t.load(!0) : $.when(t)
  27155. }
  27156. }
  27157. }
  27158. ).call(this, "/js/showcase.js")
  27159. }
  27160. , {
  27161. "./cameras/DollhouseCamera": 5,
  27162. "./cameras/FloorplanCamera": 6,
  27163. "./cameras/PanoramaCamera": 7,
  27164. "./controls/DollhouseControls": 10,
  27165. "./controls/FloorplanControls": 11,
  27166. "./controls/PanoramaControls": 13,
  27167. "./model/Model": 139,
  27168. "./objects/Chunk": 144,
  27169. "./objects/Floor": 146,
  27170. "./objects/Panorama": 148,
  27171. "./objects/Reticule": 149,
  27172. "./objects/Skybox": 152,
  27173. "./settings": 166,
  27174. "./shaders": 167,
  27175. "./util/ajax": 181,
  27176. "./util/logger": 189,
  27177. "./util/math": 190,
  27178. "./util/showcase": 193,
  27179. "./util/transitions": 195,
  27180. three: 217,
  27181. url: 208
  27182. }],
  27183. 169: [function(e, t, i) {
  27184. "use strict";
  27185. function n() {
  27186. var e = {
  27187. renderTarget: null,
  27188. inUse: !1,
  27189. size: -1,
  27190. pano: null
  27191. };
  27192. return e
  27193. }
  27194. function r(e) {
  27195. M.push(e)
  27196. }
  27197. function o(e) {
  27198. var t = n();
  27199. return t.inUse = !0,
  27200. t.size = e,
  27201. r(t),
  27202. t
  27203. }
  27204. function a(e) {
  27205. for (var t = 0; t < M.length; t++) {
  27206. var i = M[t];
  27207. if (!i.inUse && i.size === e)
  27208. return i.inUse = !0,
  27209. i
  27210. }
  27211. return null
  27212. }
  27213. function s(e) {
  27214. for (var t = 0; t < M.length; t++) {
  27215. var i = M[t];
  27216. if (i.renderTarget === e)
  27217. return i.inUse = !1,
  27218. !0
  27219. }
  27220. return !1
  27221. }
  27222. function l() {
  27223. this.tileDirectory = {},
  27224. this.activeRenderTargetDescriptors = {},
  27225. this.activePanos = [],
  27226. this.panoLODDescriptors = {},
  27227. this.panoDescriptors = {},
  27228. this.tileTrees = {},
  27229. this.sceneRenderer = null,
  27230. this.tileDownloader = null,
  27231. this.forceQueue = [],
  27232. this.uploadQueues = {},
  27233. this.uploadInterval = null,
  27234. this.uploadIntervalCancelled = !1,
  27235. this.usingTileOverlay = !1,
  27236. this.overlayTilesLoaded = !1,
  27237. this.overlayTileBase = null,
  27238. this.overlayTilesBasic = {},
  27239. this.overlayTilesEnhanced = {},
  27240. this.zoomRenderTarget = null,
  27241. this.zoomPano = null,
  27242. this.zoomingActive = !1,
  27243. this.zoomPanoId = null,
  27244. this.zoomPanoRenderingDisabled = !1,
  27245. this.direction = new h.Vector3,
  27246. this.initTime = -1,
  27247. this.maxBaseUploadsPerFrame = x,
  27248. this.maxNonBaseUploadsPerFrame = T
  27249. }
  27250. function c() {
  27251. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27252. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27253. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27254. }
  27255. var h = e("three")
  27256. , u = e("../exception/BasicException")
  27257. , d = e("../settings")
  27258. , p = e("../enum/PanoSizeClass")
  27259. , f = (e("../objects/Panorama"),
  27260. e("../enum/PanoRendererEvents"))
  27261. , g = e("../enum/SceneRendererEvents")
  27262. , m = e("../enum/TileDownloaderEvents")
  27263. , v = e("../enum/Vectors")
  27264. , A = (e("../enum/GLCubeFaces"),
  27265. e("../objects/Panorama"),
  27266. e("./TileTree"))
  27267. , y = (e("./TileDownloader"),
  27268. e("./TilePrioritizer"))
  27269. , C = e("./TileUtils")
  27270. , p = e("../enum/PanoSizeClass")
  27271. , I = (e("../util/browser"),
  27272. e("../util/panorama"))
  27273. , E = e("events").EventEmitter
  27274. , b = !1
  27275. , w = d.tiling.uploadIntervalDelay
  27276. , _ = d.tiling.initialIntervalDelay
  27277. , T = d.tiling.maxNonBaseUploadsPerFrame
  27278. , x = d.tiling.maxBaseUploadsPerFrame
  27279. , S = {
  27280. Base: 0,
  27281. Remaining: 1
  27282. }
  27283. , M = [];
  27284. l.prototype = Object.create(E.prototype),
  27285. l.prototype.init = function(e, t, i) {
  27286. this.sceneRenderer = e,
  27287. this.tileDownloader = t,
  27288. this.qualityManager = i,
  27289. this.bindEvents(),
  27290. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27291. this.initTime = performance.now()
  27292. }
  27293. ,
  27294. l.prototype.getActivePanoTextures = function(e) {
  27295. e = e || [];
  27296. for (var t = 0; t < M.length; t++) {
  27297. var i = M[t];
  27298. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27299. }
  27300. }
  27301. ,
  27302. l.prototype.hasQueuedTiles = function() {
  27303. var e = this.peekNextFromUploadQueue();
  27304. return null !== e && void 0 !== e
  27305. }
  27306. ,
  27307. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27308. return this.activeRenderTargetDescriptors[e]
  27309. }
  27310. ,
  27311. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27312. this.activeRenderTargetDescriptors[e] = t
  27313. }
  27314. ,
  27315. l.prototype.loadOverlayTiles = function() {
  27316. if (0 !== d.tiling.overlayStyle) {
  27317. var e = 0
  27318. , t = function(t, n, r) {
  27319. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27320. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27321. e++,
  27322. e === i.length && (this.overlayTilesLoaded = !0)
  27323. }
  27324. .bind(this)
  27325. , i = [["static/images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["static/images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["static/images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["static/images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["static/images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["static/images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["static/images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["static/images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["static/images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["static/images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["static/images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  27326. i.forEach(function(e) {
  27327. this.tileDownloader.loadImage(e[0], 0, e[1])
  27328. }
  27329. .bind(this)),
  27330. this.usingTileOverlay = !0
  27331. } else
  27332. this.usingTileOverlay = !1
  27333. }
  27334. ,
  27335. l.prototype.bindEvents = function() {
  27336. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27337. }
  27338. ,
  27339. l.prototype.setupZoomRenderTarget = function() {
  27340. var targets = {};
  27341. return function(){
  27342. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27343. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27344. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27345. return;
  27346. var e = this.zoomRenderTarget;
  27347. var size = this.qualityManager.getMaxZoomPanoSize()
  27348. if(size > this.qualityManager.maxRenderTargetSize){
  27349. return
  27350. }
  27351. if(targets[size]){
  27352. this.zoomRenderTarget = targets[size]
  27353. }else{
  27354. this.zoomRenderTarget = this.initTiledPano(size, true )//放大后不使用抗锯齿,否则消耗更多内存
  27355. targets[size] = this.zoomRenderTarget
  27356. }
  27357. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  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. ,
  27373. l.prototype.enableHighQuality = function(e) {
  27374. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27375. if (!this.qualityManager.highQualityModeStarted) {
  27376. this.setupZoomRenderTarget()
  27377. e()
  27378. this.qualityManager.highQualityModeStarted = true
  27379. }
  27380. }
  27381. l.prototype.enableUltraHighQualityMode = function(e) {
  27382. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27383. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27384. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27385. t && (this.qualityManager.enableUltraHighQualityMode(),
  27386. this.setupZoomRenderTarget(),
  27387. e())
  27388. }
  27389. .bind(this))
  27390. }
  27391. }
  27392. ,
  27393. l.prototype.activateTiledPano = function(e, t, i) {
  27394. i && this.clearAllQueuedUploads();
  27395. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27396. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27397. this.linkAllTilesAndNodes(e);
  27398. var r = this.getActiveRenderTargetDescriptor(e.id)
  27399. , l = t;
  27400. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27401. !r || l !== r.size) {
  27402. if (r && s(r.renderTarget),
  27403. r = a(l),
  27404. !r) {
  27405. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27406. r = o(c.width),
  27407. r.renderTarget = c
  27408. }
  27409. r.pano = e,
  27410. this.resetPanoDescriptor(e.id),
  27411. this.resetPanoLODDescriptors(e.id),
  27412. this.resetRenderStatus(e.id, !0, !0)
  27413. }
  27414. this.setActiveRenderTargetDescriptor(e.id, r);
  27415. var h = i ? 0 : 1;
  27416. return this.updateActivePanos(e, h),
  27417. r.renderTarget
  27418. }
  27419. ,
  27420. l.prototype.deactivateTiledPano = function(e) {
  27421. var t = this.getActiveRenderTargetDescriptor(e.id);
  27422. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27423. this.setActiveRenderTargetDescriptor(e.id, null);
  27424. var i = this.getUploadQueueForPano(e.id);
  27425. this.clearUploadQueue(i),
  27426. this.updateActivePanos()
  27427. }
  27428. ,
  27429. l.prototype.updateActivePanos = function() {
  27430. var e = [];
  27431. return function(t, i) {
  27432. e.length = 0;
  27433. for (var n = 0; n < this.activePanos.length; n++) {
  27434. t && e.length === i && e.push(t);
  27435. var r = this.activePanos[n]
  27436. , o = this.getActiveRenderTargetDescriptor(r.id);
  27437. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27438. }
  27439. t && i >= e.length && e.push(t),
  27440. this.activePanos.length = 0,
  27441. this.activePanos.push.apply(this.activePanos, e)
  27442. }
  27443. }(),
  27444. l.prototype.getActivePanoCount = function() {
  27445. return this.activePanos.length
  27446. }
  27447. ,
  27448. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27449. var r = null;
  27450. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27451. for (var o = function(e, n, r, o) {
  27452. i && (n.tile.zoomUploaded = !1),
  27453. t && (n.tile.uploaded = !1)
  27454. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27455. var s = this.getTileTree(e, a);
  27456. s.breadthFirst({
  27457. callback: o.bind(this, a),
  27458. minLevel: r
  27459. })
  27460. }
  27461. }
  27462. ,
  27463. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27464. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27465. t.tile.zoomUploaded = t.tile.uploaded,
  27466. t.zoomCovered = t.covered
  27467. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27468. var r = this.getTileTree(e, n);
  27469. r.breadthFirst({
  27470. callback: i.bind(this, n),
  27471. maxLevel: t
  27472. })
  27473. }
  27474. }
  27475. ,
  27476. l.prototype.renderPanoTiles = function() {
  27477. var e = [];
  27478. return function(t, i, n, r) {
  27479. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27480. i = i || this.direction || v.FORWARD;
  27481. var o = this.getActiveRenderTargetDescriptor(t);
  27482. if (!this.isRenderTargetDescriptorValid(o))
  27483. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27484. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27485. var s = this.getTileTree(t, a);
  27486. e.length = 0,
  27487. s.breadthFirst({
  27488. saveVisited: e
  27489. });
  27490. for (var l = 0; l < e.length; l++) {
  27491. var c = e[l];
  27492. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27493. }
  27494. }
  27495. this.updateDirection(i)
  27496. }
  27497. }(),
  27498. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27499. return e && e.renderTarget
  27500. }
  27501. ,
  27502. l.prototype.isPanoActive = function(e) {
  27503. var t = this.getActiveRenderTargetDescriptor(e);
  27504. return this.isRenderTargetDescriptorValid(t)
  27505. }
  27506. ,
  27507. l.prototype.isPanoZoomed = function(e) {
  27508. return this.zoomingActive && this.zoomPanoId === e
  27509. }
  27510. ,
  27511. l.prototype.initTileTree = function(e, t, i) {
  27512. var n = this.tileTrees[e];
  27513. n || (n = [],
  27514. this.tileTrees[e] = n);
  27515. var r = n[t];
  27516. if (!r) {
  27517. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27518. r = new A(C.TILE_SIZE,o),
  27519. n[t] = r
  27520. }
  27521. }
  27522. ,
  27523. l.prototype.getTileTree = function(e, t) {
  27524. var i = this.tileTrees[e];
  27525. if (!i)
  27526. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27527. var n = i[t];
  27528. if (!n)
  27529. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27530. return n
  27531. }
  27532. ,
  27533. l.prototype.initTiledPano = function(e, antialias) {
  27534. var i = this.sceneRenderer.renderer
  27535. , n = (i.context,
  27536. new h.WebGLRenderTargetCube(e,e,{
  27537. stencilBuffer: !1
  27538. }))
  27539. , r = new h.CubeTexture([]);
  27540. n.texture = r,
  27541. r.image = [null, null, null, null, null, null],
  27542. r.flipY = !0,
  27543. antialias ? (r.generateMipmaps = !0,
  27544. r.magFilter = h.LinearFilter,
  27545. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27546. r.magFilter = h.LinearFilter,
  27547. r.minFilter = h.LinearFilter),
  27548. r.format = h.RGBAFormat,
  27549. i.setRenderTarget(n),
  27550. i.setRenderTarget(null);
  27551. var o = i.properties.get(r);
  27552. return o.__image__webglTextureCube = o.__webglTexture,
  27553. n
  27554. }
  27555. ,
  27556. l.prototype.getUploadQueueForPano = function(e) {
  27557. var t = this.uploadQueues[e];
  27558. return t || (t = [],
  27559. this.uploadQueues[e] = t),
  27560. t
  27561. }
  27562. ,
  27563. l.prototype.isTileUploaded = function(e) {
  27564. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27565. }
  27566. ,
  27567. l.prototype.setUploaded = function(e, t) {
  27568. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27569. }
  27570. ,
  27571. l.prototype.queueTileUpload = function(e, t, i) {
  27572. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27573. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27574. var r = this.getUploadQueueForPano(e.panoId);
  27575. 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),
  27576. e.uploadQueued = !0,
  27577. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27578. }
  27579. }
  27580. ,
  27581. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27582. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27583. }
  27584. ,
  27585. l.prototype.getTopUploadQueue = function() {
  27586. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27587. for (var n = 0; n < this.activePanos.length; n++)
  27588. if (e = this.activePanos[n],
  27589. t = this.getUploadQueueForPano(e.id),
  27590. t.length > 0)
  27591. switch (i) {
  27592. case S.Base:
  27593. if (0 === t[0].level)
  27594. return t;
  27595. break;
  27596. case S.Remaining:
  27597. return t
  27598. }
  27599. return null
  27600. }
  27601. ,
  27602. l.prototype.getNextFromUploadQueue = function() {
  27603. var e = function(e) {
  27604. var t = e.shift();
  27605. return t.uploadQueued = !1,
  27606. t
  27607. };
  27608. return function() {
  27609. if (this.forceQueue.length > 0)
  27610. return e(this.forceQueue);
  27611. var t = this.getTopUploadQueue();
  27612. return t && t.length > 0 ? e(t) : null
  27613. }
  27614. }(),
  27615. l.prototype.peekNextFromUploadQueue = function() {
  27616. if (this.forceQueue.length > 0)
  27617. return this.forceQueue[0];
  27618. var e = this.getTopUploadQueue();
  27619. return e && e.length > 0 ? e[0] : null
  27620. }
  27621. ,
  27622. l.prototype.clearAllQueuedUploads = function() {
  27623. this.clearAllUploadQueues(null, 0)
  27624. }
  27625. ,
  27626. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27627. this.clearAllUploadQueues(e, 0)
  27628. }
  27629. ,
  27630. l.prototype.clearAllUploadQueues = function(e, t) {
  27631. if (e)
  27632. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27633. this.clearUploadQueue(this.forceQueue, t, e);
  27634. else {
  27635. for (var i = 0; i < this.activePanos.length; i++) {
  27636. var n = this.activePanos[i];
  27637. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27638. }
  27639. this.clearUploadQueue(this.forceQueue, t)
  27640. }
  27641. }
  27642. ,
  27643. l.prototype.clearUploadQueue = function(e, t, i) {
  27644. void 0 !== t && null !== t || (t = 0);
  27645. for (var n = 0; n < e.length; ) {
  27646. var r = e[n];
  27647. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27648. e.splice(n, 1)) : n++
  27649. }
  27650. }
  27651. ,
  27652. l.prototype.refreshUploadInterval = function() {
  27653. var e = null;
  27654. return function(t) {
  27655. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27656. null !== t && void 0 !== t || (t = w),
  27657. b || (t = _),
  27658. this.uploadInterval = window.setTimeout(e, t),
  27659. this.uploadIntervalDelay = t)
  27660. }
  27661. }(),
  27662. l.prototype.update = function() {
  27663. var e = performance.now()
  27664. , t = 0;
  27665. return function() {
  27666. this.uploadIntervalCancelled = !0,
  27667. window.clearTimeout(this.uploadInterval),
  27668. this.uploadInterval = null;
  27669. var i = performance.now() - e;
  27670. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27671. e = performance.now()),
  27672. t++
  27673. }
  27674. }(),
  27675. l.prototype.updateUploadQueue = function(e, t) {
  27676. e || (e = 1);
  27677. for (var i = 0, n = 0; ; ) {
  27678. if (n >= t || i >= e)
  27679. break;
  27680. var r = this.getNextFromUploadQueue();
  27681. if (!r)
  27682. break;
  27683. if (0 !== r.level ? i++ : n++,
  27684. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27685. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27686. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27687. }
  27688. }
  27689. }
  27690. ,
  27691. l.prototype.updateDirection = function(e) {
  27692. if (e = e || this.direction) {
  27693. this.direction = e;
  27694. for (var t = 0; t < this.activePanos.length; t++) {
  27695. var i = this.activePanos[t]
  27696. , n = this.getUploadQueueForPano(i.id);
  27697. y.sortPanoTiles(n, i, this.direction)
  27698. }
  27699. }
  27700. }
  27701. ,
  27702. l.prototype.uploadTile = function() {
  27703. var e = {}
  27704. , t = (new h.Vector4,
  27705. d.tiling.overlayStyle);
  27706. //var failHistory = {};
  27707. return function(i, n) {
  27708. var r = i.panoId
  27709. , o = i.image
  27710. , a = i.tileSize
  27711. , s = i.panoSize
  27712. , l = i.tileIndex
  27713. , c = (i.faceTileIndex,
  27714. i.totalTiles)
  27715. , u = (i.face,
  27716. i.tileX)
  27717. , d = i.tileY
  27718. , p = !0
  27719. , g = !1
  27720. , m = (this.getPanoDescriptor(r),
  27721. this.getPanoLODDescriptor(r, s))
  27722. , v = this.getActiveRenderTargetDescriptor(r)
  27723. , A = v.renderTarget
  27724. , y = v.size;
  27725. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27726. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27727. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27728. g = !1),
  27729. n || (this.anyUploaded(i.node) && (p = !1,
  27730. g = !0),
  27731. this.isTileUploaded(i) && (p = !1,
  27732. g = !1)),
  27733. p) {
  27734. /* if(failHistory[''+r+s+l]){
  27735. console.log('uploadTile retry', r, s, l)
  27736. }
  27737. console.log('uploadTile 成功', r, s, l)
  27738. */
  27739. var C = u * a
  27740. , I = d * a
  27741. , E = a / s * y
  27742. , b = C / s * y
  27743. , w = I / s * y;
  27744. if (s > this.qualityManager.maxRenderTargetSize) {
  27745. player.model.getHighImage(o, i.cubeFace, u, d)
  27746. }else{
  27747. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27748. var _ = e[a]
  27749. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27750. if ( 1 === t || 2 === t) {
  27751. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27752. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27753. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27754. } else
  27755. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27756. }
  27757. m.uploadCount++,
  27758. this.emit(f.TileRenderSuccess, r, s, l, c),
  27759. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27760. this.setUploaded(i, !0),
  27761. this.addCoverageForNode(i.node)
  27762. } else{
  27763. this.setUploaded(i, !1);
  27764. //console.log('uploadTile 失败', r, s, l)
  27765. //failHistory[''+r+s+l] = true;
  27766. }
  27767. return i.uploadAttempted || (m.uploadAttempts++,
  27768. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27769. i.uploadAttempted = !0,
  27770. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27771. g
  27772. }
  27773. }(),
  27774. l.prototype.linkTileAndNode = function(e, t) {
  27775. t.tile = e,
  27776. e.node = t
  27777. }
  27778. ,
  27779. l.prototype.linkAllTilesAndNodes = function(e) {
  27780. for (var t = function(t, i, n, r, o) {
  27781. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27782. this.linkTileAndNode(a, n)
  27783. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27784. var n = this.getTileTree(e.id, i);
  27785. n.breadthFirst({
  27786. callback: t.bind(this, n, i)
  27787. })
  27788. }
  27789. }
  27790. ,
  27791. l.prototype.anyUploaded = function(e) {
  27792. if (!e)
  27793. return !1;
  27794. if (e.tile && this.isTileUploaded(e.tile))
  27795. return !0;
  27796. if (e.children)
  27797. for (var t = 0; t < e.children.length; t++) {
  27798. var i = e.children[t];
  27799. if (this.anyUploaded(i))
  27800. return !0
  27801. }
  27802. return !1
  27803. }
  27804. ,
  27805. l.prototype.setNodeCovered = function(e, t) {
  27806. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27807. }
  27808. ,
  27809. l.prototype.isNodeCovered = function(e) {
  27810. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27811. }
  27812. ,
  27813. l.prototype.addCoverageForNode = function(e) {
  27814. if (this.setNodeCovered(e, !0),
  27815. e.parent && e.covered) {
  27816. var t = e.parent;
  27817. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27818. }
  27819. }
  27820. ,
  27821. l.prototype.calcFullCoverage = function(e) {
  27822. var t = !1;
  27823. if (e.children)
  27824. for (var i = 0; i < e.children.length; i++) {
  27825. var n = e.children[i];
  27826. t = t || this.calcFullCoverage(n)
  27827. }
  27828. e.covered = e.tile.uploaded || t
  27829. }
  27830. ,
  27831. l.prototype.nodeSubcovered = function(e) {
  27832. if (!e.children)
  27833. return !1;
  27834. for (var t = 0; t < e.children.length; t++)
  27835. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27836. return !1;
  27837. return !0
  27838. }
  27839. ,
  27840. l.prototype.resetPanoDescriptor = function(e) {
  27841. this.getPanoDescriptor(e)
  27842. }
  27843. ,
  27844. l.prototype.getPanoDescriptor = function(e) {
  27845. var t = this.panoDescriptors[e];
  27846. return t || (t = {},
  27847. this.panoDescriptors[e] = t),
  27848. t
  27849. }
  27850. ,
  27851. l.prototype.resetPanoLODDescriptors = function(e) {
  27852. var t = this.getPanoLODDescriptors(e);
  27853. for (var i in t)
  27854. if (t.hasOwnProperty(i)) {
  27855. var n = t[i];
  27856. n.uploadCount = 0,
  27857. n.uploadAttempts = 0
  27858. }
  27859. }
  27860. ,
  27861. l.prototype.getPanoLODDescriptor = function(e, t) {
  27862. var i = this.getPanoLODDescriptors(e)
  27863. , n = i[t];
  27864. return n || (n = {
  27865. uploadCount: 0,
  27866. uploadAttempts: 0
  27867. },
  27868. i[t] = n),
  27869. n
  27870. }
  27871. ,
  27872. l.prototype.getPanoLODDescriptors = function(e) {
  27873. var t = this.panoLODDescriptors[e];
  27874. return t || (t = {},
  27875. this.panoLODDescriptors[e] = t),
  27876. t
  27877. }
  27878. ,
  27879. l.prototype.onTileDownloaded = function(e) {
  27880. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27881. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27882. if (i.downloaded = !0,
  27883. i.image = e.image,
  27884. i.panoSize = e.panoSize,
  27885. i.tileX = e.tileX,
  27886. i.tileY = e.tileY,
  27887. i.totalTiles = e.totalTiles,
  27888. i.tileIndex = e.tileIndex,
  27889. i.faceTileIndex = e.faceTileIndex,
  27890. i.face = e.face,
  27891. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27892. i.panoId = e.panoId,
  27893. i.tileSize = e.tileSize,
  27894. i.direction = (new h.Vector3).copy(e.direction),
  27895. i.node = null,
  27896. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27897. this.isPanoActive(i.panoId)) {
  27898. var n = this.getTileTree(i.panoId, i.face)
  27899. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27900. this.linkTileAndNode(i, r),
  27901. this.queueTileUpload(i, !0)
  27902. }
  27903. }
  27904. ,
  27905. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27906. var r = this.tileDirectory[e];
  27907. r || (r = {},
  27908. this.tileDirectory[e] = r);
  27909. var o = 16384 * t + 1024 * i + n
  27910. , a = r[o];
  27911. return a || (a = {
  27912. downloaded: !1,
  27913. uploaded: !1,
  27914. zoomUploaded: !1
  27915. },
  27916. r[o] = a),
  27917. a._key = e + ":" + t + ":" + i + ":" + n,
  27918. a._tileKey = o,
  27919. a
  27920. }
  27921. ,
  27922. l.prototype.setZoomingActive = function(e, t, i) {
  27923. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27924. this.zoomPanoId = t.id,
  27925. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27926. }
  27927. ,
  27928. l.prototype.updateZoomedPanoFromBase = function(e) {
  27929. if (!this.zoomPanoRenderingDisabled) {
  27930. var t = this.getActiveRenderTargetDescriptor(e.id);
  27931. if (t && t.renderTarget) {
  27932. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  27933. n = t.renderTarget
  27934. , r = t.size;
  27935. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27936. this.copyBaseRenderStatusToZoomed(e.id)
  27937. }
  27938. }
  27939. }
  27940. ,
  27941. t.exports = l
  27942. }
  27943. , {
  27944. "../enum/GLCubeFaces": 25,
  27945. "../enum/PanoRendererEvents": 35,
  27946. "../enum/PanoSizeClass": 36,
  27947. "../enum/SceneRendererEvents": 43,
  27948. "../enum/TileDownloaderEvents": 45,
  27949. "../enum/Vectors": 50,
  27950. "../exception/BasicException": 55,
  27951. "../objects/Panorama": 148,
  27952. "../settings": 166,
  27953. "../util/browser": 182,
  27954. "../util/panorama": 191,
  27955. "./TileDownloader": 171,
  27956. "./TilePrioritizer": 172,
  27957. "./TileTree": 173,
  27958. "./TileUtils": 174,
  27959. events: 202,
  27960. three: 217
  27961. }],
  27962. 170: [function(e, t, i) {
  27963. "use strict";
  27964. function n(e, t, i) {
  27965. this.maxNavPanoSize = -1,
  27966. this.maxZoomPanoSize = -1,
  27967. this.devicePixelDensity = e,
  27968. this.deviceScreenSize = t,
  27969. this.clientBandwidth = i,
  27970. this.panoSizeClassMap = {},
  27971. this.useHighResolutionPanos = !0,
  27972. this.useUltraHighResolutionPanos = !1,
  27973. this.modelHasUltraHighPanos = !1
  27974. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  27975. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  27976. }
  27977. var r = e("../enum/PanoSizeClass")
  27978. , o = e("../settings")
  27979. , a = e("../util/browser")
  27980. , s = e("../constants")
  27981. , l = e("../util/showcase")
  27982. , c = e("../enum/ModelManagerEvents");
  27983. n.prototype.init = function(e) {
  27984. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27985. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27986. this.highSize = this.getPanoSize(r.HIGH),
  27987. this.standardSize = this.getPanoSize(r.STANDARD),
  27988. this.baseSize = this.getPanoSize(r.BASE),
  27989. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27990. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27991. this.updateMaximums(),
  27992. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27993. }
  27994. ,
  27995. n.prototype.updateFromModel = function(e) {
  27996. this.updateHighResolutionSettings(e),
  27997. this.updateUltraHighResolutionSettings(e)
  27998. }
  27999. ,
  28000. n.prototype.updateHighResolutionSettings = function(e) {
  28001. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  28002. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28003. //this.useHighResolutionPanos = !0;
  28004. //----------------------e n d -----------------------------------------------------------------
  28005. this.updateMaximums()
  28006. }
  28007. ,
  28008. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28009. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28010. this.updateMaximums()
  28011. }
  28012. ,
  28013. n.prototype.enableUltraHighQualityMode = function() {
  28014. this.modelHasUltraHighPanos = !0,
  28015. this.updateUltraHighResolutionSettings(null)
  28016. }
  28017. ,
  28018. n.prototype.ultraHighQualityModeEnabled = function() {
  28019. return this.modelHasUltraHighPanos
  28020. }
  28021. ,
  28022. n.prototype.onModelChanged = function(e) {
  28023. this.updateFromModel(e.model),
  28024. this.updateMaximums()
  28025. }
  28026. ,
  28027. n.prototype.updateMaximums = function() {
  28028. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28029. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28030. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28031. }
  28032. ,
  28033. n.prototype.buildPanoSizeClassMap = function() {
  28034. this.panoSizeClassMap[r.BASE] = 512,
  28035. this.panoSizeClassMap[r.STANDARD] = 1024,
  28036. this.panoSizeClassMap[r.HIGH] = 2048,
  28037. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28038. }
  28039. ,
  28040. n.prototype.getPanoSize = function(e) {
  28041. return this.panoSizeClassMap[e]
  28042. }
  28043. ,
  28044. n.prototype.getMaxPossiblePanoSize = function() {
  28045. return this.getPanoSize(r.ULTRAHIGH)
  28046. }
  28047. ,
  28048. n.prototype.getMaxPanoSize = function() {
  28049. return this.maxZoomPanoSize
  28050. }
  28051. ,
  28052. n.prototype.getMaxNavPanoSize = function() {
  28053. return this.maxNavPanoSize
  28054. }
  28055. ,
  28056. n.prototype.getMaxZoomPanoSize = function() {
  28057. return this.maxZoomPanoSize
  28058. }
  28059. ,
  28060. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  28061. if(settings.mobileNavHigh)return r.HIGH //改
  28062. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28063. } */
  28064. n.prototype.detectDevice = function(){//add
  28065. if(a.isMobile()){
  28066. let area = $("#player").width() * $("#player").height()
  28067. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  28068. return 'mobile'
  28069. }else{
  28070. return 'bigMobile'
  28071. }
  28072. }else{
  28073. return 'pc'
  28074. }
  28075. }
  28076. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  28077. switch(this.getNavZoomClass()){
  28078. case '1k':
  28079. return r.STANDARD;
  28080. break;
  28081. case '2k':
  28082. default:
  28083. return r.HIGH;
  28084. case '4k': //虽然这种暂不支持
  28085. return r.ULTRAHIGH;
  28086. }
  28087. }
  28088. ,
  28089. n.prototype.detectMaxNavPanoSize = function() {
  28090. var e = this.detectMaxNavPanoSizeClass();
  28091. return this.getPanoSize(e)
  28092. }
  28093. ,
  28094. n.prototype.getMaxZoomClass = function(){//add
  28095. let type = this.detectDevice()
  28096. let setting = settings.tileClass[type] //见manage.js的settings
  28097. return setting.max
  28098. }
  28099. n.prototype.getNavZoomClass = function(){//add
  28100. let type = this.detectDevice()
  28101. let setting = settings.tileClass[type]
  28102. return setting.nav
  28103. }
  28104. ,
  28105. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  28106. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  28107. if (this.zoomLevelResolution) {//有三个级别
  28108. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  28109. return this.getPanoSize(r.ULTRAHIGH)
  28110. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  28111. return this.getPanoSize(r.STANDARD)
  28112. } else {
  28113. return this.getPanoSize(r.HIGH)
  28114. }
  28115. } else {
  28116. let tileClass = this.getMaxZoomClass()
  28117. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  28118. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  28119. return this.getPanoSize(r.ULTRAHIGH);
  28120. }else{//'2k'
  28121. return this.getPanoSize(r.HIGH);
  28122. }
  28123. }
  28124. }
  28125. /* n.prototype.detectMaxZoomPanoSize = function() {
  28126. 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)
  28127. } */
  28128. ,
  28129. t.exports = n
  28130. }
  28131. , {
  28132. "../constants": 8,
  28133. "../enum/ModelManagerEvents": 33,
  28134. "../enum/PanoSizeClass": 36,
  28135. "../settings": 166,
  28136. "../util/browser": 182,
  28137. "../util/showcase": 193
  28138. }],
  28139. 171: [function(e, t, i) {
  28140. (function(i) {
  28141. "use strict";
  28142. function n(e) {
  28143. this.panos = null,
  28144. this.retryMinimumTime = 1e4,
  28145. this.urls = null,
  28146. this.panoLoadCallbacks = {},
  28147. this.downloadDescriptors = {},
  28148. this.priorityQueue = [],
  28149. this.forceQueue = [],
  28150. this.activeDownloads = [],
  28151. this.qualityManager = null,
  28152. this.tilePrioritizer = null,
  28153. this.refreshInterval = null,
  28154. this.processPriorityQueue = !1,
  28155. this.concurrentDownloads = e.concurrentDownloads || 1,
  28156. this.downloadTestResults = {}
  28157. }
  28158. var r = e("three")
  28159. , o = (e("../enum/Viewmode"),
  28160. e("../settings"))
  28161. , a = (e("../objects/Panorama"),
  28162. e("../util/logger"))
  28163. , s = (e("../enum/Vectors"),
  28164. e("../enum/PanoSizeClass"),
  28165. e("../enum/TileDownloaderEvents"))
  28166. , l = e("./TilePrioritizer")
  28167. , c = e("./TileUtils")
  28168. , h = (e("../enum/GLCubeFaces"),
  28169. e("../enum/DownloadStatus"))
  28170. , u = e("../util/panorama")
  28171. , d = e("../util/ajax")
  28172. , p = e("../ab")
  28173. , f = e("events").EventEmitter
  28174. , g = (new a(i),
  28175. Object.freeze({
  28176. Testing: 1,
  28177. Success: 2,
  28178. Fail: 3
  28179. }));
  28180. n.prototype = Object.create(f.prototype),
  28181. n.IDLE_REFRESH_DELAY = 500,
  28182. n.ACTIVE_REFRESH_DELAY = 16,
  28183. n.DOWNLOAD_RETRIES = 4,
  28184. n.prototype.init = function(e) {
  28185. this.qualityManager = e
  28186. }
  28187. ,
  28188. n.prototype.setUrls = function(e) {
  28189. this.urls = e
  28190. }
  28191. ,
  28192. n.prototype.setPanoData = function(e, t, i) {
  28193. this.panos = e,
  28194. this.imagePanos = t,
  28195. this.panoGroupId = i
  28196. }
  28197. ,
  28198. n.prototype.start = function() {
  28199. this.refreshUpdateInterval(0)
  28200. }
  28201. ,
  28202. n.prototype.stop = function() {
  28203. window.cancel(this.refreshInterval)
  28204. }
  28205. ,
  28206. n.prototype.refreshUpdateInterval = function(e) {
  28207. e || (e = 0),
  28208. this.refreshInterval = window.setTimeout(function() {
  28209. var e = this.update();
  28210. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28211. }
  28212. .bind(this), e)
  28213. }
  28214. ,
  28215. n.prototype.update = function() {
  28216. var e = this.forceQueue.length > 0;
  28217. return this.processQueueForDownloading(this.forceQueue),
  28218. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28219. this.priorityQueue.length > 0 && (e = !0),
  28220. this.processQueueForDownloading(this.priorityQueue)),
  28221. e
  28222. }
  28223. ,
  28224. n.prototype.forceQueueTilesForPano = function() {
  28225. var e = []
  28226. , t = [];
  28227. return function(i, n, r, o, a, s) {
  28228. e.length = 0;
  28229. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28230. var p = u[d];
  28231. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28232. }
  28233. if (r && e.length > 0) {
  28234. l.sortPanoTiles(e, i, r),
  28235. t.length = 0,
  28236. c.matchingTilesInDirection(i, n, r, o, a, t);
  28237. for (var f = 0, g = function(e) {
  28238. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28239. }; f < e.length; ) {
  28240. var m = e[f]
  28241. , v = t.findIndex(g);
  28242. v < 0 ? e.splice(f, 1) : f++
  28243. }
  28244. }
  28245. for (var A = 0; A < e.length; A++)
  28246. this.forceQueue.push(e[A]);
  28247. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28248. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28249. s && this.processQueueForDownloading(this.forceQueue, !0)
  28250. }
  28251. }(),
  28252. n.prototype.clearForceQueue = function() {
  28253. this.clearQueue(this.forceQueue)
  28254. }
  28255. ,
  28256. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28257. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28258. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28259. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28260. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28261. }
  28262. ,
  28263. n.prototype.clearQueue = function(e) {
  28264. this.setStatusForAllDescriptors(e, h.None),
  28265. e.length = 0
  28266. }
  28267. ,
  28268. n.prototype.clearFromQueue = function(e, t, i) {
  28269. for (var n = 0; n < e.length; n++) {
  28270. var r = e[n];
  28271. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28272. }
  28273. }
  28274. ,
  28275. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28276. for (var i = 0; i < e.length; i++) {
  28277. var n = e[i];
  28278. n && (n.status = t)
  28279. }
  28280. }
  28281. ,
  28282. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28283. for (var i = 0; i < e.length; i++) {
  28284. var n = e[i];
  28285. n && (n.status !== t ? n.status = t : e[i] = null)
  28286. }
  28287. }
  28288. ,
  28289. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28290. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28291. , n = i[t];
  28292. return n || (n = this.buildDownloadDescriptorArray(t),
  28293. i[t] = n,
  28294. this.initTileDownloadDescriptors(n, e, t)),
  28295. n
  28296. }
  28297. ,
  28298. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28299. var t = this.downloadDescriptors[e.id];
  28300. return t || (t = {},
  28301. this.downloadDescriptors[e.id] = t),
  28302. t
  28303. }
  28304. ,
  28305. n.prototype.processQueueForDownloading = function(e, t) {
  28306. if (this.cleanupActiveDownloads(),
  28307. this.activeDownloads.length < this.concurrentDownloads || t)
  28308. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28309. var o = e.shift();
  28310. o && (this.startDownload(o),
  28311. n++)
  28312. }
  28313. }
  28314. ,
  28315. n.prototype.testDownload = function(e, t, i) {
  28316. var n = this.downloadTestResults[e];
  28317. if (n)
  28318. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28319. this.downloadTestResults[e] = g.Testing;
  28320. var r = this.panos.list[0]
  28321. , o = this.getTileUrl(r.id, e, t, 0)
  28322. , a = function(t) {
  28323. this.downloadTestResults[e] = g.Success,
  28324. i(!0)
  28325. }
  28326. .bind(this)
  28327. , s = function() {
  28328. this.downloadTestResults[e] = g.Fail,
  28329. i(!1)
  28330. }
  28331. .bind(this);
  28332. this.loadImage(o, 0, a, s)
  28333. }
  28334. ,
  28335. n.prototype.startDownload = function(e) {
  28336. e.status = h.Downloading;
  28337. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28338. this.activeDownloads.push(e),
  28339. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28340. }
  28341. ,
  28342. n.prototype.downloadFailed = function(e, t) {}
  28343. ,
  28344. n.prototype.downloadComplete = function(e, t) {
  28345. if (e.panoGroupId === this.panoGroupId) {
  28346. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28347. e.status = h.Downloaded,
  28348. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28349. var n = {
  28350. panoId: e.pano.id,
  28351. image: t,
  28352. tileSize: e.tileSize,
  28353. panoSize: e.panoSize,
  28354. tileIndex: e.tileIndex,
  28355. faceTileIndex: e.faceTileIndex,
  28356. totalTiles: e.totalTiles,
  28357. face: e.face,
  28358. tileX: e.tileX,
  28359. tileY: e.tileY,
  28360. direction: e.direction
  28361. };
  28362. e.image = t,
  28363. this.emit(s.TileDownloadSuccess, n),
  28364. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28365. panoId: e.pano.id,
  28366. tileSize: e.tileSize,
  28367. panoSize: e.panoSize
  28368. },
  28369. this.emit(s.PanoDownloadComplete, n),
  28370. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28371. }
  28372. }
  28373. ,
  28374. n.prototype.cleanupActiveDownloads = function() {
  28375. var e = [];
  28376. return function() {
  28377. e.length = 0;
  28378. for (var t = 0; t < this.activeDownloads.length; t++) {
  28379. var i = this.activeDownloads[t];
  28380. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28381. }
  28382. this.activeDownloads.length = 0,
  28383. this.activeDownloads.push.apply(this.activeDownloads, e)
  28384. }
  28385. }(),
  28386. n.prototype.isPanoDownloaded = function(e, t) {
  28387. var i = this.getTileDownloadDescriptors(e, t);
  28388. if (i.length <= 0)
  28389. return !1;
  28390. for (var n = 0; n < i.length; n++) {
  28391. var r = i[n];
  28392. if (r.status !== h.Downloaded)
  28393. return !1
  28394. }
  28395. return !0
  28396. }
  28397. ,
  28398. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28399. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28400. this.panoLoadCallbacks[o] = {
  28401. onLoad: i,
  28402. onFail: n,
  28403. onProgress: r
  28404. }
  28405. }
  28406. ,
  28407. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28408. var i = e.id + ":" + t;
  28409. return this.panoLoadCallbacks[i]
  28410. }
  28411. ,
  28412. n.prototype.buildDownloadDescriptorArray = function(e) {
  28413. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28414. var r = this.buildDownloadDescriptor();
  28415. i.push(r)
  28416. }
  28417. return i
  28418. }
  28419. ,
  28420. n.prototype.buildDownloadDescriptor = function() {
  28421. var e = {
  28422. panoGroupId: null,
  28423. pano: null,
  28424. panoSize: -1,
  28425. tileSize: -1,
  28426. tileIndex: -1,
  28427. totalTiles: -1,
  28428. faceTileIndex: -1,
  28429. status: h.None,
  28430. url: null,
  28431. image: null,
  28432. direction: new r.Vector3,
  28433. face: -1,
  28434. cubeFace: -1,
  28435. tileX: -1,
  28436. tileY: -1
  28437. };
  28438. return e
  28439. }
  28440. ,
  28441. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28442. for (var n = 0; n < e.length; n++) {
  28443. var r = e[n];
  28444. this.initTileDownloadDescriptor(r, t, i, n)
  28445. }
  28446. }
  28447. ,
  28448. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28449. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28450. e.face = c.getFaceForTile(i, n),
  28451. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28452. e.panoGroupId = this.panoGroupId,
  28453. e.pano = t,
  28454. e.panoSize = i,
  28455. e.tileSize = r,
  28456. e.tileIndex = n,
  28457. e.totalTiles = c.getTileCountForSize(i),
  28458. e.status = h.None,
  28459. e.image = null,
  28460. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28461. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28462. }
  28463. ,
  28464. n.prototype.getTileUrl = function() {
  28465. var e = {
  28466. 256: "256",
  28467. 512: "512",
  28468. 1024: "1k",
  28469. 2048: "2k",
  28470. 4096: "4k"
  28471. }
  28472. , t = {
  28473. face: -1,
  28474. faceTileIndex: -1,
  28475. tileX: -1,
  28476. tileY: -1
  28477. };
  28478. return function(i, n, r, a) {
  28479. c.getTileLocation(n, a, t);
  28480. var s = Math.floor(n / r)
  28481. , l = s * s
  28482. , h = Math.floor(a / l)
  28483. , u = "";
  28484. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28485. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28486. return d = p.changeIfTileGenerating(d)
  28487. }
  28488. }(),
  28489. n.prototype.loadImage = function(e, t, i, n) {
  28490. d.getImage(e, t).then(function(e) {
  28491. i(e)
  28492. }).fail(n)
  28493. }
  28494. ,
  28495. t.exports = n
  28496. }
  28497. ).call(this, "/js/tile/TileDownloader.js")
  28498. }
  28499. , {
  28500. "../ab": 3,
  28501. "../enum/DownloadStatus": 24,
  28502. "../enum/GLCubeFaces": 25,
  28503. "../enum/PanoSizeClass": 36,
  28504. "../enum/TileDownloaderEvents": 45,
  28505. "../enum/Vectors": 50,
  28506. "../enum/Viewmode": 51,
  28507. "../objects/Panorama": 148,
  28508. "../settings": 166,
  28509. "../util/ajax": 181,
  28510. "../util/logger": 189,
  28511. "../util/panorama": 191,
  28512. "./TilePrioritizer": 172,
  28513. "./TileUtils": 174,
  28514. events: 202,
  28515. three: 217
  28516. }],
  28517. 172: [function(e, t, i) {
  28518. (function(i) {
  28519. "use strict";
  28520. function n(e, t, i, o, a) {
  28521. this.qualityManager = e,
  28522. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28523. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28524. this.baseSize = t,
  28525. this.standardSize = i,
  28526. this.highSize = o,
  28527. this.ultraHighSize = a,
  28528. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28529. }
  28530. var r = e("three")
  28531. , o = (e("../enum/Viewmode"),
  28532. e("../settings"),
  28533. e("../settings"),
  28534. e("../objects/Panorama"))
  28535. , a = e("../util/logger")
  28536. , s = (e("../enum/Vectors"),
  28537. e("../enum/PanoSizeClass"),
  28538. e("../enum/ModelManagerEvents"),
  28539. e("../enum/GLCubeFaces"),
  28540. e("../enum/DownloadStatus"))
  28541. , l = (e("../util/browser"),
  28542. e("./TileUtils"))
  28543. , c = e("../util/math")
  28544. , h = (e("events").EventEmitter,
  28545. new a(i),
  28546. Object.freeze({
  28547. None: 0,
  28548. DirectionalFOV: 1
  28549. }));
  28550. n.PriorityCriteria = function(e, t, i, n, o) {
  28551. this.pano = e,
  28552. this.cameraPosition = (new r.Vector3).copy(t),
  28553. this.cameraDir = (new r.Vector3).copy(i),
  28554. this.panoSpaceDir = (new r.Vector3).copy(n),
  28555. this.upcomingPanos = o,
  28556. this.copy = function(e) {
  28557. this.pano = e.pano,
  28558. this.cameraPosition.copy(e.cameraPosition),
  28559. this.cameraDir.copy(e.cameraDir),
  28560. this.panoSpaceDir.copy(e.panoSpaceDir),
  28561. this.upcomingPanos = o
  28562. }
  28563. ,
  28564. this.zoomingActive = !1
  28565. }
  28566. ,
  28567. n.DIRECTIONAL_FOV = 180,
  28568. n.DIRECTIONAL_FOV_NARROW = 120,
  28569. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28570. n.MAX_SCORED_PANOS_TOADD = 2,
  28571. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28572. n.DIRECTION_SCORE_STRICTNESS = .75,
  28573. n.appendQueue = function(e, t) {
  28574. if (e && t)
  28575. for (var i = 0; i < t.length; i++)
  28576. e.push(t[i])
  28577. }
  28578. ,
  28579. n.prototype.updateCriteria = function(e, t, i, n) {
  28580. this.priorityCriteria.pano = e,
  28581. this.priorityCriteria.cameraPosition.copy(t),
  28582. this.priorityCriteria.cameraDir.copy(i),
  28583. this.priorityCriteria.upcomingPanos = n,
  28584. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28585. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28586. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28587. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28588. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28589. }
  28590. }
  28591. ,
  28592. n.prototype.filterAndPrioritize = function() {
  28593. var e = []
  28594. , t = []
  28595. , i = [];
  28596. return function(r, o, a) {
  28597. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28598. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28599. var s = this.baseSize
  28600. , l = this.standardSize
  28601. , c = this.highSize
  28602. , h = this.ultraHighSize;
  28603. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28604. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28605. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28606. i.length = 0,
  28607. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28608. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28609. n.appendQueue(r, i),
  28610. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28611. i.length = 0,
  28612. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28613. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28614. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28615. n.appendQueue(r, i),
  28616. i.length = 0,
  28617. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28618. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28619. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28620. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28621. n.appendQueue(r, i),
  28622. this.queueTilesForPanos(r, e, a, s)
  28623. }
  28624. }(),
  28625. n.prototype.canDownloadSize = function(e) {
  28626. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28627. }
  28628. ,
  28629. n.prototype.populateNeighborPanos = function(e, t, i) {
  28630. i = i || [],
  28631. i.length = 0;
  28632. var n = t.getNeighbours(e);
  28633. for (var r in n)
  28634. if (n.hasOwnProperty(r)) {
  28635. var o = t.get(r);
  28636. i.push(o)
  28637. }
  28638. return i
  28639. }
  28640. ,
  28641. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28642. i = i || [],
  28643. i.length = 0;
  28644. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28645. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28646. , c = t.sortByScore(s, l);
  28647. if (c)
  28648. for (var h = 0; h < c.length && h < a; h++) {
  28649. var u = c[h].item;
  28650. i.push(u)
  28651. }
  28652. return i
  28653. }
  28654. ,
  28655. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28656. for (var o = 0, a = 0; a < t.length; a++) {
  28657. var s = t[a]
  28658. , l = this.queueTilesForPano(e, i, s, n);
  28659. if (o += l > 0 ? 1 : 0,
  28660. r && o >= r)
  28661. break
  28662. }
  28663. return o
  28664. }
  28665. ,
  28666. n.prototype.queueTilesForPano = function() {
  28667. var e = {
  28668. filter: h.None
  28669. };
  28670. return function(t, i, n, r) {
  28671. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28672. }
  28673. }(),
  28674. n.prototype.queueTilesForPanosInDirection = function() {
  28675. var e = new r.Vector3;
  28676. return function(t, i, n, r, o, a, s, l) {
  28677. for (var h = 0, u = 0; u < n.length; u++) {
  28678. var d = n[u];
  28679. e.copy(d.position),
  28680. e.sub(o),
  28681. e.normalize();
  28682. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28683. , f = c.getFOVDotThreshold(s);
  28684. if (p >= f) {
  28685. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28686. if (h += g > 0 ? 1 : 0,
  28687. l && h >= l)
  28688. break
  28689. }
  28690. }
  28691. return h
  28692. }
  28693. }(),
  28694. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28695. for (var l = 0, c = 0; c < i.length; c++) {
  28696. var h = i[c]
  28697. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28698. if (l += u > 0 ? 1 : 0,
  28699. s && l >= s)
  28700. break
  28701. }
  28702. return l
  28703. }
  28704. ,
  28705. n.prototype.queueTilesInDirectionForPano = function() {
  28706. var e = {
  28707. filter: h.DirectionalFOV,
  28708. direction: new r.Vector3,
  28709. fov: 60
  28710. }
  28711. , t = new r.Vector3;
  28712. return function(i, n, r, o, a, s, c) {
  28713. return t.copy(s),
  28714. l.getRelativeDirection(r.quaternion, t),
  28715. e.direction.copy(t),
  28716. e.fov = c,
  28717. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28718. }
  28719. }(),
  28720. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28721. var e = [];
  28722. return function(t, i, n, r, o) {
  28723. var a = i.getTileDownloadDescriptors(n, r);
  28724. e.length = 0,
  28725. this.filterTileDownloadDescriptors(n, a, e, o);
  28726. for (var s = 0, l = 0; l < e.length; l++) {
  28727. var c = e[l];
  28728. c && (t.push(c),
  28729. s++)
  28730. }
  28731. return s
  28732. }
  28733. }(),
  28734. n.prototype.filterTileDownloadDescriptors = function() {
  28735. new r.Vector3;
  28736. return function(e, t, i, n) {
  28737. var r, o;
  28738. switch (n.filter) {
  28739. case h.DirectionalFOV:
  28740. for (r = 0; r < t.length; r++)
  28741. o = t[r],
  28742. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28743. break;
  28744. default:
  28745. for (r = 0; r < t.length; r++)
  28746. o = t[r],
  28747. i.push(o)
  28748. }
  28749. for (r = 0; r < i.length; r++)
  28750. o = i[r],
  28751. this.canIncludeDescriptor(o) || (i[r] = null)
  28752. }
  28753. }(),
  28754. n.prototype.canIncludeDescriptor = function(e) {
  28755. return e.status !== s.Downloading && e.status !== s.Downloaded
  28756. }
  28757. ,
  28758. n.prototype.canIncludePano = function(e, t) {
  28759. return !e.isLoaded(t)
  28760. }
  28761. ,
  28762. n.getFOVDotThreshold = function(e) {
  28763. return Math.cos(r.Math.degToRad(e / 2))
  28764. }
  28765. ;
  28766. var u = function() {
  28767. var e = function e(t, i) {
  28768. var n = e._panoSpaceDir
  28769. , r = e._fovThreshold
  28770. , o = e._fovThresholdNarrow
  28771. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28772. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28773. return t._dot = a,
  28774. i._dot = s,
  28775. 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)
  28776. };
  28777. return e._panoSpaceDir = new r.Vector3,
  28778. e._fovThreshold = -1,
  28779. e._fovThresholdNarrow = -1,
  28780. e
  28781. }();
  28782. n.sortPanoTiles = function(e, t, i) {
  28783. u._panoSpaceDir.copy(i),
  28784. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28785. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28786. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28787. e.sort(u)
  28788. }
  28789. ,
  28790. n.insertSortedPanoTile = function(e, t, i, r) {
  28791. u._panoSpaceDir.copy(r),
  28792. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28793. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28794. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28795. for (var o = -1, a = 0; a < e.length; a++) {
  28796. var s = u(t, e[a]);
  28797. if (s <= 0) {
  28798. o = a;
  28799. break
  28800. }
  28801. }
  28802. if (o === -1)
  28803. e[e.length] = t;
  28804. else {
  28805. for (var h = e.length; h > o; h--)
  28806. e[h] = e[h - 1];
  28807. e[o] = t
  28808. }
  28809. }
  28810. ,
  28811. n.prototype.setZoomingActive = function(e) {
  28812. e !== this.zoomingActive && (this.zoomingActive = e)
  28813. }
  28814. ,
  28815. t.exports = n
  28816. }
  28817. ).call(this, "/js/tile/TilePrioritizer.js")
  28818. }
  28819. , {
  28820. "../enum/DownloadStatus": 24,
  28821. "../enum/GLCubeFaces": 25,
  28822. "../enum/ModelManagerEvents": 33,
  28823. "../enum/PanoSizeClass": 36,
  28824. "../enum/Vectors": 50,
  28825. "../enum/Viewmode": 51,
  28826. "../objects/Panorama": 148,
  28827. "../settings": 166,
  28828. "../util/browser": 182,
  28829. "../util/logger": 189,
  28830. "../util/math": 190,
  28831. "./TileUtils": 174,
  28832. events: 202,
  28833. three: 217
  28834. }],
  28835. 173: [function(e, t, i) {
  28836. "use strict";
  28837. function n(e, t) {
  28838. this.levels = t,
  28839. this.tileSize = e,
  28840. this.root = null,
  28841. this.allNodes = [],
  28842. a(this)
  28843. }
  28844. function r(e, t) {
  28845. this.tree = e,
  28846. this.parent = t,
  28847. this.children = [],
  28848. this.id = ++u
  28849. }
  28850. function o(e, t, i, r, a, s, l, h) {
  28851. if (e) {
  28852. l = l || n.TraversalType.PreOrder;
  28853. var u = r * c + i;
  28854. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28855. s && s.push(e)),
  28856. e.children && 0 !== e.children.length) {
  28857. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28858. for (var g = 0; g < c; g++)
  28859. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28860. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28861. s && s.push(e))
  28862. }
  28863. }
  28864. }
  28865. function a(e) {
  28866. e.root = s(e, null, 0)
  28867. }
  28868. function s(e, t, i) {
  28869. if (i > e.levels)
  28870. return null;
  28871. var n = new r(e,t);
  28872. e.allNodes.push(n);
  28873. for (var o = 0; o < h; o++)
  28874. n.children[o] = s(e, n, i + 1);
  28875. return n
  28876. }
  28877. function l(e, t, i, n, r) {
  28878. if (!e)
  28879. return null;
  28880. if (0 === i)
  28881. return e;
  28882. if (!e.children || 0 === e.children.length)
  28883. return null;
  28884. var o = Math.pow(c, i)
  28885. , a = o / c
  28886. , s = n % a
  28887. , h = r % a
  28888. , u = Math.floor(r / a)
  28889. , d = Math.floor(n / a)
  28890. , p = u * c + d
  28891. , f = e.children[p];
  28892. return l(f, t + 1, i - 1, s, h)
  28893. }
  28894. var c = (e("three"),
  28895. e("./TileUtils"),
  28896. e("../objects/Panorama"),
  28897. e("../util/panorama"),
  28898. e("events").EventEmitter,
  28899. 2)
  28900. , h = c * c;
  28901. n.TraversalType = Object.freeze({
  28902. PreOrder: 0,
  28903. PostOrder: 1
  28904. });
  28905. var u = 0;
  28906. n.getLevelCountForSize = function(e, t) {
  28907. var i = 0;
  28908. for (t < e && (t = e); ; ) {
  28909. if (t /= c,
  28910. t < e)
  28911. break;
  28912. i++
  28913. }
  28914. return i
  28915. }
  28916. ,
  28917. n.getSizeForLevel = function(e, t) {
  28918. return Math.pow(c, t) * e
  28919. }
  28920. ,
  28921. n.prototype.getSubNode = function(e, t, i) {
  28922. (!t || e < this.tileSize) && (t = 0),
  28923. (!i || e < this.tileSize) && (i = 0),
  28924. e < this.tileSize && (e = this.tileSize);
  28925. var r = n.getLevelCountForSize(this.tileSize, e)
  28926. , o = l(this.root, 0, r, t, i);
  28927. return o
  28928. }
  28929. ,
  28930. n.prototype.breadthFirst = function(e) {
  28931. e = e || {};
  28932. var t = !!e.nullLevelEnd
  28933. , i = e.maxLevel
  28934. , n = e.minLevel
  28935. , r = e.callback
  28936. , o = e.saveVisited
  28937. , a = []
  28938. , s = {}
  28939. , l = 0
  28940. , c = 0;
  28941. for (a.push(this.root),
  28942. a.push(s); a.length > 0 && !(i && l > i); ) {
  28943. var h = a.shift();
  28944. if (h === s)
  28945. (!n || l >= n) && (r && t && r(null),
  28946. o && t && o.push(null)),
  28947. a.length > 0 && a.push(s),
  28948. l++,
  28949. c = 0;
  28950. else {
  28951. if (h.children)
  28952. for (var u = 0; u < h.children.length; u++) {
  28953. var d = h.children[u];
  28954. d && a.push(h.children[u])
  28955. }
  28956. var p = this.getFaceIndexFromNode(h);
  28957. (!n || l >= n) && (r && r(h, l, p),
  28958. o && o.push(h)),
  28959. c++
  28960. }
  28961. }
  28962. }
  28963. ,
  28964. n.prototype.getFaceIndexFromNode = function(e) {
  28965. if (!e)
  28966. return -1;
  28967. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28968. var o = i.parent;
  28969. if (!o)
  28970. break;
  28971. for (var a = -1, s = 0; s < o.children.length; s++)
  28972. o.children[s] === i && (a = s);
  28973. var l = a % c
  28974. , h = Math.floor(a / c);
  28975. n = l * t + n,
  28976. r = h * t + r,
  28977. t *= c,
  28978. i = o
  28979. }
  28980. return r * t + n
  28981. }
  28982. ,
  28983. n.prototype.depthFirst = function(e, t, i) {
  28984. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28985. }
  28986. ,
  28987. t.exports = n
  28988. }
  28989. , {
  28990. "../objects/Panorama": 148,
  28991. "../util/panorama": 191,
  28992. "./TileUtils": 174,
  28993. events: 202,
  28994. three: 217
  28995. }],
  28996. 174: [function(e, t, i) {
  28997. "use strict";
  28998. var n = e("../enum/GLCubeFaces")
  28999. , r = e("../util/MathLight")
  29000. , o = {};
  29001. o.TILE_SIZE = 512,
  29002. o.FACES_PER_PANO = 6,
  29003. o.LocationOnTile = {
  29004. Center: 0,
  29005. UpperLeft: 1,
  29006. UpperRight: 2,
  29007. LowerRight: 3,
  29008. LowerLeft: 4
  29009. },
  29010. o.getTileVector = function() {
  29011. return function(e, t, i, a, s, l, c, h) {
  29012. l = l || o.LocationOnTile.Center;
  29013. var u = e / t
  29014. , d = a / u;
  29015. s = -s + (u - 1);
  29016. var p = s / u
  29017. , f = t / e
  29018. , g = 2 * f
  29019. , m = g / 2
  29020. , v = 2 * d - 1 + m
  29021. , A = 2 * p - 1 + m;
  29022. switch (l) {
  29023. case o.LocationOnTile.UpperLeft:
  29024. v -= m,
  29025. A += m,
  29026. v += c * g;
  29027. break;
  29028. case o.LocationOnTile.UpperRight:
  29029. v += m,
  29030. A += m,
  29031. A -= c * g;
  29032. break;
  29033. case o.LocationOnTile.LowerRight:
  29034. v += m,
  29035. A -= m,
  29036. v -= c * g;
  29037. break;
  29038. case o.LocationOnTile.LowerLeft:
  29039. v -= m,
  29040. A -= m,
  29041. A += c * g;
  29042. break;
  29043. case o.LocationOnTile.Center:
  29044. }
  29045. switch (i) {
  29046. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29047. r.setVector(h, -1, A, -v);
  29048. break;
  29049. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29050. r.setVector(h, 1, A, v);
  29051. break;
  29052. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29053. r.setVector(h, -v, 1, -A);
  29054. break;
  29055. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29056. r.setVector(h, -v, -1, A);
  29057. break;
  29058. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29059. r.setVector(h, -v, A, 1);
  29060. break;
  29061. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29062. r.setVector(h, v, A, -1)
  29063. }
  29064. r.normalize(h)
  29065. }
  29066. }(),
  29067. o.getFaceForTile = function(e, t) {
  29068. var i = o.TILE_SIZE;
  29069. e < o.TILE_SIZE && (i = e);
  29070. var n = Math.floor(e / i)
  29071. , r = n * n;
  29072. return Math.floor(t / r)
  29073. }
  29074. ,
  29075. o.getTileLocation = function(e, t, i) {
  29076. var n = o.TILE_SIZE;
  29077. e < o.TILE_SIZE && (n = e);
  29078. var r = o.getFaceForTile(e, t)
  29079. , a = Math.floor(e / n)
  29080. , s = a * a
  29081. , l = t - r * s;
  29082. i.tileX = l % a,
  29083. i.tileY = Math.floor(l / a),
  29084. i.face = r,
  29085. i.faceTileIndex = l
  29086. }
  29087. ,
  29088. o.getTileCountForSize = function(e) {
  29089. if (e <= o.TILE_SIZE)
  29090. return o.FACES_PER_PANO;
  29091. var t = Math.floor(e / o.TILE_SIZE)
  29092. , i = t * t
  29093. , n = i * o.FACES_PER_PANO;
  29094. return n
  29095. }
  29096. ,
  29097. o.getRelativeDirection = function() {
  29098. var e = new r.Matrix4
  29099. , t = new r.Quaternion;
  29100. return function(i, n) {
  29101. t.copy(i),
  29102. t.inverse(),
  29103. e.makeRotationFromQuaternion(t),
  29104. e.applyToVector3(n),
  29105. r.normalize(n)
  29106. }
  29107. }(),
  29108. o.matchingTilesInDirection = function() {
  29109. var e = new r.Vector3
  29110. , t = new r.Vector3(0,0,-1)
  29111. , i = new r.Quaternion
  29112. , n = function(e, t) {
  29113. e.push({
  29114. face: t.face,
  29115. faceTileIndex: t.faceTileIndex,
  29116. tileX: t.tileX,
  29117. tileY: t.tileY
  29118. })
  29119. }
  29120. , a = function() {
  29121. var e = {
  29122. face: -1,
  29123. faceTileIndex: -1,
  29124. tileX: -1,
  29125. tileY: -1
  29126. };
  29127. return function(t, i, r) {
  29128. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29129. o.getTileLocation(t, l, e),
  29130. i && !i(e) || (s++,
  29131. r && n(r, e));
  29132. return s
  29133. }
  29134. }();
  29135. return function(n, s, l, c, h, u) {
  29136. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29137. o.getTileCountForSize(s);
  29138. if (!c && !h)
  29139. return a(s, null, u);
  29140. var p = !!h;
  29141. if (h = h || c,
  29142. h = Math.max(0, Math.min(h, 360)),
  29143. c = Math.max(0, Math.min(c, 360)),
  29144. r.copyVector(l, e),
  29145. o.getRelativeDirection(n.quaternion, e),
  29146. p) {
  29147. i.setFromUnitVectors(e, t);
  29148. var f = function(e) {
  29149. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29150. };
  29151. return a(s, f, u)
  29152. }
  29153. var g = function(t) {
  29154. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29155. };
  29156. return a(s, g, u)
  29157. }
  29158. }(),
  29159. o.isTileWithinFrustum = function() {
  29160. var e = new r.Vector3
  29161. , t = 1e-5;
  29162. return function(i, n, a, s, l, c, h, u) {
  29163. 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++)
  29164. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29165. r.applyQuaternionToVector(c, e),
  29166. e.z >= -t)
  29167. I++;
  29168. else {
  29169. var w = -1 / e.z
  29170. , _ = e.x * w
  29171. , T = e.y * w;
  29172. T > d ? v++ : T < p && A++,
  29173. _ > f ? y++ : _ < g && C++,
  29174. E++
  29175. }
  29176. return A !== E && v !== E && y !== E && C !== E
  29177. }
  29178. }(),
  29179. o.isTileWithinFOV = function() {
  29180. var e = new r.Vector3
  29181. , t = new r.Vector3(0,1,0)
  29182. , i = new r.Vector3(1,0,0);
  29183. return function(n, a, s, l, c, h, u) {
  29184. var d = o.mapFaceToCubemapFace(s);
  29185. if (r.cross(h, t, i),
  29186. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29187. o.isWithinFOV(e, h, u, null))
  29188. return !0;
  29189. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29190. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29191. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29192. o.isWithinFOV(e, h, u, null))
  29193. return !0;
  29194. g += p
  29195. }
  29196. return !1
  29197. }
  29198. }(),
  29199. o.isWithinFOV = function() {
  29200. var e = new r.Vector3
  29201. , t = new r.Vector3;
  29202. return function(i, n, o, a) {
  29203. if (r.copyVector(i, t),
  29204. a) {
  29205. r.copyVector(a, e),
  29206. r.normalize(e);
  29207. var s = r.dot(e, i);
  29208. e.x *= s,
  29209. e.y *= s,
  29210. e.z *= s,
  29211. r.subVector(t, e)
  29212. }
  29213. var l = o / 2 * r.RADIANS_PER_DEGREE
  29214. , c = Math.cos(l)
  29215. , h = r.dot(t, n);
  29216. return h >= c
  29217. }
  29218. }(),
  29219. o.mapFaceToCubemapFace = function() {
  29220. var e = {
  29221. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29222. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29223. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29224. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29225. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29226. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29227. };
  29228. return function(t) {
  29229. return e[t]
  29230. }
  29231. }(),
  29232. t.exports = o
  29233. }
  29234. , {
  29235. "../enum/GLCubeFaces": 25,
  29236. "../util/MathLight": 176
  29237. }],
  29238. 175: [function(e, t, i) {
  29239. (function(i) {
  29240. "use strict";
  29241. function n() {
  29242. this.list = [],
  29243. this.index = {},
  29244. Object.defineProperty(this, "length", {
  29245. get: function() {
  29246. return this.list.length
  29247. }
  29248. })
  29249. }
  29250. var r = (e("./common"),
  29251. e("./logger"));
  29252. new r(i);
  29253. n.prototype.forEach = function(e) {
  29254. this.list.forEach(e)
  29255. }
  29256. ,
  29257. n.prototype.add = function(e) {
  29258. this.list.push(e),
  29259. this.index[this.getIndex(e)] = e
  29260. }
  29261. ,
  29262. n.prototype.getIndex = function(e) {
  29263. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29264. }
  29265. ,
  29266. n.prototype.extend = function(e) {
  29267. for (var t = 0; t < e.length; t++)
  29268. this.add(e[t])
  29269. }
  29270. ,
  29271. n.prototype.get = function(e) {
  29272. return this.index[e]
  29273. }
  29274. ,
  29275. n.prototype.first = function() {
  29276. return this.list[0]
  29277. }
  29278. ,
  29279. n.prototype.last = function() {
  29280. return this.list[this.list.length - 1]
  29281. }
  29282. ,
  29283. n.prototype.reIndex = function() {
  29284. this.index = {};
  29285. var e = this;
  29286. this.forEach(function(t) {
  29287. e.index[e.getIndex(t)] = t
  29288. })
  29289. }
  29290. ,
  29291. n.prototype.filter = function(e) {
  29292. var t = this.list.filter(e);
  29293. return this.reIndex(),
  29294. t
  29295. }
  29296. ,
  29297. n.prototype.reduce = function(e, t) {
  29298. return this.list.reduce(e, t)
  29299. }
  29300. ,
  29301. n.prototype.sort = function(e) {
  29302. return this.list.sort(e)
  29303. }
  29304. ,
  29305. n.prototype.indexOf = function(e) {
  29306. for (var t = 0; t < this.list.length; ++t)
  29307. if (this.list[t] === e)
  29308. return t;
  29309. return -1
  29310. }
  29311. ,
  29312. t.exports = n
  29313. }
  29314. ).call(this, "/js/util/IndexedCollection.js")
  29315. }
  29316. , {
  29317. "./common": 185,
  29318. "./logger": 189
  29319. }],
  29320. 176: [function(e, t, i) {
  29321. "use strict";
  29322. var n = e("../constants")
  29323. , r = {};
  29324. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29325. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29326. r.Vector3 = function(e, t, i) {
  29327. this.x = e || 0,
  29328. this.y = t || 0,
  29329. this.z = i || 0
  29330. }
  29331. ,
  29332. r.Matrix4 = function() {
  29333. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29334. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29335. }
  29336. ,
  29337. r.Matrix4.prototype = {
  29338. identity: function() {
  29339. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29340. this
  29341. },
  29342. copy: function(e) {
  29343. return this.elements.set(e.elements),
  29344. this
  29345. },
  29346. applyToVector3: function(e) {
  29347. var t = e.x
  29348. , i = e.y
  29349. , n = e.z
  29350. , r = this.elements;
  29351. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29352. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29353. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29354. this
  29355. },
  29356. getInverse: function(e, t) {
  29357. var i = this.elements
  29358. , n = e.elements
  29359. , r = n[0]
  29360. , o = n[1]
  29361. , a = n[2]
  29362. , s = n[3]
  29363. , l = n[4]
  29364. , c = n[5]
  29365. , h = n[6]
  29366. , u = n[7]
  29367. , d = n[8]
  29368. , p = n[9]
  29369. , f = n[10]
  29370. , g = n[11]
  29371. , m = n[12]
  29372. , v = n[13]
  29373. , A = n[14]
  29374. , y = n[15]
  29375. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29376. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29377. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29378. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29379. , w = r * C + o * I + a * E + s * b;
  29380. if (0 === w) {
  29381. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29382. if (t)
  29383. throw new Error(_);
  29384. return console.warn(_),
  29385. this.identity()
  29386. }
  29387. var T = 1 / w;
  29388. return i[0] = C * T,
  29389. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29390. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29391. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29392. i[4] = I * T,
  29393. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29394. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29395. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29396. i[8] = E * T,
  29397. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29398. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29399. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29400. i[12] = b * T,
  29401. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29402. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29403. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29404. this
  29405. },
  29406. makeRotationFromQuaternion: function(e) {
  29407. var t = this.elements
  29408. , i = e.x
  29409. , n = e.y
  29410. , r = e.z
  29411. , o = e.w
  29412. , a = i + i
  29413. , s = n + n
  29414. , l = r + r
  29415. , c = i * a
  29416. , h = i * s
  29417. , u = i * l
  29418. , d = n * s
  29419. , p = n * l
  29420. , f = r * l
  29421. , g = o * a
  29422. , m = o * s
  29423. , v = o * l;
  29424. return t[0] = 1 - (d + f),
  29425. t[4] = h - v,
  29426. t[8] = u + m,
  29427. t[1] = h + v,
  29428. t[5] = 1 - (c + f),
  29429. t[9] = p - g,
  29430. t[2] = u - m,
  29431. t[6] = p + g,
  29432. t[10] = 1 - (c + d),
  29433. t[3] = 0,
  29434. t[7] = 0,
  29435. t[11] = 0,
  29436. t[12] = 0,
  29437. t[13] = 0,
  29438. t[14] = 0,
  29439. t[15] = 1,
  29440. this
  29441. }
  29442. },
  29443. r.Quaternion = function(e, t, i, n) {
  29444. this._x = e || 0,
  29445. this._y = t || 0,
  29446. this._z = i || 0,
  29447. this._w = void 0 !== n ? n : 1
  29448. }
  29449. ,
  29450. r.Quaternion.prototype = {
  29451. get x() {
  29452. return this._x
  29453. },
  29454. set x(e) {
  29455. this._x = e
  29456. },
  29457. get y() {
  29458. return this._y
  29459. },
  29460. set y(e) {
  29461. this._y = e
  29462. },
  29463. get z() {
  29464. return this._z
  29465. },
  29466. set z(e) {
  29467. this._z = e
  29468. },
  29469. get w() {
  29470. return this._w
  29471. },
  29472. set w(e) {
  29473. this._w = e
  29474. },
  29475. copy: function(e) {
  29476. this._x = e.x,
  29477. this._y = e.y,
  29478. this._z = e.z,
  29479. this._w = e.w
  29480. },
  29481. inverse: function() {
  29482. return this.conjugate().normalize()
  29483. },
  29484. conjugate: function() {
  29485. return this._x *= -1,
  29486. this._y *= -1,
  29487. this._z *= -1,
  29488. this
  29489. },
  29490. length: function() {
  29491. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29492. },
  29493. normalize: function() {
  29494. var e = this.length();
  29495. return 0 === e ? (this._x = 0,
  29496. this._y = 0,
  29497. this._z = 0,
  29498. this._w = 1) : (e = 1 / e,
  29499. this._x = this._x * e,
  29500. this._y = this._y * e,
  29501. this._z = this._z * e,
  29502. this._w = this._w * e),
  29503. this
  29504. },
  29505. setFromAxisAngle: function(e, t) {
  29506. var i = t / 2
  29507. , n = Math.sin(i);
  29508. return this._x = e.x * n,
  29509. this._y = e.y * n,
  29510. this._z = e.z * n,
  29511. this._w = Math.cos(i),
  29512. this
  29513. },
  29514. setFromUnitVectors: function() {
  29515. var e, t, i = 1e-6;
  29516. return function(n, o) {
  29517. return void 0 === e && (e = new r.Vector3),
  29518. t = r.dot(n, o) + 1,
  29519. t < i ? (t = 0,
  29520. 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),
  29521. this._x = e.x,
  29522. this._y = e.y,
  29523. this._z = e.z,
  29524. this._w = t,
  29525. this.normalize()
  29526. }
  29527. }(),
  29528. multiply: function(e) {
  29529. return this.multiplyQuaternions(this, e)
  29530. },
  29531. premultiply: function(e) {
  29532. return this.multiplyQuaternions(e, this)
  29533. },
  29534. multiplyQuaternions: function(e, t) {
  29535. var i = e._x
  29536. , n = e._y
  29537. , r = e._z
  29538. , o = e._w
  29539. , a = t._x
  29540. , s = t._y
  29541. , l = t._z
  29542. , c = t._w;
  29543. return this._x = i * c + o * a + n * l - r * s,
  29544. this._y = n * c + o * s + r * a - i * l,
  29545. this._z = r * c + o * l + i * s - n * a,
  29546. this._w = o * c - i * a - n * s - r * l,
  29547. this
  29548. }
  29549. },
  29550. r.convertWorkshopVector = function(e) {
  29551. return new r.Vector3(-e.x,e.y,e.z)
  29552. }
  29553. ,
  29554. r.convertWorkshopQuaternion = function(e) {
  29555. 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))
  29556. }
  29557. ;
  29558. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29559. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29560. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29561. }
  29562. ,
  29563. r.convertWorkshopPanoramaQuaternion = function(e) {
  29564. 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))
  29565. }
  29566. ,
  29567. r.normalize = function(e) {
  29568. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29569. , i = Math.sqrt(t);
  29570. e.x /= i,
  29571. e.y /= i,
  29572. e.z /= i
  29573. }
  29574. ,
  29575. r.dot = function(e, t) {
  29576. return e.x * t.x + e.y * t.y + e.z * t.z
  29577. }
  29578. ,
  29579. r.cross = function(e, t, i) {
  29580. var n = e.x
  29581. , r = e.y
  29582. , o = e.z;
  29583. i.x = r * t.z - o * t.y,
  29584. i.y = o * t.x - n * t.z,
  29585. i.z = n * t.y - r * t.x
  29586. }
  29587. ,
  29588. r.setVector = function(e, t, i, n) {
  29589. e.x = t,
  29590. e.y = i,
  29591. e.z = n
  29592. }
  29593. ,
  29594. r.copyVector = function(e, t) {
  29595. t.x = e.x,
  29596. t.y = e.y,
  29597. t.z = e.z
  29598. }
  29599. ,
  29600. r.addVector = function(e, t) {
  29601. e.x += t.x,
  29602. e.y += t.y,
  29603. e.z += t.z
  29604. }
  29605. ,
  29606. r.subVector = function(e, t) {
  29607. e.x -= t.x,
  29608. e.y -= t.y,
  29609. e.z -= t.z
  29610. }
  29611. ,
  29612. r.applyQuaternionToVector = function(e, t) {
  29613. var i = t.x
  29614. , n = t.y
  29615. , r = t.z
  29616. , o = e.x
  29617. , a = e.y
  29618. , s = e.z
  29619. , l = e.w
  29620. , c = l * i + a * r - s * n
  29621. , h = l * n + s * i - o * r
  29622. , u = l * r + o * n - a * i
  29623. , d = -o * i - a * n - s * r;
  29624. t.x = c * l + d * -o + h * -s - u * -a,
  29625. t.y = h * l + d * -a + u * -o - c * -s,
  29626. t.z = u * l + d * -s + c * -a - h * -o
  29627. }
  29628. ,
  29629. r.angleBetweenVectors = function(e, t) {
  29630. return Math.acos(r.dot(e, t))
  29631. }
  29632. ,
  29633. t.exports = r
  29634. }
  29635. , {
  29636. "../constants": 8
  29637. }],
  29638. 177: [function(e, t, i) {
  29639. (function(i) {
  29640. "use strict";
  29641. function n(e) {
  29642. this.cache = null,
  29643. this.expires = 0
  29644. }
  29645. function r() {
  29646. this.baseUrl = null,
  29647. this.cache = null,
  29648. this.expires = 0
  29649. }
  29650. function o() {
  29651. this.baseUrl = null,
  29652. this.expires = 0
  29653. }
  29654. function a(e) {
  29655. this.initialLoadingPromise = null,
  29656. this.endpoint = e + "?type=3",
  29657. this.urlContainer = null,
  29658. this.authorizationHeader = h.getAuthorizationHeader(),
  29659. this.containerClasses = [o, r, n]
  29660. }
  29661. var s = e("./ajax")
  29662. , l = e("./logger")
  29663. , c = e("../constants")
  29664. , h = e("./showcase")
  29665. , u = (e("../ab"),
  29666. new l(i));
  29667. n.prototype = {
  29668. version: 1,
  29669. validate: function(e) {
  29670. return "catalog.json"in e && Object.keys(e).length > 0
  29671. },
  29672. update: function(e) {
  29673. return this.cache = e,
  29674. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29675. $.when()
  29676. },
  29677. get: function(e) {
  29678. return this.cache[e]
  29679. }
  29680. },
  29681. r.prototype = {
  29682. version: 2,
  29683. validate: function(e) {
  29684. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29685. },
  29686. update: function(e) {
  29687. return this.baseUrl = e["base.url"],
  29688. this.cache = e,
  29689. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29690. $.when()
  29691. },
  29692. get: function(e) {
  29693. var t = this.cache[e];
  29694. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29695. }
  29696. },
  29697. o.prototype = {
  29698. version: 3,
  29699. validate: function(e) {
  29700. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29701. },
  29702. update: function(e) {
  29703. return this.baseUrl = e.templates[0],
  29704. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29705. $.when()
  29706. },
  29707. get: function(e) {
  29708. return this.baseUrl.replace("{{filename}}", e)
  29709. }
  29710. },
  29711. a.prototype = {
  29712. init: function() {
  29713. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29714. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29715. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29716. this.refresh().done(function() {
  29717. u.debug("Refreshed")
  29718. }).fail(function() {
  29719. u.error("Failed url refresh, urls might go stale soon")
  29720. }))
  29721. }
  29722. .bind(this), c.signedUrlCheckInterval),
  29723. this.initialLoadingPromise = this.refresh(),
  29724. this.initialLoadingPromise)
  29725. },
  29726. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29727. e = e || {};
  29728. /*var t = void 0 === e.cache || e.cache;
  29729. return s.get( this.endpoint , { //file
  29730. responseType: "json",
  29731. prefetchFrom: t ? "files" : null,
  29732. cache: t,
  29733. auth: this.authorizationHeader
  29734. }).then(function(e) {
  29735. if (this.urlContainer && this.urlContainer.validate(e))
  29736. return this.urlContainer.update(e);
  29737. for (var i = 0; i < this.containerClasses.length; i++) {
  29738. var n = this.containerClasses[i]
  29739. , r = new n;
  29740. if (r.validate(e))
  29741. return u.info("Using urls version " + r.version),
  29742. this.urlContainer = r,
  29743. this.urlContainer.update(e)
  29744. }
  29745. return t ? this.refresh({
  29746. cache: !1
  29747. }) : $.Deferred().reject("missing-urls")
  29748. }
  29749. .bind(this), function(e) {
  29750. return "loading-failed"
  29751. }) */
  29752. return $.Deferred().resolve();
  29753. },
  29754. get: function(e) {
  29755. //return this.urlContainer.get(e)
  29756. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29757. }
  29758. },
  29759. t.exports = a
  29760. }
  29761. ).call(this, "/js/util/ModelUrls.js")
  29762. }
  29763. , {
  29764. "../ab": 3,
  29765. "../constants": 8,
  29766. "./ajax": 181,
  29767. "./logger": 189,
  29768. "./showcase": 193
  29769. }],
  29770. 178: [function(e, t, i) {
  29771. (function(i) {
  29772. "use strict";
  29773. function n() {
  29774. u.call(this),
  29775. this.neighbourMap = {},
  29776. this.map = null
  29777. }
  29778. var r = e("three")
  29779. , o = e("./common")
  29780. , a = e("../settings")
  29781. , s = e("../objects/Panorama")
  29782. , a = e("../settings")
  29783. , l = e("./aStar")
  29784. , c = e("./logger")
  29785. , h = new c(i)
  29786. , u = e("./IndexedCollection")
  29787. , d = e("./transitions");
  29788. o.inherit(n, u),
  29789. n.prototype.getIndex = function(e) {
  29790. return e.id
  29791. }
  29792. ,
  29793. n.prototype.find = function(e, t) {
  29794. var i = o.filterAll(this.list, e);
  29795. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29796. i = o.stableSort(i, e)
  29797. }),
  29798. i[0])
  29799. }
  29800. /* n.prototype.sortByScore = function(e, t) {
  29801. var i = o.filterAll(this.list, e);
  29802. return 0 === i.length ? null : i = i.map(function(e) {
  29803. return {
  29804. pano: e,
  29805. score: t.reduce(function(t, i) {
  29806. return t + i(e)
  29807. }, 0)
  29808. }
  29809. }).sort(function(e, t) {
  29810. return t.score - e.score;
  29811. })
  29812. } */
  29813. ,
  29814. n.prototype.sortByScore = function( request, rank){
  29815. return common.sortByScore(this.list, request, rank)
  29816. }
  29817. ,
  29818. n.prototype.lowestByScore = function(e, t, i) {
  29819. return this.findRankedByScore(0, e, t, i)
  29820. }
  29821. ,
  29822. n.prototype.findRankedByScore = function(e, t, i, n) {
  29823. n && (n.candidates = null,
  29824. n.pano = null),
  29825. e || (e = 0);
  29826. var r = this.sortByScore(t, i);
  29827. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29828. n.pano = r[e].item),
  29829. r[e].item)
  29830. }
  29831. ,
  29832. n.prototype.showPanoScores = function(e) {
  29833. this.list.forEach(function(e) {
  29834. e.removeTextSprite()
  29835. });
  29836. var t = 6344768;
  29837. e.forEach(function(e) {
  29838. e.pano.addTextSprite(e.score.toFixed(2), t),
  29839. t = 16428055
  29840. })
  29841. }
  29842. ,
  29843. n.prototype.isNeighbour = function(e, t) {
  29844. return this.neighbourMap[e.id][t.id]
  29845. }
  29846. ,
  29847. n.prototype.getNeighbours = function(e) {
  29848. return this.neighbourMap[e.id]
  29849. }
  29850. ,
  29851. n.prototype.setNeighbour = function(e, t, i) {
  29852. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29853. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29854. this.neighbourMap[e.id][e.id] = !0,
  29855. this.neighbourMap[t.id][t.id] = !0,
  29856. this.neighbourMap[e.id][t.id] = i,
  29857. this.neighbourMap[t.id][e.id] = i,
  29858. this.neighbourMap[e.id]
  29859. }
  29860. ,
  29861. n.prototype.findClosest = function(e, t) {
  29862. var i = [s.filters.isPanoAligned()];
  29863. return t && i.push(s.filters.inDirection(e, t, .75)),
  29864. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29865. }
  29866. ,
  29867. n.prototype.dualNeighbors = function(e, t) {
  29868. var i, n = [];
  29869. for (i in this.neighbourMap[e.id])
  29870. this.neighbourMap[t.id][i] && n.push(i);
  29871. return n
  29872. }
  29873. ,
  29874. n.prototype.populate_path_graph = function() {
  29875. 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;
  29876. for (e = 0; e < this.list.length; e += 1) {
  29877. o = this.list[e],
  29878. s = {},
  29879. l = !1,
  29880. i = o.neighbourPanos || o.findNeighourPanos();
  29881. for (t in i)
  29882. if (i[t]) {
  29883. a = this.index[t],
  29884. p.copy(o.floorPosition),
  29885. p.sub(a.floorPosition);
  29886. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29887. , v = (Math.abs(p.y) / Math.max(m, .01),
  29888. Math.max(0, Math.abs(p.y) - .2));
  29889. v > 0 ? (f += 1,
  29890. v = Math.pow(4 * v, 2),
  29891. m = Math.pow(m, 2),
  29892. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29893. n = p.length()),
  29894. s[a.id] = n,
  29895. l = !0
  29896. }
  29897. l ? u[o.id] = s : d += 1
  29898. }
  29899. this.map = u,
  29900. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29901. }
  29902. ,
  29903. n.prototype.aStarSearch = function(e, t) {
  29904. var i = Date.now()
  29905. , n = new l({
  29906. start: e,
  29907. isEnd: function(e) {
  29908. return e === t
  29909. },
  29910. neighbor: function(e) {
  29911. var t = e.neighbourPanos || e.findNeighourPanos()
  29912. , i = [];
  29913. for (var n in t)
  29914. t[n] && i.push(this.index[n]); //add: t[n] &&
  29915. return i
  29916. }
  29917. .bind(this),
  29918. distance: function(e, t) {
  29919. var i = this.map[e.id]
  29920. , n = i[t.id];
  29921. return n
  29922. }
  29923. .bind(this),
  29924. heuristic: function(e, t) {
  29925. return 1
  29926. }
  29927. .bind(this),
  29928. hash: function(e) {
  29929. return e.id
  29930. },
  29931. timeout: 5e3
  29932. });
  29933. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29934. "success" !== n.status)
  29935. return h.debug("Did not find A* path from " + e + " to " + t),
  29936. null;
  29937. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29938. var r = [];
  29939. return n.path.forEach(function(e) {
  29940. r.push(e.id)
  29941. }),
  29942. r
  29943. }
  29944. ,
  29945. n.prototype.includeNodesNearPath = function() {
  29946. var e = new r.Vector3
  29947. , t = new r.Vector3
  29948. , i = new r.Vector3
  29949. , n = new r.Vector3
  29950. , o = new r.Vector3
  29951. , a = new r.Vector3
  29952. , s = new r.Vector3
  29953. , l = new r.Vector3
  29954. , c = []
  29955. , h = new r.Vector3
  29956. , u = new r.Vector3;
  29957. return function(r, d) {
  29958. if (r)
  29959. for (var p = function(e, t, i) {
  29960. return o.copy(t).sub(e),
  29961. o.dot(i)
  29962. }, f = function(e, t) {
  29963. return p(h, e.position, i) - p(h, t.position, i)
  29964. }, g = 0; g < r.length - 1; ) {
  29965. var m = r[g]
  29966. , v = r[g + 1]
  29967. , A = this.index[m]
  29968. , y = this.index[v];
  29969. h.copy(A.position),
  29970. u.copy(y.position),
  29971. c.length = 0,
  29972. e.copy(u).sub(h),
  29973. i.copy(e).normalize();
  29974. for (var C = 0; C < this.list.length; C++) {
  29975. var I = this.list[C];
  29976. o.copy(I.position).sub(h);
  29977. var E = o.dot(i);
  29978. if (E > 0) {
  29979. s.copy(i),
  29980. s.multiplyScalar(E),
  29981. a.copy(o),
  29982. a.sub(s);
  29983. var b = a.length();
  29984. if (b < d) {
  29985. t.copy(e).negate(),
  29986. n.copy(t).normalize(),
  29987. l.copy(I.position).sub(u);
  29988. var w = l.dot(n);
  29989. w > 0 && c.push(I)
  29990. }
  29991. }
  29992. }
  29993. if (c.length > 0) {
  29994. c.sort(f);
  29995. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29996. r[_] = r[_ - c.length];
  29997. for (var T = 0; T < c.length; T++)
  29998. r[T + g + 1] = c[T].id
  29999. }
  30000. g += c.length + 1
  30001. }
  30002. }
  30003. }(),
  30004. /* n.prototype.fadeMarkerOpacity = function(e, t) {
  30005. var i = void 0 === e ? a.panorama.markerOpacity : e
  30006. , n = this.list.findIndex(function(e) {
  30007. return e.marker
  30008. });
  30009. if (!(n < 0)) {
  30010. var r = this.list[n].marker.material.opacity;
  30011. if (r !== e) {
  30012. var o = i - r;
  30013. d.trigger({
  30014. func: function(e, t) {
  30015. var i = r + e * o;
  30016. this.forEach(function(e) {
  30017. e.marker && (e.marker.material.opacity = i)
  30018. })
  30019. }
  30020. .bind(this),
  30021. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30022. name: "_fpm"
  30023. })
  30024. }
  30025. }
  30026. } */
  30027. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  30028. d.cancelById('fadeMarkerOpacity')
  30029. var n = this.list.findIndex(function (e) {
  30030. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30031. return e.marker
  30032. })
  30033. if (n < 0) {
  30034. //logger.info('marker findIndex<0')
  30035. return
  30036. }
  30037. var group
  30038. var tran = function (list, index) {
  30039. list.member = list.member.filter(function (m) {
  30040. return m.marker && m.marker.material.opacity != list.toOp
  30041. })
  30042. transitions.trigger({
  30043. func: function (e, t) {
  30044. //e:0-1
  30045. list.member.forEach(function (m) {
  30046. var o = m.marker.oldOpacity
  30047. var i = o + e * (list.toOp - o)
  30048. m.marker && (m.marker.material.opacity = i)
  30049. })
  30050. }.bind(this),
  30051. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  30052. name: '_fpm_' + index,
  30053. id: 'fadeMarkerOpacity',
  30054. })
  30055. }
  30056. this.forEach(function (e) {
  30057. //先记录旧的opacity
  30058. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  30059. })
  30060. group = gr
  30061. /* if (e > 0 && gr) {
  30062. group = gr
  30063. } else {
  30064. group = [
  30065. {
  30066. member: this.list,
  30067. toOp: 0,
  30068. },
  30069. ]
  30070. } */
  30071. for (var i = 0; i < group.length; i++) {
  30072. tran(group[i], i)
  30073. }
  30074. }
  30075. ,
  30076. t.exports = n
  30077. }
  30078. ).call(this, "/js/util/PanoramaCollection.js")
  30079. }
  30080. , {
  30081. "../objects/Panorama": 148,
  30082. "../settings": 166,
  30083. "./IndexedCollection": 175,
  30084. "./aStar": 180,
  30085. "./common": 185,
  30086. "./logger": 189,
  30087. "./transitions": 195,
  30088. three: 217
  30089. }],
  30090. 179: [function(e, t, i) {
  30091. "use strict";
  30092. function n() {
  30093. this.actionSequence = [],
  30094. this.actionSequenceInProgress = !1
  30095. }
  30096. function r(e, t, i, n) {
  30097. s.trackAlways("zoom_" + e, {
  30098. from: t,
  30099. to: i,
  30100. pano: n
  30101. })
  30102. }
  30103. function o(e, t) {
  30104. r("initial", 1, e, t)
  30105. }
  30106. function a(e, t, i) {
  30107. r("followup", e, t, i)
  30108. }
  30109. var s = e("../analytics");
  30110. n.prototype.reset = function(e) {
  30111. this.actionSequenceInProgress = !1,
  30112. this.actionSequence.length = 0
  30113. }
  30114. ,
  30115. n.prototype.addZoomAction = function() {
  30116. var e = null
  30117. , t = null
  30118. , i = !1
  30119. , n = function() {
  30120. if (e = null,
  30121. this.actionSequence.length > 0) {
  30122. var i = this.actionSequence[0].start
  30123. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30124. 1 === i ? o(n, t) : a(i, n, t)
  30125. }
  30126. this.reset()
  30127. };
  30128. return function(r, o, a) {
  30129. if (r !== o) {
  30130. i || (n = n.bind(this),
  30131. i = !0),
  30132. e && (window.clearTimeout(e),
  30133. e = null),
  30134. a === t && this.actionSequenceInProgress || (this.reset(),
  30135. t = a),
  30136. this.actionSequenceInProgress = !0;
  30137. var s = {
  30138. start: r,
  30139. end: o
  30140. };
  30141. this.actionSequence.push(s),
  30142. e = window.setTimeout(n, 150)
  30143. }
  30144. }
  30145. }(),
  30146. t.exports = n
  30147. }
  30148. , {
  30149. "../analytics": 4
  30150. }],
  30151. 180: [function(e, t, i) {
  30152. "use strict";
  30153. function n(e) {
  30154. void 0 === e.timeout && (e.timeout = 1 / 0);
  30155. var t = e.hash || o
  30156. , i = {
  30157. data: e.start,
  30158. g: 0,
  30159. h: e.heuristic(e.start)
  30160. }
  30161. , n = i;
  30162. i.f = i.h;
  30163. var h = new s
  30164. , u = new l(a)
  30165. , d = c();
  30166. u.push(i),
  30167. d.set(t(i.data), i);
  30168. for (var p = new Date; u.size(); ) {
  30169. if (new Date - p > e.timeout)
  30170. return {
  30171. status: "timeout",
  30172. cost: n.g,
  30173. path: r(n)
  30174. };
  30175. var f = u.pop();
  30176. if (d.delete(t(f.data)),
  30177. e.isEnd(f.data))
  30178. return {
  30179. status: "success",
  30180. cost: f.g,
  30181. path: r(f)
  30182. };
  30183. h.add(t(f.data));
  30184. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30185. var v = g[m];
  30186. if (!h.contains(t(v))) {
  30187. var A = f.g + e.distance(f.data, v)
  30188. , y = d.get(t(v))
  30189. , C = !1;
  30190. if (void 0 === y)
  30191. y = {
  30192. data: v
  30193. },
  30194. d.set(t(v), y);
  30195. else {
  30196. if (y.g < A)
  30197. continue;
  30198. C = !0
  30199. }
  30200. y.parent = f,
  30201. y.g = A,
  30202. y.h = e.heuristic(v),
  30203. y.f = A + y.h,
  30204. y.h < n.h && (n = y),
  30205. C ? u.heapify() : u.push(y)
  30206. }
  30207. }
  30208. }
  30209. return {
  30210. status: "noPath",
  30211. cost: n.g,
  30212. path: r(n)
  30213. }
  30214. }
  30215. function r(e) {
  30216. if (void 0 !== e.parent) {
  30217. var t = r(e.parent);
  30218. return t.push(e.data),
  30219. t
  30220. }
  30221. return [e.data]
  30222. }
  30223. function o(e) {
  30224. return e.toString()
  30225. }
  30226. function a(e, t) {
  30227. return e.f - t.f
  30228. }
  30229. var s = e("Set")
  30230. , l = e("heap")
  30231. , c = e("dict");
  30232. t.exports = n
  30233. }
  30234. , {
  30235. Set: 196,
  30236. dict: 210,
  30237. heap: 211
  30238. }],
  30239. 181: [function(e, t, i) {
  30240. (function(i) {
  30241. "use strict";
  30242. function n(e, t, i) {
  30243. var n = new XMLHttpRequest;
  30244. if (i && "withCredentials"in n)
  30245. n.open(e, t, i);
  30246. else if ("undefined" != typeof XDomainRequest)
  30247. n = new XDomainRequest,
  30248. n.open(e, t);
  30249. else {
  30250. if (i)
  30251. throw "Browser does not support CORS!";
  30252. n.open(e, t)
  30253. }
  30254. return n
  30255. }
  30256. function r(e, t, i) {
  30257. function o() {
  30258. u.warn("Retrying ", t),
  30259. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30260. }
  30261. function a(e, t) {
  30262. var i = e.response;
  30263. if ("json" === t && "object" != typeof i)
  30264. try {
  30265. i = JSON.parse(e.responseText)
  30266. } catch (e) {
  30267. return void c.reject({
  30268. error: "Failed parsing JSON"
  30269. })
  30270. }
  30271. else if ("image/jpeg" === t) {
  30272. var n = new Uint8Array(e.response)
  30273. , r = new Blob([n],{
  30274. type: "image/jpeg"
  30275. })
  30276. , o = URL.createObjectURL(r);
  30277. i = new Image,
  30278. i.src = o,
  30279. i.crossOrigin = "Anonymous",
  30280. i.onload = function() {
  30281. URL.revokeObjectURL(o)
  30282. }
  30283. }
  30284. return i
  30285. }
  30286. var s = n(e, t, !1);
  30287. if (i = i || {},
  30288. i.retries = void 0 !== i.retries ? i.retries : 0,
  30289. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30290. i.responseType)
  30291. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30292. s.responseType = i.responseType;
  30293. else {
  30294. if ("image/jpeg" !== i.responseType)
  30295. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30296. s.responseType = "arraybuffer"
  30297. }
  30298. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30299. i.auth && s.setRequestHeader("Authorization", i.auth),
  30300. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30301. s.setRequestHeader("Content-Type", "application/json")),
  30302. "object" == typeof i.headers)
  30303. for (var l in i.headers)
  30304. s.setRequestHeader(l, i.headers[l]);
  30305. var c = $.Deferred();
  30306. return s.onreadystatechange = function(e) {
  30307. if (4 === this.readyState)
  30308. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30309. i.retries++,
  30310. setTimeout(o, 1e3);
  30311. else if (200 === this.status) {
  30312. var t = a(this, i.responseType);
  30313. c.resolve(t)
  30314. } else
  30315. c.reject(this)
  30316. }
  30317. ,
  30318. s.onprogress = function(e) {
  30319. c.notify(e)
  30320. }
  30321. ,
  30322. s.send(i.data),
  30323. c.promise()
  30324. }
  30325. function o(e) {
  30326. return Object.keys(e).sort().map(function(t) {
  30327. return {
  30328. key: t,
  30329. value: e[t]
  30330. }
  30331. })
  30332. }
  30333. function a(e, t) {
  30334. var i = t.responseType || null
  30335. , n = t.auth || null
  30336. , r = t.prefetchFrom || null
  30337. , a = e + "__" + i + "__" + n + "__" + r;
  30338. return t.headers && o(t.headers).forEach(function(e) {
  30339. a += "__" + e.key + ":" + e.value
  30340. }),
  30341. a
  30342. }
  30343. function s(e, t) {
  30344. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30345. }
  30346. function l(e, t, i) {
  30347. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30348. }
  30349. var c = e("./logger")
  30350. , h = e("../ab")
  30351. , u = new c(i);
  30352. window.URL = window.URL || window.webkitURL,
  30353. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30354. window.DATA = window.DATA || {}
  30355. /* setTimeout(function() {//MP-- xzw delete
  30356. window.MP_REQUEST_CACHE = null,
  30357. window.DATA = {}
  30358. }, 6e4),
  30359. window.onpageshow = function(e) {
  30360. e.persisted && (window.MP_REQUEST_CACHE = null,
  30361. window.DATA = {})
  30362. } */
  30363. ,
  30364. t.exports = {
  30365. get: function(e, t) {
  30366. t = t || {};
  30367. var i = void 0 === t.cache || t.cache;
  30368. if (i) {
  30369. var n = s(e, t);
  30370. if (n)
  30371. return n
  30372. }
  30373. var o;
  30374. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30375. i && l(e, t, o),
  30376. o
  30377. },
  30378. post: function(e, t) {
  30379. return r("POST", e, t)
  30380. },
  30381. patch: function(e, t) {
  30382. return r("PATCH", e, t)
  30383. },
  30384. getImage: function(e, t) {
  30385. function i() {
  30386. u.warn("Retrying ", e),
  30387. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30388. }
  30389. var n = $.Deferred()
  30390. , r = new Image
  30391. , o = this;
  30392. return e = h.changeIfImageOptimzing(e),
  30393. null !== t && void 0 !== t || (t = 3),
  30394. r.onerror = function() {
  30395. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30396. }
  30397. ,
  30398. r.onload = function() {
  30399. n.resolve(r)
  30400. }
  30401. ,
  30402. r.crossOrigin = "anonymous",
  30403. r.src = e,
  30404. n
  30405. }
  30406. }
  30407. }
  30408. ).call(this, "/js/util/ajax.js")
  30409. }
  30410. , {
  30411. "../ab": 3,
  30412. "./logger": 189
  30413. }],
  30414. 182: [function(e, t, i) {
  30415. "use strict";
  30416. function n(e, t) {
  30417. var i = window.navigator.userAgent
  30418. , n = i.match(e);
  30419. return n = n ? n[1].split(t) : [],
  30420. {
  30421. major: parseInt(n[0]) || 0,
  30422. minor: parseInt(n[1]) || 0,
  30423. patch: parseInt(n[2]) || 0
  30424. }
  30425. }
  30426. var r = e("../exception/DeviceMismatchException");
  30427. t.exports = {
  30428. supportsFullscreen: function() {
  30429. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30430. },
  30431. isPointerLocked: function() {
  30432. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30433. },
  30434. requestFullscreen: function(e, t) {
  30435. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30436. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30437. },
  30438. requestPointerLock: function() {
  30439. var e;
  30440. if (document.fullscreenElement)
  30441. e = document.fullscreenElement();
  30442. else if (document.mozFullscreenElement)
  30443. e = document.mozFullscreenElement();
  30444. else if (document.mozFullScreenElement)
  30445. e = document.mozFullScreenElement();
  30446. else {
  30447. if (!document.webkitFullscreenElement)
  30448. return;
  30449. e = document.webkitFullscreenElement()
  30450. }
  30451. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30452. e.requestPointerLock(),
  30453. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30454. },
  30455. exitPointerLock: function() {
  30456. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30457. document.exitPointerLock()
  30458. },
  30459. exitFullscreen: function() {
  30460. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30461. },
  30462. details: function() {
  30463. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30464. return e ? {
  30465. name: e[1],
  30466. version: parseInt(e[2]),
  30467. platform: navigator.platform
  30468. } : {}
  30469. },
  30470. is: function(e) {
  30471. return this.details() && this.details().name === e
  30472. },
  30473. inIframe: function() {
  30474. return window.parent !== window
  30475. },
  30476. aspectRatio: function() {
  30477. var e = $("#player").width() / $("#player").height();
  30478. return isFinite(e) ? e : 0
  30479. },
  30480. userAgent: function() {
  30481. return window.navigator.userAgent
  30482. },
  30483. isLandscape: function() {
  30484. return this.isMobile && this.aspectRatio() > 1
  30485. },
  30486. isSmallScreen: function() {
  30487. var e = screen.width / window.devicePixelRatio;
  30488. return e < 240
  30489. },
  30490. detectIE: function() {
  30491. var e = window.navigator.userAgent
  30492. , t = e.indexOf("MSIE ");
  30493. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30494. },
  30495. detectSafari: function() {
  30496. var e = window.navigator.userAgent
  30497. , t = e.indexOf("Safari");
  30498. return t !== -1 && !this.detectChrome()
  30499. },
  30500. detectFirefox: function() {
  30501. var e = window.navigator.userAgent;
  30502. return e.indexOf("Firefox") !== -1
  30503. },
  30504. detectChrome: function() {
  30505. var e = window.navigator.userAgent;
  30506. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30507. },
  30508. detectOpera: function() {
  30509. var e = window.navigator.userAgent;
  30510. return e.indexOf("OPR") !== -1
  30511. },
  30512. detectIOS: function() {
  30513. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30514. },
  30515. detectIPad: function() {
  30516. var e = window.navigator.userAgent
  30517. , t = /iPad/;
  30518. return t.test(e)
  30519. },
  30520. detectIPod: function() {
  30521. var e = window.navigator.userAgent
  30522. , t = /iPod/;
  30523. return t.test(e)
  30524. },
  30525. detectIPhone: function() {
  30526. var e = window.navigator.userAgent
  30527. , t = /iPhone/;
  30528. return t.test(e)
  30529. },
  30530. detectAndroid: function() {
  30531. var e = window.navigator.userAgent;
  30532. return e.indexOf("Android") !== -1
  30533. },
  30534. detectAndroidMobile: function() {
  30535. var e = window.navigator.userAgent;
  30536. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30537. },
  30538. detectSamsungNative: function() {
  30539. var e = window.navigator.userAgent;
  30540. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30541. },
  30542. detectSamsungS6: function() {
  30543. var e = window.navigator.userAgent;
  30544. return e.indexOf("SM-G92") !== -1
  30545. },
  30546. /************************************************************fyz改from徐世廷*************************************************************/
  30547. detectHUAWEI5X: function() {
  30548. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30549. },
  30550. /*******************************************************************************************************************************/
  30551. detectWebVR: function() {
  30552. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30553. },
  30554. getVRDisplay: function() {
  30555. var e = $.Deferred();
  30556. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30557. t.length >= 1 && e.resolve(t[0]),
  30558. e.reject(null)
  30559. }),
  30560. e) : e.reject(null)
  30561. },
  30562. iosVersion: function() {
  30563. if (!this.detectIOS())
  30564. throw new r("Did not detect an iDevice");
  30565. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30566. , t = "_";
  30567. return n(e, t)
  30568. },
  30569. androidVersion: function() {
  30570. if (!this.detectAndroid())
  30571. throw new r("Did not detect an Android based device");
  30572. var e = /Android ((?:\d+\.?){1,3})/
  30573. , t = ".";
  30574. return n(e, t)
  30575. },
  30576. valueFromCookie: function(e, t) {
  30577. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30578. if (!i)
  30579. return t;
  30580. var n = i[1];
  30581. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30582. },
  30583. }
  30584. Object.assign(window.browser, t.exports)
  30585. t.exports = window.browser
  30586. //changeLog()
  30587. }
  30588. , {
  30589. "../exception/DeviceMismatchException": 56
  30590. }],
  30591. 183: [function(e, t, i) {
  30592. (function(i) {
  30593. "use strict";
  30594. function n(e, t) {
  30595. var i = r(t);
  30596. var replaceAll = function (str, f, e) {
  30597. //f全部替换成e
  30598. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30599. return str.replace(reg, e);
  30600. };
  30601. var urlFirstView = c.valueFromHash('firstView');
  30602. if(urlFirstView){ //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  30603. try{
  30604. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30605. if(urlFirstView.includes('qua')){
  30606. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30607. urlFirstView += ']'
  30608. }else{
  30609. urlFirstView+='"'
  30610. }
  30611. urlFirstView = "{"+urlFirstView+"}"
  30612. let info = JSON.parse(urlFirstView);
  30613. i.pano = t.index[info.pano] //panos.get(info.pano)
  30614. if(!i.pano){
  30615. urlFirstView = false
  30616. console.error('检测到firstView但是 找不到该pano')
  30617. }else{
  30618. if(info.qua){
  30619. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30620. }else{
  30621. i.quaternion = new THREE.Quaternion()
  30622. }
  30623. i.zoom = -1;
  30624. i.mode = "panorama"
  30625. i.setByUrl = true
  30626. }
  30627. }catch(e){
  30628. urlFirstView = false
  30629. console.error('检测到firstView但是解析出错'+e)
  30630. }
  30631. }
  30632. if (Object.keys(i).length > 0)
  30633. return i;
  30634. if (e.heroImage)
  30635. i = o(e, t);
  30636. else if (window.DATA.camera_start) {
  30637. var n = window.DATA.camera_start;
  30638. try {
  30639. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30640. i.position = n.camera.position,
  30641. //i.quaternion = n.camera.quaternion,
  30642. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30643. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30644. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30645. d.debug("Using camera_start"),
  30646. d.debug("Modeldata pano: ", i.pano.quaternion),
  30647. d.debug("Camera start pano: ", n.pano.quaternion)),
  30648. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30649. } catch (e) {
  30650. d.warn(e.message)
  30651. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30652. }
  30653. }
  30654. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30655. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30656. i.pano = t.findClosest(i.position),
  30657. i.quaternion = i.pano.quaternion),
  30658. 0 === Object.keys(i).length) {
  30659. var a = t.list[0];
  30660. a && (i.mode = h.PANORAMA,
  30661. i.pano = a,
  30662. i.position = a.position,
  30663. i.quaternion = a.quaternion,
  30664. d.info("Starting at 1st pano " + a.id))
  30665. }
  30666. return i.mode = i.mode || h.DOLLHOUSE,
  30667. i
  30668. }
  30669. function r(e) {
  30670. var t = c.valueFromHash("start", "")
  30671. , i = {};
  30672. if ("" !== t) {
  30673. d.debug("Start override found in parameters, trying to parse..."),
  30674. i = a(t) || {};
  30675. var n = c.valueFromHash("tag", null);
  30676. n && (i.tag = n),
  30677. i.panoId && (i.pano = e.get(i.panoId))
  30678. }
  30679. return i
  30680. }
  30681. function o(e, t) {
  30682. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30683. return {};
  30684. var i = {}
  30685. , n = e.heroImage.metadata;
  30686. d.debug("Using start position from thumbnail image"),
  30687. i.position = n.camera_position,
  30688. i.quaternion = n.camera_quaternion;
  30689. try {
  30690. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30691. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30692. } catch (e) {
  30693. d.debug(e.message)
  30694. }
  30695. return i
  30696. }
  30697. function a(e) {
  30698. return s.deserialize(e)
  30699. }
  30700. var s = e("../controls/serializer")
  30701. , l = e("../util/math")
  30702. , c = e("./browser")
  30703. , h = e("../enum/Viewmode")
  30704. , u = e("../util/logger")
  30705. , th = e("three")//xzw
  30706. , d = new u(i);
  30707. t.exports = {
  30708. getStartCameraOptions: n
  30709. }
  30710. }
  30711. ).call(this, "/js/util/camera.js")
  30712. }
  30713. , {
  30714. "../controls/serializer": 14,
  30715. "../enum/Viewmode": 51,
  30716. "../util/logger": 189,
  30717. "../util/math": 190,
  30718. "./browser": 182,
  30719. "three": 217
  30720. }],
  30721. 184: [function(e, t, i) {
  30722. "use strict";
  30723. function n(e, t, i) {
  30724. return o(e.fov, t, i)
  30725. }
  30726. var r = e("./MathLight")
  30727. , o = function(e, t, i) {
  30728. var n = t
  30729. , o = i
  30730. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30731. return a
  30732. }
  30733. , a = function(e, t, i) {
  30734. var n = t
  30735. , o = i
  30736. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30737. return a
  30738. }
  30739. , s = function(e, t, i, n) {
  30740. var r = o(e, i, n);
  30741. return r > t ? a(t, i, n) : e
  30742. };
  30743. t.exports = {
  30744. clampVFOV: s,
  30745. getHFOVForCamera: n,
  30746. getHFOVFromVFOV: o,
  30747. getVFOVFromHFOV: a
  30748. }
  30749. window.MathLight = t.exports
  30750. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30751. var prec = Math.pow(10, - (precision || 4));
  30752. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30753. if(e1.w){
  30754. return s1 && Math.abs(e1.w - e2.w) < prec
  30755. }else return s1
  30756. }
  30757. }
  30758. , {
  30759. "./MathLight": 176
  30760. }],
  30761. 185: [function(e, t, i) {
  30762. "use strict";
  30763. var n = e("three");
  30764. t.exports = {
  30765. delayOneFrame: function(e) {
  30766. window.setTimeout(e, 1)
  30767. },
  30768. normalizeUrl: function(e) {
  30769. return e.replace("https://", "http://")
  30770. },
  30771. domainFromUrl: function(e) {
  30772. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30773. return t ? t[3] : e
  30774. },
  30775. average: function(e, t) {
  30776. if (0 === e.length)
  30777. return null;
  30778. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30779. var o = t ? e[r][t] : e[r];
  30780. i += o,
  30781. n++
  30782. }
  30783. return i / n
  30784. },
  30785. countUnique: function(e) {
  30786. for (var t = {}, i = 0; i < e.length; i++)
  30787. t[e[i]] = 1 + (t[e[i]] || 0);
  30788. return Object.keys(t).length
  30789. },
  30790. averageVectors: function(e, t) {
  30791. var i = new n.Vector3;
  30792. if (0 === e.length)
  30793. return i;
  30794. for (var r = 0, o = 0; o < e.length; o++) {
  30795. var a = t ? e[o][t] : e[o];
  30796. i.add(a),
  30797. r++
  30798. }
  30799. return i.divideScalar(r)
  30800. },
  30801. equalLists: function(e, t) {
  30802. if (e.length !== t.length)
  30803. return !1;
  30804. for (var i = 0; i < e.length; i++)
  30805. if (e[i] !== t[i])
  30806. return !1;
  30807. return !0
  30808. },
  30809. lowerMedian: function(e, t) {
  30810. if (0 === e.length)
  30811. return null;
  30812. t = t || 2,
  30813. e.sort(function(e, t) {
  30814. return e - t
  30815. });
  30816. var i = Math.floor(e.length / t);
  30817. return e[i]
  30818. },
  30819. stableSort: function(e, t) {
  30820. return e.map(function(e, t) {
  30821. return {
  30822. value: e,
  30823. index: t
  30824. }
  30825. }).sort(function(e, i) {
  30826. var n = t(e.value, i.value);
  30827. return 0 !== n ? n : e.index - i.index
  30828. }).map(function(e) {
  30829. return e.value
  30830. })
  30831. },
  30832. filterAll: function(e, t) {
  30833. return e.filter(function(e) {
  30834. return t.every(function(t) {
  30835. return t(e)
  30836. })
  30837. })
  30838. },
  30839. formatDate: function(e) {
  30840. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30841. },
  30842. formatDatetime: function(e) {
  30843. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30844. },
  30845. randomString: function(e) {
  30846. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30847. t += i.charAt(Math.floor(Math.random() * i.length));
  30848. return t
  30849. },
  30850. uint8ToBase64: function(e, t) {
  30851. t && "number" == typeof t || (t = 8192);
  30852. for (var i = [], n = 0; n < e.length; n += t)
  30853. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30854. return btoa(i.join(""))
  30855. },
  30856. uuid4: function e(t) {
  30857. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30858. },
  30859. nth: function(e) {
  30860. return e %= 10,
  30861. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30862. },
  30863. extendObject: function(e, t) {
  30864. return Object.keys(t).forEach(function(i) {
  30865. e[i] = t[i]
  30866. }),
  30867. e
  30868. },
  30869. deepExtend: function e(t) {
  30870. t = t || {};
  30871. for (var i = 1; i < arguments.length; i++) {
  30872. var n = arguments[i];
  30873. if (n)
  30874. for (var r in n)
  30875. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30876. }
  30877. return t
  30878. },
  30879. inherit: function(e, t) {
  30880. e.prototype = Object.create(t.prototype),
  30881. e.prototype.constructor = e
  30882. },
  30883. extend: function(e, t) {
  30884. for (var i in t.prototype)
  30885. e.prototype[i] = t.prototype[i]
  30886. }
  30887. ,
  30888. getFileNameFromUrl:function(url){
  30889. return url.split('/').pop();
  30890. }
  30891. },
  30892. Math.sign = function(e) {
  30893. return e < 0 ? -1 : 1
  30894. }
  30895. window.common = t.exports
  30896. expandCommon(common)
  30897. }
  30898. , {
  30899. three: 217
  30900. }],
  30901. 186: [function(e, t, i) {
  30902. "use strict";
  30903. var n = {};
  30904. n.linearTween = function(e, t, i, n) {
  30905. return i * e / n + t
  30906. }
  30907. ,
  30908. n.easeInQuad = function(e, t, i, n) {
  30909. return e /= n,
  30910. i * e * e + t
  30911. }
  30912. ,
  30913. n.easeOutQuad = function(e, t, i, n) {
  30914. return e /= n,
  30915. -i * e * (e - 2) + t
  30916. }
  30917. ,
  30918. n.easeInOutQuad = function(e, t, i, n) {
  30919. return e /= n / 2,
  30920. e < 1 ? i / 2 * e * e + t : (e--,
  30921. -i / 2 * (e * (e - 2) - 1) + t)
  30922. }
  30923. ,
  30924. n.easeInCubic = function(e, t, i, n) {
  30925. return e /= n,
  30926. i * e * e * e + t
  30927. }
  30928. ,
  30929. n.easeOutCubic = function(e, t, i, n) {
  30930. return e /= n,
  30931. e--,
  30932. i * (e * e * e + 1) + t
  30933. }
  30934. ,
  30935. n.easeInOutCubic = function(e, t, i, n) {
  30936. return e /= n / 2,
  30937. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30938. i / 2 * (e * e * e + 2) + t)
  30939. }
  30940. ,
  30941. n.easeInQuart = function(e, t, i, n) {
  30942. return e /= n,
  30943. i * e * e * e * e + t
  30944. }
  30945. ,
  30946. n.easeOutQuart = function(e, t, i, n) {
  30947. return e /= n,
  30948. e--,
  30949. -i * (e * e * e * e - 1) + t
  30950. }
  30951. ,
  30952. n.easeInOutQuart = function(e, t, i, n) {
  30953. return e /= n / 2,
  30954. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30955. -i / 2 * (e * e * e * e - 2) + t)
  30956. }
  30957. ,
  30958. n.easeInQuint = function(e, t, i, n) {
  30959. return e /= n,
  30960. i * e * e * e * e * e + t
  30961. }
  30962. ,
  30963. n.easeOutQuint = function(e, t, i, n) {
  30964. return e /= n,
  30965. e--,
  30966. i * (e * e * e * e * e + 1) + t
  30967. }
  30968. ,
  30969. n.easeInOutQuint = function(e, t, i, n) {
  30970. return e /= n / 2,
  30971. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30972. i / 2 * (e * e * e * e * e + 2) + t)
  30973. }
  30974. ,
  30975. n.easeInSine = function(e, t, i, n) {
  30976. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30977. }
  30978. ,
  30979. n.easeOutSine = function(e, t, i, n) {
  30980. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30981. }
  30982. ,
  30983. n.easeInOutSine = function(e, t, i, n) {
  30984. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30985. }
  30986. ,
  30987. n.easeInExpo = function(e, t, i, n) {
  30988. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30989. }
  30990. ,
  30991. n.easeOutExpo = function(e, t, i, n) {
  30992. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30993. }
  30994. ,
  30995. n.easeInOutExpo = function(e, t, i, n) {
  30996. return e /= n / 2,
  30997. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30998. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30999. }
  31000. ,
  31001. n.easeInCirc = function(e, t, i, n) {
  31002. return e /= n,
  31003. -i * (Math.sqrt(1 - e * e) - 1) + t
  31004. }
  31005. ,
  31006. n.easeOutCirc = function(e, t, i, n) {
  31007. return e /= n,
  31008. e--,
  31009. i * Math.sqrt(1 - e * e) + t
  31010. }
  31011. ,
  31012. n.easeInOutCirc = function(e, t, i, n) {
  31013. return e /= n / 2,
  31014. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31015. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31016. }
  31017. ,
  31018. n.easeInElastic = function(e, t, i, n) {
  31019. var r = 1.70158
  31020. , o = 0
  31021. , a = i;
  31022. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31023. a < Math.abs(i) ? (a = i,
  31024. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31025. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31026. }
  31027. ,
  31028. n.easeOutElastic = function(e, t, i, n) {
  31029. var r = 1.70158
  31030. , o = 0
  31031. , a = i;
  31032. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31033. a < Math.abs(i) ? (a = i,
  31034. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31035. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31036. }
  31037. ,
  31038. n.easeInOutElastic = function(e, t, i, n) {
  31039. var r = 1.70158
  31040. , o = 0
  31041. , a = i;
  31042. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31043. a < Math.abs(i) ? (a = i,
  31044. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31045. 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)
  31046. }
  31047. ,
  31048. n.easeInBack = function(e, t, i, n, r) {
  31049. return void 0 === r && (r = 1.70158),
  31050. i * (e /= n) * e * ((r + 1) * e - r) + t
  31051. }
  31052. ,
  31053. n.easeOutBack = function(e, t, i, n, r) {
  31054. return void 0 === r && (r = 1.70158),
  31055. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31056. }
  31057. ,
  31058. n.easeInOutBack = function(e, t, i, n, r) {
  31059. return void 0 === r && (r = 1.70158),
  31060. (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
  31061. }
  31062. ,
  31063. n.easeOutBounce = function(e, t, i, n) {
  31064. 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
  31065. }
  31066. ,
  31067. n.easeInBounce = function(e, t, i, r) {
  31068. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31069. }
  31070. ,
  31071. n.easeInOutBounce = function(e, t, i, r) {
  31072. 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
  31073. }
  31074. ,
  31075. t.exports = n
  31076. window.easing = n
  31077. }
  31078. , {}],
  31079. 187: [function(e, t, i) {
  31080. "use strict";
  31081. function n() {
  31082. this.events = [],
  31083. this.valid = !1
  31084. }
  31085. var r = e("../enum/Joystick");
  31086. n.prototype.push = function(e, t) {
  31087. this.events.push({
  31088. direction: e,
  31089. pano: t
  31090. }),
  31091. this.valid = !0
  31092. }
  31093. ,
  31094. n.prototype.pop = function(e) {
  31095. var t = this.events.pop();
  31096. return this.events.length < 1 && (this.valid = !1),
  31097. t
  31098. }
  31099. ,
  31100. n.prototype.peek = function() {
  31101. return this.events.length ? this.events[this.events.length - 1] : {
  31102. direction: null,
  31103. pano: null
  31104. }
  31105. }
  31106. ,
  31107. n.prototype.invalidate = function() {
  31108. this.events = [],
  31109. this.valid = !1
  31110. }
  31111. ,
  31112. n.prototype.reversePano = function(e) {
  31113. if (!this.valid)
  31114. return null;
  31115. var t = this.peek();
  31116. return r.opposite(e) === t.direction ? (this.pop(),
  31117. t.pano) : null
  31118. }
  31119. ,
  31120. t.exports = n
  31121. }
  31122. , {
  31123. "../enum/Joystick": 29
  31124. }],
  31125. 188: [function(e, t, i) {
  31126. "use strict";
  31127. window.lerp = t.exports = {
  31128. vector: function(e, t) {
  31129. var i = e.clone();
  31130. return t = t.clone(),
  31131. function(n) {
  31132. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31133. }
  31134. },
  31135. quaternion: function(e, t) {
  31136. var i = e.clone();
  31137. return function(n) {
  31138. e.copy(i).slerp(t, n)
  31139. }
  31140. },
  31141. property: function(e, t, i, n) {
  31142. var r = e[t];
  31143. return function(o) {
  31144. e[t] = r * (1 - o) + i * o,
  31145. n && n(e[t])
  31146. }
  31147. },
  31148. uniform: function(e, t, i) {
  31149. var n = e.material.uniforms[t].value;
  31150. return function(r) {
  31151. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31152. }
  31153. },
  31154. matrix4: function(e, t) {
  31155. var i = e.clone();
  31156. return function(n) {
  31157. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31158. r[s] = o[s] * (1 - n) + a[s] * n
  31159. }
  31160. },
  31161. allUniforms: function(e, t, i) {
  31162. var n = e.map(function(e) {
  31163. return this.uniform(e, t, i)
  31164. }
  31165. .bind(this));
  31166. return function(e) {
  31167. n.forEach(function(t) {
  31168. t(e)
  31169. })
  31170. }
  31171. }
  31172. }
  31173. }
  31174. , {}],
  31175. 189: [function(e, t, i) {
  31176. "use strict";
  31177. function n(e) {
  31178. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31179. if (n.consoleEnabled) {
  31180. var h = function(e) {
  31181. $("#debug-console").append("<p>" + e + "</p>"),
  31182. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31183. };
  31184. t = function(e) {
  31185. h(Array.prototype.slice.call(arguments).join(" "))
  31186. }
  31187. ,
  31188. i = function(e) {
  31189. h(Array.prototype.slice.call(arguments).join(" "))
  31190. }
  31191. ,
  31192. o = function(e) {
  31193. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31194. }
  31195. ,
  31196. a = function(e) {
  31197. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31198. }
  31199. } else
  31200. console.log ? (t = console.log,
  31201. i = console.info ? console.info : console.log,
  31202. o = console.warn ? console.warn : console.log,
  31203. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31204. ;
  31205. var u = function(e) {
  31206. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31207. }
  31208. , d = function(t, i) {
  31209. if (r) {
  31210. var o = Array.prototype.slice.call(t).join(" ");
  31211. r.captureMessage(o, {
  31212. level: i,
  31213. path: e,
  31214. timestamp: n.timestamp()
  31215. })
  31216. }
  31217. }
  31218. , p = function(t, i) {
  31219. if (r) {
  31220. var o = Array.prototype.slice.call(t).join(" ");
  31221. r.captureException(new Error(o), {
  31222. level: i,
  31223. path: e,
  31224. timestamp: n.timestamp()
  31225. })
  31226. }
  31227. };
  31228. return {
  31229. debug: function() {
  31230. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31231. },
  31232. info: function() {
  31233. n.level >= n.levels.info && i.apply(console, u(arguments))
  31234. },
  31235. warn: function() {
  31236. d(arguments, "warn"),
  31237. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31238. },
  31239. error: function() {
  31240. p(arguments, "error"),
  31241. n.level >= n.levels.error && a.apply(console, u(arguments))
  31242. },
  31243. v3str: function(e, t) {
  31244. var i = void 0 === t ? 2 : t;
  31245. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31246. },
  31247. eulstr: function(e, t) {
  31248. var i = void 0 === t ? 2 : t;
  31249. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31250. },
  31251. time: function(e) {
  31252. n.level >= n.levels.debug && (c[e] = Date.now())
  31253. },
  31254. timeEnd: function(e) {
  31255. if (n.level >= n.levels.debug) {
  31256. var t = c[e];
  31257. if (!t)
  31258. return;
  31259. var i = (Date.now() - t) / 1e3;
  31260. this.debug(e, i + "s")
  31261. }
  31262. }
  31263. }
  31264. }
  31265. var r = window.Raven;
  31266. n.timestamp = function() {
  31267. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31268. }
  31269. ,
  31270. n.levels = {
  31271. debug: 3,
  31272. info: 2,
  31273. warn: 1,
  31274. error: 0
  31275. },
  31276. n.level = n.levels.info,
  31277. t.exports = n
  31278. }
  31279. , {}],
  31280. 190: [function(e, t, i) {
  31281. "use strict";
  31282. var n = e("three")
  31283. , r = e("../enum/GLCubeFaces")
  31284. , o = e("../constants");
  31285. t.exports = {
  31286. convertVisionVector: function(e) {
  31287. return new n.Vector3(e.x,e.z,-e.y)
  31288. },
  31289. convertVisionQuaternion: function(e) {
  31290. 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)))
  31291. },
  31292. convertWorkshopVector: function(e) {
  31293. return new n.Vector3(-e.x,e.y,e.z)
  31294. },
  31295. convertWorkshopQuaternion: function(e) {
  31296. 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))
  31297. },
  31298. convertWorkshopPanoramaQuaternion: function(e) {
  31299. 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)))
  31300. },
  31301. convertWorkshopOrthoZoom: function(e) {// xzw
  31302. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31303. //return e;
  31304. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31305. },
  31306. toPrecision: function(e, t) {//xzw change
  31307. var f = function(e, t){
  31308. var i = Math.pow(10, t);
  31309. return Math.round(e * i) / i
  31310. }
  31311. if(e instanceof Array){
  31312. for(var s=0; s<e.length; s++){
  31313. e[s] = f(e[s],t);
  31314. }
  31315. return e;
  31316. }
  31317. else return f(e,t)
  31318. },
  31319. isEmptyQuaternion: function(e) {
  31320. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31321. },
  31322. projectPositionToCanvas: function(e, t, i) {
  31323. i = i || new n.Vector3,
  31324. i.copy(e);
  31325. var r = .5 * $("#player").width()
  31326. , o = .5 * $("#player").height();
  31327. return i.project(t),
  31328. i.x = i.x * r + r,
  31329. i.y = -(i.y * o) + o,
  31330. i
  31331. },
  31332. convertScreenPositionToNDC: function(e, t, i) {
  31333. return i = i || new n.Vector2,
  31334. i.x = e / $("#player").width() * 2 - 1,
  31335. i.y = 2 * -(t / $("#player").height()) + 1,
  31336. i
  31337. },
  31338. constrainedTurn: function(e) {
  31339. var t = e % (2 * Math.PI);
  31340. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31341. },
  31342. getFOVDotThreshold: function(e) {
  31343. return Math.cos(n.Math.degToRad(e / 2))
  31344. },
  31345. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31346. switch (e) {
  31347. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31348. i.set(1, t.y, t.x);
  31349. break;
  31350. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31351. i.set(-1, t.y, -t.x);
  31352. break;
  31353. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31354. i.set(-t.x, 1, -t.y);
  31355. break;
  31356. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31357. i.set(-t.x, -1, t.y);
  31358. break;
  31359. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31360. i.set(-t.x, t.y, 1);
  31361. break;
  31362. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31363. i.set(t.x, t.y, -1)
  31364. }
  31365. n && i.normalize()
  31366. },
  31367. //add:
  31368. getPos2d : function(point, camera, dom){
  31369. var camera = camera ;
  31370. var dom = dom;
  31371. 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);
  31372. var x,y;
  31373. x = (pos.x + 1) / 2 * dom.clientWidth;
  31374. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31375. var inSight = x <= dom.clientWidth && x >= 0
  31376. && y <= dom.clientHeight && y >= 0
  31377. return {
  31378. pos: new THREE.Vector2(x,y),
  31379. vector: pos,
  31380. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31381. inSight : inSight //在屏幕范围内可见
  31382. };
  31383. },
  31384. getDirByLonLat: function(lon, lat) {
  31385. var dir = new THREE.Vector3();
  31386. var phi = THREE.Math.degToRad(90 - lat);
  31387. var theta = THREE.Math.degToRad(lon);
  31388. dir.x = Math.sin(phi) * Math.cos(theta);
  31389. dir.y = Math.cos(phi);
  31390. dir.z = Math.sin(phi) * Math.sin(theta);
  31391. return dir.negate();
  31392. }
  31393. }
  31394. window.math = t.exports
  31395. expandMath(math)
  31396. }
  31397. , {
  31398. "../constants": 8,
  31399. "../enum/GLCubeFaces": 25,
  31400. three: 217
  31401. }],
  31402. 191: [function(e, t, i) {
  31403. "use strict";
  31404. function n(e, t, i) {
  31405. return a.map(function(n, o) {
  31406. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31407. }
  31408. .bind(this))
  31409. }
  31410. function r(e) {
  31411. return s[e]
  31412. }
  31413. var o = e("../enum/GLCubeFaces")
  31414. , a = [0, 1, 2, 3, 4, 5]
  31415. , s = {
  31416. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31417. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31418. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31419. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31420. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31421. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31422. };
  31423. t.exports = {
  31424. mapFaceToCubemapFace: r,
  31425. getCubemapUrls: n
  31426. }
  31427. }
  31428. , {
  31429. "../enum/GLCubeFaces": 25
  31430. }],
  31431. 192: [function(e, t, i) {
  31432. "use strict";
  31433. t.exports = {
  31434. captureErrors: function(e, t, i) {
  31435. if ("Raven"in window) {
  31436. Raven.config(e, t).install(),
  31437. i && Raven.setTagsContext(i);
  31438. var n = console.warn
  31439. , r = console.error;
  31440. console.warn = function() {
  31441. var e = Array.prototype.slice.call(arguments);
  31442. Raven.captureMessage(e.join(" "), {
  31443. level: "warning"
  31444. }),
  31445. n.apply(console, e)
  31446. }
  31447. ,
  31448. console.error = function() {
  31449. var e = Array.prototype.slice.call(arguments);
  31450. Raven.captureException(new Error(e.join(" ")), {
  31451. level: "error"
  31452. }),
  31453. r.apply(console, e)
  31454. }
  31455. } else
  31456. console.error("Raven not found, not capturing errors.")
  31457. }
  31458. }
  31459. }
  31460. , {}],
  31461. 193: [function(e, t, i) {
  31462. (function(i) {
  31463. "use strict";
  31464. var n = e("./browser")
  31465. , r = e("../constants")
  31466. , o = e("url")
  31467. , a = e("./logger")
  31468. , ss = e('three')
  31469. , s = new a(i)
  31470. , l = {
  31471. getAuthorizationHeader: function() {
  31472. var e = n.valueFromHash("auth");
  31473. if (e)
  31474. return e.replace(",", " ");
  31475. var t = n.valueFromCookie("token");
  31476. return t ? "Token " + t : null
  31477. },
  31478. parseSidUrl: function(e) {
  31479. var t, i;
  31480. t=g_Prefix;
  31481. if (e = e || "",
  31482. e.match(/^https?/)) {
  31483. var n = o.parse(e);
  31484. t = g_Prefix,
  31485. i = e
  31486. } else{
  31487. //xzw 原先的不能用
  31488. //t = window.location.protocol + "//" + window.location.host, //MP
  31489. t = g_Prefix
  31490. //i = t + "/api/player/models/" + e; //MP
  31491. i = t + "data/" + e;
  31492. }
  31493. return {
  31494. urlBase: t,
  31495. urlModel: i,
  31496. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31497. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31498. }
  31499. },
  31500. getModelIDFromQueryString: function() {
  31501. return n.valueFromHash("model") || n.valueFromHash("m")
  31502. },
  31503. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31504. e = JSON.parse(JSON.stringify(e));
  31505. var i = null;
  31506. if (e.images.forEach(function(n) {
  31507. if(!n.metadata) return;
  31508. if ("string" == typeof n.metadata)
  31509. try {
  31510. n.metadata = JSON.parse(n.metadata)
  31511. } catch (e) {
  31512. s.warn("Unable to parse image metadata"),
  31513. n.metadata = null
  31514. }
  31515. else{
  31516. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31517. }
  31518. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31519. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31520. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31521. }else{
  31522. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31523. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31524. n.metadata.zoom = n.metadata.zoom || 1;
  31525. }
  31526. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31527. }),
  31528. //icon初始视角的:
  31529. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31530. var n = {};
  31531. n.pano = {
  31532. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31533. position: t.convertWorkshopVector(i.scan_position),
  31534. uuid: i.scan_id
  31535. },
  31536. n.camera = {
  31537. quaternion: i.camera_quaternion,
  31538. position: i.camera_position
  31539. },
  31540. e.startPano = n
  31541. }
  31542. return e
  31543. },
  31544. */
  31545. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31546. e = JSON.parse(JSON.stringify(e));
  31547. var i = null;
  31548. var deal = function(n) {
  31549. if(!n.metadata) return;
  31550. if ("string" == typeof n.metadata)
  31551. try {
  31552. n.metadata = JSON.parse(n.metadata)
  31553. } catch (e) {
  31554. s.warn("Unable to parse image metadata"),
  31555. n.metadata = null
  31556. }
  31557. else{
  31558. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31559. }
  31560. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31561. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31562. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31563. }else{
  31564. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31565. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31566. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31567. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31568. }
  31569. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31570. }
  31571. //改
  31572. e.images.forEach(info=>{
  31573. if(info.locations){
  31574. info.locations.forEach(a=>deal(a))
  31575. }else{
  31576. deal(info)
  31577. }
  31578. })
  31579. //icon初始视角的:
  31580. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31581. var n = {};
  31582. n.pano = {
  31583. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31584. position: t.convertWorkshopVector(i.scan_position),
  31585. uuid: i.scan_id
  31586. },
  31587. n.camera = {
  31588. quaternion: i.camera_quaternion,
  31589. position: i.camera_position
  31590. },
  31591. e.startPano = n
  31592. }
  31593. return e
  31594. },
  31595. visionVersionToInt: function() {
  31596. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31597. return function(t) {
  31598. if (!t)
  31599. throw new Error("Vision version is required");
  31600. var i = e.exec(t);
  31601. if (null === i)
  31602. throw new Error("String is not a vision version: " + t);
  31603. return parseInt(i[1])
  31604. }
  31605. }(),
  31606. modelDataPromisesTiles: function(e) {
  31607. var vision_version = e.vision_version || window.DATA.vision_version
  31608. if (vision_version)
  31609. try {
  31610. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31611. } catch (t) {
  31612. s.warn("Invalid vision version: " + vision_version)
  31613. }
  31614. // var t = e.created ? new Date(e.created) : null;
  31615. // return t && t >= r.visionTilingStartDate
  31616. return false
  31617. }
  31618. };
  31619. t.exports = l
  31620. }
  31621. ).call(this, "/js/util/showcase.js")
  31622. }
  31623. , {
  31624. "../constants": 8,
  31625. "./browser": 182,
  31626. "./logger": 189,
  31627. three:217,
  31628. url: 208
  31629. }],
  31630. 194: [function(e, t, i) {
  31631. "use strict";
  31632. var n = e("../util/ajax")
  31633. , r = e("three")
  31634. , o = e("../settings")
  31635. , a = {};
  31636. t.exports = {
  31637. load: function(e, t, i) {
  31638. var s = a[e];
  31639. return s ? (t && setTimeout(function() {
  31640. t(s)
  31641. }, 1),
  31642. s) : (s = new r.Texture,
  31643. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31644. s.magFilter = r.LinearFilter,
  31645. s.generateMipmaps = !1),
  31646. s.sourceFile = e,
  31647. a[e] = s,
  31648. n.getImage(e).then(function(e) {
  31649. s.image = e,
  31650. s.needsUpdate = !0,
  31651. t && t(s)
  31652. }).fail(i),
  31653. s)
  31654. },
  31655. loadBase64: function(e, t) {
  31656. t = t || "png";
  31657. var i = new r.Texture;
  31658. return i.image = document.createElement("img"),
  31659. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31660. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31661. i.magFilter = r.LinearFilter,
  31662. i.generateMipmaps = !1),
  31663. i.needsUpdate = !0,
  31664. i
  31665. },
  31666. isLoaded: function(e) {
  31667. return !!a[e]
  31668. }
  31669. }
  31670. window.Texture = t.exports
  31671. }
  31672. , {
  31673. "../settings": 166,
  31674. "../util/ajax": 181,
  31675. three: 217
  31676. }],
  31677. 195: [function(e, t, i) {
  31678. "use strict";
  31679. var n = e("./easing");
  31680. window.transitions = t.exports = {
  31681. globalDone: null,
  31682. funcs: [],
  31683. counter: 0,
  31684. uniqueID: 0,
  31685. start: function(e, t, i, r, o, a, s) {
  31686. return r = r || 0,
  31687. this.funcs.push({
  31688. func: e,
  31689. current: -r * Math.abs(t),
  31690. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31691. done: i,
  31692. easing: o || n.linearTween,
  31693. cycling: t < 0,
  31694. running: !0,
  31695. debug: r < 0,
  31696. name: a || "T" + this.counter,
  31697. id: void 0 === s ? this.counter : s,
  31698. paused: !1
  31699. }),
  31700. e(0, 16),
  31701. this.counter += 1,
  31702. e
  31703. },
  31704. trigger: function(e) {
  31705. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31706. , i = e.func || function() {}
  31707. , r = void 0 === e.duration ? 0 : e.duration;
  31708. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31709. var o = e.done || null
  31710. , a = e.easing || n.linearTween
  31711. , s = e.name || "R" + this.counter
  31712. , l = void 0 === e.id ? this.counter : e.id;
  31713. return this.start(i, r, o, t, a, s, l)
  31714. },
  31715. setTimeout: function(e, t, i) {
  31716. var n = void 0 === i ? this.counter : i;
  31717. return this.trigger({
  31718. done: e,
  31719. duration: void 0 === t ? 0 : t,
  31720. name: "O" + this.counter,
  31721. id: n
  31722. })
  31723. },
  31724. pause: function() {
  31725. this.paused = !0
  31726. },
  31727. resume: function() {
  31728. this.paused = !1
  31729. },
  31730. update: function(e) {
  31731. this.funcs.forEach(function(t) {
  31732. if (!(t.paused || (t.current += 1e3 * e,
  31733. t.current < 0)))
  31734. if (t.current >= t.duration && !t.cycling) {
  31735. var i = t.easing(1, 0, 1, 1);
  31736. t.func(i, 1e3 * e),
  31737. t.done && t.done(),
  31738. t.running = !1
  31739. } else {
  31740. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31741. , r = t.func(n, 1e3 * e) || !1;
  31742. r && (t.done && t.done(),
  31743. t.running = !1)
  31744. }
  31745. });
  31746. var t = this.funcs.length;
  31747. this.funcs = this.funcs.filter(function(e) {
  31748. return e.running
  31749. });
  31750. var i = this.funcs.length;
  31751. if (t > 0 && 0 === i && this.globalDone) {
  31752. var n = this.globalDone;
  31753. this.globalDone = null,
  31754. n()
  31755. }
  31756. },
  31757. adjustSpeed: function(e, t) {
  31758. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31759. var r = i[n];
  31760. r.duration /= t,
  31761. r.current /= t
  31762. }
  31763. },
  31764. getById: function(e) {
  31765. return this.funcs.filter(function(t) {
  31766. return e === t.id
  31767. })
  31768. },
  31769. get: function(e) {
  31770. for (var t = 0; t < this.funcs.length; t += 1)
  31771. if (this.funcs[t].func === e)
  31772. return this.funcs[t];
  31773. return null
  31774. },
  31775. isRunning: function(e) {
  31776. var t = this.get(e);
  31777. return null !== t && t.running
  31778. },
  31779. countActive: function() {
  31780. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31781. e += this.funcs[t].running;
  31782. return e
  31783. },
  31784. listActive: function() {
  31785. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31786. this.funcs[t].running && e.push(this.funcs[t].name);
  31787. return e
  31788. },
  31789. done: function(e) {
  31790. this.globalDone = e
  31791. },
  31792. cancelById: function(e) {
  31793. var t = void 0 === e ? 0 : e;
  31794. this.funcs = this.funcs.filter(function(e) {
  31795. return e.id !== t
  31796. })
  31797. },
  31798. cancel: function(e) {
  31799. this.funcs = this.funcs.filter(function(t) {
  31800. return t.func !== e
  31801. })
  31802. },
  31803. getUniqueId: function() {
  31804. return this.uniqueID -= 1,
  31805. this.uniqueID
  31806. }
  31807. }
  31808. }
  31809. , {
  31810. "./easing": 186
  31811. }],
  31812. 196: [function(e, t, i) {
  31813. function n(e) {
  31814. if (this.set = {},
  31815. this.infContains = function() {
  31816. return !0
  31817. }
  31818. ,
  31819. "object" == typeof e)
  31820. if (e instanceof Array)
  31821. for (var t = 0; t < e.length; t++)
  31822. this.set[e[t]] = !0;
  31823. else
  31824. this.set = e;
  31825. else if ("function" == typeof e)
  31826. this.infContains = e;
  31827. else if ("undefined" != typeof e)
  31828. throw new Error("set must be either an array or an object.")
  31829. }
  31830. t.exports = n,
  31831. n.prototype.contains = function(e) {
  31832. return !!this.set[e]
  31833. }
  31834. ,
  31835. n.prototype.has = n.prototype.contains,
  31836. n.prototype.add = function(e) {
  31837. if (1 == arguments.length)
  31838. this.set[e] = !0;
  31839. else
  31840. for (var t = 0; t < arguments.length; t++)
  31841. this.set[arguments[t]] = !0
  31842. }
  31843. ,
  31844. n.prototype.addAll = function(e) {
  31845. if ("object" != typeof e && !(e instanceof Array))
  31846. throw new Error("arr must be an array.");
  31847. for (var t = 0; t < e.length; t++)
  31848. this.add(e[t])
  31849. }
  31850. ,
  31851. n.prototype.remove = function(e) {
  31852. if (1 == arguments.length)
  31853. delete this.set[e];
  31854. else
  31855. for (var t = 0; t < arguments.length; t++)
  31856. delete this.set[arguments[t]]
  31857. }
  31858. ,
  31859. n.prototype.delete = n.prototype.remove,
  31860. n.prototype.clear = function() {
  31861. this.set = {}
  31862. }
  31863. ,
  31864. n.prototype.size = function() {
  31865. return Object.keys(this.set).length
  31866. }
  31867. ,
  31868. n.prototype.toString = function() {
  31869. return "{" + Object.keys(this.set).toString() + "}"
  31870. }
  31871. ,
  31872. n.prototype.toArray = function() {
  31873. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31874. }
  31875. ,
  31876. n.prototype["*values"] = n.prototype.toArray
  31877. }
  31878. , {}],
  31879. 197: [function(e, t, i) {}
  31880. , {}],
  31881. 198: [function(e, t, i) {
  31882. (function(t) {
  31883. "use strict";
  31884. function n() {
  31885. try {
  31886. var e = new Uint8Array(1);
  31887. return e.__proto__ = {
  31888. __proto__: Uint8Array.prototype,
  31889. foo: function() {
  31890. return 42
  31891. }
  31892. },
  31893. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31894. } catch (e) {
  31895. return !1
  31896. }
  31897. }
  31898. function r() {
  31899. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31900. }
  31901. function o(e, t) {
  31902. if (r() < t)
  31903. throw new RangeError("Invalid typed array length");
  31904. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31905. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31906. e.length = t),
  31907. e
  31908. }
  31909. function a(e, t, i) {
  31910. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31911. return new a(e,t,i);
  31912. if ("number" == typeof e) {
  31913. if ("string" == typeof t)
  31914. throw new Error("If encoding is specified then the first argument must be a string");
  31915. return h(this, e)
  31916. }
  31917. return s(this, e, t, i)
  31918. }
  31919. function s(e, t, i, n) {
  31920. if ("number" == typeof t)
  31921. throw new TypeError('"value" argument must not be a number');
  31922. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31923. }
  31924. function l(e) {
  31925. if ("number" != typeof e)
  31926. throw new TypeError('"size" argument must be a number');
  31927. if (e < 0)
  31928. throw new RangeError('"size" argument must not be negative')
  31929. }
  31930. function c(e, t, i, n) {
  31931. return l(t),
  31932. 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)
  31933. }
  31934. function h(e, t) {
  31935. if (l(t),
  31936. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31937. !a.TYPED_ARRAY_SUPPORT)
  31938. for (var i = 0; i < t; ++i)
  31939. e[i] = 0;
  31940. return e
  31941. }
  31942. function u(e, t, i) {
  31943. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31944. !a.isEncoding(i))
  31945. throw new TypeError('"encoding" must be a valid string encoding');
  31946. var n = 0 | v(t, i);
  31947. e = o(e, n);
  31948. var r = e.write(t, i);
  31949. return r !== n && (e = e.slice(0, r)),
  31950. e
  31951. }
  31952. function d(e, t) {
  31953. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31954. e = o(e, i);
  31955. for (var n = 0; n < i; n += 1)
  31956. e[n] = 255 & t[n];
  31957. return e
  31958. }
  31959. function p(e, t, i, n) {
  31960. if (t.byteLength,
  31961. i < 0 || t.byteLength < i)
  31962. throw new RangeError("'offset' is out of bounds");
  31963. if (t.byteLength < i + (n || 0))
  31964. throw new RangeError("'length' is out of bounds");
  31965. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31966. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31967. e.__proto__ = a.prototype) : e = d(e, t),
  31968. e
  31969. }
  31970. function f(e, t) {
  31971. if (a.isBuffer(t)) {
  31972. var i = 0 | g(t.length);
  31973. return e = o(e, i),
  31974. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31975. e)
  31976. }
  31977. if (t) {
  31978. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31979. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31980. if ("Buffer" === t.type && $(t.data))
  31981. return d(e, t.data)
  31982. }
  31983. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31984. }
  31985. function g(e) {
  31986. if (e >= r())
  31987. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31988. return 0 | e
  31989. }
  31990. function m(e) {
  31991. return +e != e && (e = 0),
  31992. a.alloc(+e)
  31993. }
  31994. function v(e, t) {
  31995. if (a.isBuffer(e))
  31996. return e.length;
  31997. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31998. return e.byteLength;
  31999. "string" != typeof e && (e = "" + e);
  32000. var i = e.length;
  32001. if (0 === i)
  32002. return 0;
  32003. for (var n = !1; ; )
  32004. switch (t) {
  32005. case "ascii":
  32006. case "latin1":
  32007. case "binary":
  32008. return i;
  32009. case "utf8":
  32010. case "utf-8":
  32011. case void 0:
  32012. return j(e).length;
  32013. case "ucs2":
  32014. case "ucs-2":
  32015. case "utf16le":
  32016. case "utf-16le":
  32017. return 2 * i;
  32018. case "hex":
  32019. return i >>> 1;
  32020. case "base64":
  32021. return Z(e).length;
  32022. default:
  32023. if (n)
  32024. return j(e).length;
  32025. t = ("" + t).toLowerCase(),
  32026. n = !0
  32027. }
  32028. }
  32029. function A(e, t, i) {
  32030. var n = !1;
  32031. if ((void 0 === t || t < 0) && (t = 0),
  32032. t > this.length)
  32033. return "";
  32034. if ((void 0 === i || i > this.length) && (i = this.length),
  32035. i <= 0)
  32036. return "";
  32037. if (i >>>= 0,
  32038. t >>>= 0,
  32039. i <= t)
  32040. return "";
  32041. for (e || (e = "utf8"); ; )
  32042. switch (e) {
  32043. case "hex":
  32044. return L(this, t, i);
  32045. case "utf8":
  32046. case "utf-8":
  32047. return M(this, t, i);
  32048. case "ascii":
  32049. return P(this, t, i);
  32050. case "latin1":
  32051. case "binary":
  32052. return O(this, t, i);
  32053. case "base64":
  32054. return S(this, t, i);
  32055. case "ucs2":
  32056. case "ucs-2":
  32057. case "utf16le":
  32058. case "utf-16le":
  32059. return D(this, t, i);
  32060. default:
  32061. if (n)
  32062. throw new TypeError("Unknown encoding: " + e);
  32063. e = (e + "").toLowerCase(),
  32064. n = !0
  32065. }
  32066. }
  32067. function y(e, t, i) {
  32068. var n = e[t];
  32069. e[t] = e[i],
  32070. e[i] = n
  32071. }
  32072. function C(e, t, i, n, r) {
  32073. if (0 === e.length)
  32074. return -1;
  32075. if ("string" == typeof i ? (n = i,
  32076. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32077. i = +i,
  32078. isNaN(i) && (i = r ? 0 : e.length - 1),
  32079. i < 0 && (i = e.length + i),
  32080. i >= e.length) {
  32081. if (r)
  32082. return -1;
  32083. i = e.length - 1
  32084. } else if (i < 0) {
  32085. if (!r)
  32086. return -1;
  32087. i = 0
  32088. }
  32089. if ("string" == typeof t && (t = a.from(t, n)),
  32090. a.isBuffer(t))
  32091. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32092. if ("number" == typeof t)
  32093. return t &= 255,
  32094. 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);
  32095. throw new TypeError("val must be string, number or Buffer")
  32096. }
  32097. function I(e, t, i, n, r) {
  32098. function o(e, t) {
  32099. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32100. }
  32101. var a = 1
  32102. , s = e.length
  32103. , l = t.length;
  32104. if (void 0 !== n && (n = String(n).toLowerCase(),
  32105. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32106. if (e.length < 2 || t.length < 2)
  32107. return -1;
  32108. a = 2,
  32109. s /= 2,
  32110. l /= 2,
  32111. i /= 2
  32112. }
  32113. var c;
  32114. if (r) {
  32115. var h = -1;
  32116. for (c = i; c < s; c++)
  32117. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32118. if (h === -1 && (h = c),
  32119. c - h + 1 === l)
  32120. return h * a
  32121. } else
  32122. h !== -1 && (c -= c - h),
  32123. h = -1
  32124. } else
  32125. for (i + l > s && (i = s - l),
  32126. c = i; c >= 0; c--) {
  32127. for (var u = !0, d = 0; d < l; d++)
  32128. if (o(e, c + d) !== o(t, d)) {
  32129. u = !1;
  32130. break
  32131. }
  32132. if (u)
  32133. return c
  32134. }
  32135. return -1
  32136. }
  32137. function E(e, t, i, n) {
  32138. i = Number(i) || 0;
  32139. var r = e.length - i;
  32140. n ? (n = Number(n),
  32141. n > r && (n = r)) : n = r;
  32142. var o = t.length;
  32143. if (o % 2 !== 0)
  32144. throw new TypeError("Invalid hex string");
  32145. n > o / 2 && (n = o / 2);
  32146. for (var a = 0; a < n; ++a) {
  32147. var s = parseInt(t.substr(2 * a, 2), 16);
  32148. if (isNaN(s))
  32149. return a;
  32150. e[i + a] = s
  32151. }
  32152. return a
  32153. }
  32154. function b(e, t, i, n) {
  32155. return q(j(t, e.length - i), e, i, n)
  32156. }
  32157. function w(e, t, i, n) {
  32158. return q(Y(t), e, i, n)
  32159. }
  32160. function _(e, t, i, n) {
  32161. return w(e, t, i, n)
  32162. }
  32163. function T(e, t, i, n) {
  32164. return q(Z(t), e, i, n)
  32165. }
  32166. function x(e, t, i, n) {
  32167. return q(X(t, e.length - i), e, i, n)
  32168. }
  32169. function S(e, t, i) {
  32170. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32171. }
  32172. function M(e, t, i) {
  32173. i = Math.min(e.length, i);
  32174. for (var n = [], r = t; r < i; ) {
  32175. var o = e[r]
  32176. , a = null
  32177. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32178. if (r + s <= i) {
  32179. var l, c, h, u;
  32180. switch (s) {
  32181. case 1:
  32182. o < 128 && (a = o);
  32183. break;
  32184. case 2:
  32185. l = e[r + 1],
  32186. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32187. u > 127 && (a = u));
  32188. break;
  32189. case 3:
  32190. l = e[r + 1],
  32191. c = e[r + 2],
  32192. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32193. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32194. break;
  32195. case 4:
  32196. l = e[r + 1],
  32197. c = e[r + 2],
  32198. h = e[r + 3],
  32199. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32200. u > 65535 && u < 1114112 && (a = u))
  32201. }
  32202. }
  32203. null === a ? (a = 65533,
  32204. s = 1) : a > 65535 && (a -= 65536,
  32205. n.push(a >>> 10 & 1023 | 55296),
  32206. a = 56320 | 1023 & a),
  32207. n.push(a),
  32208. r += s
  32209. }
  32210. return R(n)
  32211. }
  32212. function R(e) {
  32213. var t = e.length;
  32214. if (t <= ee)
  32215. return String.fromCharCode.apply(String, e);
  32216. for (var i = "", n = 0; n < t; )
  32217. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32218. return i
  32219. }
  32220. function P(e, t, i) {
  32221. var n = "";
  32222. i = Math.min(e.length, i);
  32223. for (var r = t; r < i; ++r)
  32224. n += String.fromCharCode(127 & e[r]);
  32225. return n
  32226. }
  32227. function O(e, t, i) {
  32228. var n = "";
  32229. i = Math.min(e.length, i);
  32230. for (var r = t; r < i; ++r)
  32231. n += String.fromCharCode(e[r]);
  32232. return n
  32233. }
  32234. function L(e, t, i) {
  32235. var n = e.length;
  32236. (!t || t < 0) && (t = 0),
  32237. (!i || i < 0 || i > n) && (i = n);
  32238. for (var r = "", o = t; o < i; ++o)
  32239. r += W(e[o]);
  32240. return r
  32241. }
  32242. function D(e, t, i) {
  32243. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32244. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32245. return r
  32246. }
  32247. function N(e, t, i) {
  32248. if (e % 1 !== 0 || e < 0)
  32249. throw new RangeError("offset is not uint");
  32250. if (e + t > i)
  32251. throw new RangeError("Trying to access beyond buffer length")
  32252. }
  32253. function B(e, t, i, n, r, o) {
  32254. if (!a.isBuffer(e))
  32255. throw new TypeError('"buffer" argument must be a Buffer instance');
  32256. if (t > r || t < o)
  32257. throw new RangeError('"value" argument is out of bounds');
  32258. if (i + n > e.length)
  32259. throw new RangeError("Index out of range")
  32260. }
  32261. function F(e, t, i, n) {
  32262. t < 0 && (t = 65535 + t + 1);
  32263. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32264. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32265. }
  32266. function V(e, t, i, n) {
  32267. t < 0 && (t = 4294967295 + t + 1);
  32268. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32269. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32270. }
  32271. function U(e, t, i, n, r, o) {
  32272. if (i + n > e.length)
  32273. throw new RangeError("Index out of range");
  32274. if (i < 0)
  32275. throw new RangeError("Index out of range")
  32276. }
  32277. function k(e, t, i, n, r) {
  32278. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32279. J.write(e, t, i, n, 23, 4),
  32280. i + 4
  32281. }
  32282. function H(e, t, i, n, r) {
  32283. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32284. J.write(e, t, i, n, 52, 8),
  32285. i + 8
  32286. }
  32287. function G(e) {
  32288. if (e = z(e).replace(te, ""),
  32289. e.length < 2)
  32290. return "";
  32291. for (; e.length % 4 !== 0; )
  32292. e += "=";
  32293. return e
  32294. }
  32295. function z(e) {
  32296. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32297. }
  32298. function W(e) {
  32299. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32300. }
  32301. function j(e, t) {
  32302. t = t || 1 / 0;
  32303. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32304. if (i = e.charCodeAt(a),
  32305. i > 55295 && i < 57344) {
  32306. if (!r) {
  32307. if (i > 56319) {
  32308. (t -= 3) > -1 && o.push(239, 191, 189);
  32309. continue
  32310. }
  32311. if (a + 1 === n) {
  32312. (t -= 3) > -1 && o.push(239, 191, 189);
  32313. continue
  32314. }
  32315. r = i;
  32316. continue
  32317. }
  32318. if (i < 56320) {
  32319. (t -= 3) > -1 && o.push(239, 191, 189),
  32320. r = i;
  32321. continue
  32322. }
  32323. i = (r - 55296 << 10 | i - 56320) + 65536
  32324. } else
  32325. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32326. if (r = null,
  32327. i < 128) {
  32328. if ((t -= 1) < 0)
  32329. break;
  32330. o.push(i)
  32331. } else if (i < 2048) {
  32332. if ((t -= 2) < 0)
  32333. break;
  32334. o.push(i >> 6 | 192, 63 & i | 128)
  32335. } else if (i < 65536) {
  32336. if ((t -= 3) < 0)
  32337. break;
  32338. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32339. } else {
  32340. if (!(i < 1114112))
  32341. throw new Error("Invalid code point");
  32342. if ((t -= 4) < 0)
  32343. break;
  32344. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32345. }
  32346. }
  32347. return o
  32348. }
  32349. function Y(e) {
  32350. for (var t = [], i = 0; i < e.length; ++i)
  32351. t.push(255 & e.charCodeAt(i));
  32352. return t
  32353. }
  32354. function X(e, t) {
  32355. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32356. i = e.charCodeAt(a),
  32357. n = i >> 8,
  32358. r = i % 256,
  32359. o.push(r),
  32360. o.push(n);
  32361. return o
  32362. }
  32363. function Z(e) {
  32364. return Q.toByteArray(G(e))
  32365. }
  32366. function q(e, t, i, n) {
  32367. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32368. t[r + i] = e[r];
  32369. return r
  32370. }
  32371. function K(e) {
  32372. return e !== e
  32373. }
  32374. var Q = e("base64-js")
  32375. , J = e("ieee754")
  32376. , $ = e("isarray");
  32377. i.Buffer = a,
  32378. i.SlowBuffer = m,
  32379. i.INSPECT_MAX_BYTES = 50,
  32380. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32381. i.kMaxLength = r(),
  32382. a.poolSize = 8192,
  32383. a._augment = function(e) {
  32384. return e.__proto__ = a.prototype,
  32385. e
  32386. }
  32387. ,
  32388. a.from = function(e, t, i) {
  32389. return s(null, e, t, i)
  32390. }
  32391. ,
  32392. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32393. a.__proto__ = Uint8Array,
  32394. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32395. value: null,
  32396. configurable: !0
  32397. })),
  32398. a.alloc = function(e, t, i) {
  32399. return c(null, e, t, i)
  32400. }
  32401. ,
  32402. a.allocUnsafe = function(e) {
  32403. return h(null, e)
  32404. }
  32405. ,
  32406. a.allocUnsafeSlow = function(e) {
  32407. return h(null, e)
  32408. }
  32409. ,
  32410. a.isBuffer = function(e) {
  32411. return !(null == e || !e._isBuffer)
  32412. }
  32413. ,
  32414. a.compare = function(e, t) {
  32415. if (!a.isBuffer(e) || !a.isBuffer(t))
  32416. throw new TypeError("Arguments must be Buffers");
  32417. if (e === t)
  32418. return 0;
  32419. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32420. if (e[r] !== t[r]) {
  32421. i = e[r],
  32422. n = t[r];
  32423. break
  32424. }
  32425. return i < n ? -1 : n < i ? 1 : 0
  32426. }
  32427. ,
  32428. a.isEncoding = function(e) {
  32429. switch (String(e).toLowerCase()) {
  32430. case "hex":
  32431. case "utf8":
  32432. case "utf-8":
  32433. case "ascii":
  32434. case "latin1":
  32435. case "binary":
  32436. case "base64":
  32437. case "ucs2":
  32438. case "ucs-2":
  32439. case "utf16le":
  32440. case "utf-16le":
  32441. return !0;
  32442. default:
  32443. return !1
  32444. }
  32445. }
  32446. ,
  32447. a.concat = function(e, t) {
  32448. if (!$(e))
  32449. throw new TypeError('"list" argument must be an Array of Buffers');
  32450. if (0 === e.length)
  32451. return a.alloc(0);
  32452. var i;
  32453. if (void 0 === t)
  32454. for (t = 0,
  32455. i = 0; i < e.length; ++i)
  32456. t += e[i].length;
  32457. var n = a.allocUnsafe(t)
  32458. , r = 0;
  32459. for (i = 0; i < e.length; ++i) {
  32460. var o = e[i];
  32461. if (!a.isBuffer(o))
  32462. throw new TypeError('"list" argument must be an Array of Buffers');
  32463. o.copy(n, r),
  32464. r += o.length
  32465. }
  32466. return n
  32467. }
  32468. ,
  32469. a.byteLength = v,
  32470. a.prototype._isBuffer = !0,
  32471. a.prototype.swap16 = function() {
  32472. var e = this.length;
  32473. if (e % 2 !== 0)
  32474. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32475. for (var t = 0; t < e; t += 2)
  32476. y(this, t, t + 1);
  32477. return this
  32478. }
  32479. ,
  32480. a.prototype.swap32 = function() {
  32481. var e = this.length;
  32482. if (e % 4 !== 0)
  32483. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32484. for (var t = 0; t < e; t += 4)
  32485. y(this, t, t + 3),
  32486. y(this, t + 1, t + 2);
  32487. return this
  32488. }
  32489. ,
  32490. a.prototype.swap64 = function() {
  32491. var e = this.length;
  32492. if (e % 8 !== 0)
  32493. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32494. for (var t = 0; t < e; t += 8)
  32495. y(this, t, t + 7),
  32496. y(this, t + 1, t + 6),
  32497. y(this, t + 2, t + 5),
  32498. y(this, t + 3, t + 4);
  32499. return this
  32500. }
  32501. ,
  32502. a.prototype.toString = function() {
  32503. var e = 0 | this.length;
  32504. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32505. }
  32506. ,
  32507. a.prototype.equals = function(e) {
  32508. if (!a.isBuffer(e))
  32509. throw new TypeError("Argument must be a Buffer");
  32510. return this === e || 0 === a.compare(this, e)
  32511. }
  32512. ,
  32513. a.prototype.inspect = function() {
  32514. var e = ""
  32515. , t = i.INSPECT_MAX_BYTES;
  32516. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32517. this.length > t && (e += " ... ")),
  32518. "<Buffer " + e + ">"
  32519. }
  32520. ,
  32521. a.prototype.compare = function(e, t, i, n, r) {
  32522. if (!a.isBuffer(e))
  32523. throw new TypeError("Argument must be a Buffer");
  32524. if (void 0 === t && (t = 0),
  32525. void 0 === i && (i = e ? e.length : 0),
  32526. void 0 === n && (n = 0),
  32527. void 0 === r && (r = this.length),
  32528. t < 0 || i > e.length || n < 0 || r > this.length)
  32529. throw new RangeError("out of range index");
  32530. if (n >= r && t >= i)
  32531. return 0;
  32532. if (n >= r)
  32533. return -1;
  32534. if (t >= i)
  32535. return 1;
  32536. if (t >>>= 0,
  32537. i >>>= 0,
  32538. n >>>= 0,
  32539. r >>>= 0,
  32540. this === e)
  32541. return 0;
  32542. 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)
  32543. if (c[u] !== h[u]) {
  32544. o = c[u],
  32545. s = h[u];
  32546. break
  32547. }
  32548. return o < s ? -1 : s < o ? 1 : 0
  32549. }
  32550. ,
  32551. a.prototype.includes = function(e, t, i) {
  32552. return this.indexOf(e, t, i) !== -1
  32553. }
  32554. ,
  32555. a.prototype.indexOf = function(e, t, i) {
  32556. return C(this, e, t, i, !0)
  32557. }
  32558. ,
  32559. a.prototype.lastIndexOf = function(e, t, i) {
  32560. return C(this, e, t, i, !1)
  32561. }
  32562. ,
  32563. a.prototype.write = function(e, t, i, n) {
  32564. if (void 0 === t)
  32565. n = "utf8",
  32566. i = this.length,
  32567. t = 0;
  32568. else if (void 0 === i && "string" == typeof t)
  32569. n = t,
  32570. i = this.length,
  32571. t = 0;
  32572. else {
  32573. if (!isFinite(t))
  32574. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32575. t |= 0,
  32576. isFinite(i) ? (i |= 0,
  32577. void 0 === n && (n = "utf8")) : (n = i,
  32578. i = void 0)
  32579. }
  32580. var r = this.length - t;
  32581. if ((void 0 === i || i > r) && (i = r),
  32582. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32583. throw new RangeError("Attempt to write outside buffer bounds");
  32584. n || (n = "utf8");
  32585. for (var o = !1; ; )
  32586. switch (n) {
  32587. case "hex":
  32588. return E(this, e, t, i);
  32589. case "utf8":
  32590. case "utf-8":
  32591. return b(this, e, t, i);
  32592. case "ascii":
  32593. return w(this, e, t, i);
  32594. case "latin1":
  32595. case "binary":
  32596. return _(this, e, t, i);
  32597. case "base64":
  32598. return T(this, e, t, i);
  32599. case "ucs2":
  32600. case "ucs-2":
  32601. case "utf16le":
  32602. case "utf-16le":
  32603. return x(this, e, t, i);
  32604. default:
  32605. if (o)
  32606. throw new TypeError("Unknown encoding: " + n);
  32607. n = ("" + n).toLowerCase(),
  32608. o = !0
  32609. }
  32610. }
  32611. ,
  32612. a.prototype.toJSON = function() {
  32613. return {
  32614. type: "Buffer",
  32615. data: Array.prototype.slice.call(this._arr || this, 0)
  32616. }
  32617. }
  32618. ;
  32619. var ee = 4096;
  32620. a.prototype.slice = function(e, t) {
  32621. var i = this.length;
  32622. e = ~~e,
  32623. t = void 0 === t ? i : ~~t,
  32624. e < 0 ? (e += i,
  32625. e < 0 && (e = 0)) : e > i && (e = i),
  32626. t < 0 ? (t += i,
  32627. t < 0 && (t = 0)) : t > i && (t = i),
  32628. t < e && (t = e);
  32629. var n;
  32630. if (a.TYPED_ARRAY_SUPPORT)
  32631. n = this.subarray(e, t),
  32632. n.__proto__ = a.prototype;
  32633. else {
  32634. var r = t - e;
  32635. n = new a(r,void 0);
  32636. for (var o = 0; o < r; ++o)
  32637. n[o] = this[o + e]
  32638. }
  32639. return n
  32640. }
  32641. ,
  32642. a.prototype.readUIntLE = function(e, t, i) {
  32643. e |= 0,
  32644. t |= 0,
  32645. i || N(e, t, this.length);
  32646. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32647. n += this[e + o] * r;
  32648. return n
  32649. }
  32650. ,
  32651. a.prototype.readUIntBE = function(e, t, i) {
  32652. e |= 0,
  32653. t |= 0,
  32654. i || N(e, t, this.length);
  32655. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32656. n += this[e + --t] * r;
  32657. return n
  32658. }
  32659. ,
  32660. a.prototype.readUInt8 = function(e, t) {
  32661. return t || N(e, 1, this.length),
  32662. this[e]
  32663. }
  32664. ,
  32665. a.prototype.readUInt16LE = function(e, t) {
  32666. return t || N(e, 2, this.length),
  32667. this[e] | this[e + 1] << 8
  32668. }
  32669. ,
  32670. a.prototype.readUInt16BE = function(e, t) {
  32671. return t || N(e, 2, this.length),
  32672. this[e] << 8 | this[e + 1]
  32673. }
  32674. ,
  32675. a.prototype.readUInt32LE = function(e, t) {
  32676. return t || N(e, 4, this.length),
  32677. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32678. }
  32679. ,
  32680. a.prototype.readUInt32BE = function(e, t) {
  32681. return t || N(e, 4, this.length),
  32682. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32683. }
  32684. ,
  32685. a.prototype.readIntLE = function(e, t, i) {
  32686. e |= 0,
  32687. t |= 0,
  32688. i || N(e, t, this.length);
  32689. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32690. n += this[e + o] * r;
  32691. return r *= 128,
  32692. n >= r && (n -= Math.pow(2, 8 * t)),
  32693. n
  32694. }
  32695. ,
  32696. a.prototype.readIntBE = function(e, t, i) {
  32697. e |= 0,
  32698. t |= 0,
  32699. i || N(e, t, this.length);
  32700. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32701. o += this[e + --n] * r;
  32702. return r *= 128,
  32703. o >= r && (o -= Math.pow(2, 8 * t)),
  32704. o
  32705. }
  32706. ,
  32707. a.prototype.readInt8 = function(e, t) {
  32708. return t || N(e, 1, this.length),
  32709. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32710. }
  32711. ,
  32712. a.prototype.readInt16LE = function(e, t) {
  32713. t || N(e, 2, this.length);
  32714. var i = this[e] | this[e + 1] << 8;
  32715. return 32768 & i ? 4294901760 | i : i
  32716. }
  32717. ,
  32718. a.prototype.readInt16BE = function(e, t) {
  32719. t || N(e, 2, this.length);
  32720. var i = this[e + 1] | this[e] << 8;
  32721. return 32768 & i ? 4294901760 | i : i
  32722. }
  32723. ,
  32724. a.prototype.readInt32LE = function(e, t) {
  32725. return t || N(e, 4, this.length),
  32726. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32727. }
  32728. ,
  32729. a.prototype.readInt32BE = function(e, t) {
  32730. return t || N(e, 4, this.length),
  32731. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32732. }
  32733. ,
  32734. a.prototype.readFloatLE = function(e, t) {
  32735. return t || N(e, 4, this.length),
  32736. J.read(this, e, !0, 23, 4)
  32737. }
  32738. ,
  32739. a.prototype.readFloatBE = function(e, t) {
  32740. return t || N(e, 4, this.length),
  32741. J.read(this, e, !1, 23, 4)
  32742. }
  32743. ,
  32744. a.prototype.readDoubleLE = function(e, t) {
  32745. return t || N(e, 8, this.length),
  32746. J.read(this, e, !0, 52, 8)
  32747. }
  32748. ,
  32749. a.prototype.readDoubleBE = function(e, t) {
  32750. return t || N(e, 8, this.length),
  32751. J.read(this, e, !1, 52, 8)
  32752. }
  32753. ,
  32754. a.prototype.writeUIntLE = function(e, t, i, n) {
  32755. if (e = +e,
  32756. t |= 0,
  32757. i |= 0,
  32758. !n) {
  32759. var r = Math.pow(2, 8 * i) - 1;
  32760. B(this, e, t, i, r, 0)
  32761. }
  32762. var o = 1
  32763. , a = 0;
  32764. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32765. this[t + a] = e / o & 255;
  32766. return t + i
  32767. }
  32768. ,
  32769. a.prototype.writeUIntBE = function(e, t, i, n) {
  32770. if (e = +e,
  32771. t |= 0,
  32772. i |= 0,
  32773. !n) {
  32774. var r = Math.pow(2, 8 * i) - 1;
  32775. B(this, e, t, i, r, 0)
  32776. }
  32777. var o = i - 1
  32778. , a = 1;
  32779. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32780. this[t + o] = e / a & 255;
  32781. return t + i
  32782. }
  32783. ,
  32784. a.prototype.writeUInt8 = function(e, t, i) {
  32785. return e = +e,
  32786. t |= 0,
  32787. i || B(this, e, t, 1, 255, 0),
  32788. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32789. this[t] = 255 & e,
  32790. t + 1
  32791. }
  32792. ,
  32793. a.prototype.writeUInt16LE = function(e, t, i) {
  32794. return e = +e,
  32795. t |= 0,
  32796. i || B(this, e, t, 2, 65535, 0),
  32797. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32798. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32799. t + 2
  32800. }
  32801. ,
  32802. a.prototype.writeUInt16BE = function(e, t, i) {
  32803. return e = +e,
  32804. t |= 0,
  32805. i || B(this, e, t, 2, 65535, 0),
  32806. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32807. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32808. t + 2
  32809. }
  32810. ,
  32811. a.prototype.writeUInt32LE = function(e, t, i) {
  32812. return e = +e,
  32813. t |= 0,
  32814. i || B(this, e, t, 4, 4294967295, 0),
  32815. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32816. this[t + 2] = e >>> 16,
  32817. this[t + 1] = e >>> 8,
  32818. this[t] = 255 & e) : V(this, e, t, !0),
  32819. t + 4
  32820. }
  32821. ,
  32822. a.prototype.writeUInt32BE = function(e, t, i) {
  32823. return e = +e,
  32824. t |= 0,
  32825. i || B(this, e, t, 4, 4294967295, 0),
  32826. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32827. this[t + 1] = e >>> 16,
  32828. this[t + 2] = e >>> 8,
  32829. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32830. t + 4
  32831. }
  32832. ,
  32833. a.prototype.writeIntLE = function(e, t, i, n) {
  32834. if (e = +e,
  32835. t |= 0,
  32836. !n) {
  32837. var r = Math.pow(2, 8 * i - 1);
  32838. B(this, e, t, i, r - 1, -r)
  32839. }
  32840. var o = 0
  32841. , a = 1
  32842. , s = 0;
  32843. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32844. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32845. this[t + o] = (e / a >> 0) - s & 255;
  32846. return t + i
  32847. }
  32848. ,
  32849. a.prototype.writeIntBE = function(e, t, i, n) {
  32850. if (e = +e,
  32851. t |= 0,
  32852. !n) {
  32853. var r = Math.pow(2, 8 * i - 1);
  32854. B(this, e, t, i, r - 1, -r)
  32855. }
  32856. var o = i - 1
  32857. , a = 1
  32858. , s = 0;
  32859. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32860. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32861. this[t + o] = (e / a >> 0) - s & 255;
  32862. return t + i
  32863. }
  32864. ,
  32865. a.prototype.writeInt8 = function(e, t, i) {
  32866. return e = +e,
  32867. t |= 0,
  32868. i || B(this, e, t, 1, 127, -128),
  32869. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32870. e < 0 && (e = 255 + e + 1),
  32871. this[t] = 255 & e,
  32872. t + 1
  32873. }
  32874. ,
  32875. a.prototype.writeInt16LE = function(e, t, i) {
  32876. return e = +e,
  32877. t |= 0,
  32878. i || B(this, e, t, 2, 32767, -32768),
  32879. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32880. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32881. t + 2
  32882. }
  32883. ,
  32884. a.prototype.writeInt16BE = function(e, t, i) {
  32885. return e = +e,
  32886. t |= 0,
  32887. i || B(this, e, t, 2, 32767, -32768),
  32888. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32889. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32890. t + 2
  32891. }
  32892. ,
  32893. a.prototype.writeInt32LE = function(e, t, i) {
  32894. return e = +e,
  32895. t |= 0,
  32896. i || B(this, e, t, 4, 2147483647, -2147483648),
  32897. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32898. this[t + 1] = e >>> 8,
  32899. this[t + 2] = e >>> 16,
  32900. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32901. t + 4
  32902. }
  32903. ,
  32904. a.prototype.writeInt32BE = function(e, t, i) {
  32905. return e = +e,
  32906. t |= 0,
  32907. i || B(this, e, t, 4, 2147483647, -2147483648),
  32908. e < 0 && (e = 4294967295 + e + 1),
  32909. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32910. this[t + 1] = e >>> 16,
  32911. this[t + 2] = e >>> 8,
  32912. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32913. t + 4
  32914. }
  32915. ,
  32916. a.prototype.writeFloatLE = function(e, t, i) {
  32917. return k(this, e, t, !0, i)
  32918. }
  32919. ,
  32920. a.prototype.writeFloatBE = function(e, t, i) {
  32921. return k(this, e, t, !1, i)
  32922. }
  32923. ,
  32924. a.prototype.writeDoubleLE = function(e, t, i) {
  32925. return H(this, e, t, !0, i)
  32926. }
  32927. ,
  32928. a.prototype.writeDoubleBE = function(e, t, i) {
  32929. return H(this, e, t, !1, i)
  32930. }
  32931. ,
  32932. a.prototype.copy = function(e, t, i, n) {
  32933. if (i || (i = 0),
  32934. n || 0 === n || (n = this.length),
  32935. t >= e.length && (t = e.length),
  32936. t || (t = 0),
  32937. n > 0 && n < i && (n = i),
  32938. n === i)
  32939. return 0;
  32940. if (0 === e.length || 0 === this.length)
  32941. return 0;
  32942. if (t < 0)
  32943. throw new RangeError("targetStart out of bounds");
  32944. if (i < 0 || i >= this.length)
  32945. throw new RangeError("sourceStart out of bounds");
  32946. if (n < 0)
  32947. throw new RangeError("sourceEnd out of bounds");
  32948. n > this.length && (n = this.length),
  32949. e.length - t < n - i && (n = e.length - t + i);
  32950. var r, o = n - i;
  32951. if (this === e && i < t && t < n)
  32952. for (r = o - 1; r >= 0; --r)
  32953. e[r + t] = this[r + i];
  32954. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32955. for (r = 0; r < o; ++r)
  32956. e[r + t] = this[r + i];
  32957. else
  32958. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32959. return o
  32960. }
  32961. ,
  32962. a.prototype.fill = function(e, t, i, n) {
  32963. if ("string" == typeof e) {
  32964. if ("string" == typeof t ? (n = t,
  32965. t = 0,
  32966. i = this.length) : "string" == typeof i && (n = i,
  32967. i = this.length),
  32968. 1 === e.length) {
  32969. var r = e.charCodeAt(0);
  32970. r < 256 && (e = r)
  32971. }
  32972. if (void 0 !== n && "string" != typeof n)
  32973. throw new TypeError("encoding must be a string");
  32974. if ("string" == typeof n && !a.isEncoding(n))
  32975. throw new TypeError("Unknown encoding: " + n)
  32976. } else
  32977. "number" == typeof e && (e &= 255);
  32978. if (t < 0 || this.length < t || this.length < i)
  32979. throw new RangeError("Out of range index");
  32980. if (i <= t)
  32981. return this;
  32982. t >>>= 0,
  32983. i = void 0 === i ? this.length : i >>> 0,
  32984. e || (e = 0);
  32985. var o;
  32986. if ("number" == typeof e)
  32987. for (o = t; o < i; ++o)
  32988. this[o] = e;
  32989. else {
  32990. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32991. , l = s.length;
  32992. for (o = 0; o < i - t; ++o)
  32993. this[o + t] = s[o % l]
  32994. }
  32995. return this
  32996. }
  32997. ;
  32998. var te = /[^+\/0-9A-Za-z-_]/g
  32999. }
  33000. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33001. }
  33002. , {
  33003. "base64-js": 199,
  33004. ieee754: 200,
  33005. isarray: 201
  33006. }],
  33007. 199: [function(e, t, i) {
  33008. "use strict";
  33009. function n(e) {
  33010. var t = e.length;
  33011. if (t % 4 > 0)
  33012. throw new Error("Invalid string. Length must be a multiple of 4");
  33013. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33014. }
  33015. function r(e) {
  33016. return 3 * e.length / 4 - n(e)
  33017. }
  33018. function o(e) {
  33019. var t, i, r, o, a, s, l = e.length;
  33020. a = n(e),
  33021. s = new u(3 * l / 4 - a),
  33022. r = a > 0 ? l - 4 : l;
  33023. var c = 0;
  33024. for (t = 0,
  33025. i = 0; t < r; t += 4,
  33026. i += 3)
  33027. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33028. s[c++] = o >> 16 & 255,
  33029. s[c++] = o >> 8 & 255,
  33030. s[c++] = 255 & o;
  33031. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33032. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33033. s[c++] = o >> 8 & 255,
  33034. s[c++] = 255 & o),
  33035. s
  33036. }
  33037. function a(e) {
  33038. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33039. }
  33040. function s(e, t, i) {
  33041. for (var n, r = [], o = t; o < i; o += 3)
  33042. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33043. r.push(a(n));
  33044. return r.join("")
  33045. }
  33046. function l(e) {
  33047. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33048. o.push(s(e, l, l + a > h ? h : l + a));
  33049. return 1 === n ? (t = e[i - 1],
  33050. r += c[t >> 2],
  33051. r += c[t << 4 & 63],
  33052. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33053. r += c[t >> 10],
  33054. r += c[t >> 4 & 63],
  33055. r += c[t << 2 & 63],
  33056. r += "="),
  33057. o.push(r),
  33058. o.join("")
  33059. }
  33060. i.byteLength = r,
  33061. i.toByteArray = o,
  33062. i.fromByteArray = l;
  33063. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33064. c[p] = d[p],
  33065. h[d.charCodeAt(p)] = p;
  33066. h["-".charCodeAt(0)] = 62,
  33067. h["_".charCodeAt(0)] = 63
  33068. }
  33069. , {}],
  33070. 200: [function(e, t, i) {
  33071. i.read = function(e, t, i, n, r) {
  33072. 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];
  33073. for (u += d,
  33074. o = p & (1 << -h) - 1,
  33075. p >>= -h,
  33076. h += s; h > 0; o = 256 * o + e[t + u],
  33077. u += d,
  33078. h -= 8)
  33079. ;
  33080. for (a = o & (1 << -h) - 1,
  33081. o >>= -h,
  33082. h += n; h > 0; a = 256 * a + e[t + u],
  33083. u += d,
  33084. h -= 8)
  33085. ;
  33086. if (0 === o)
  33087. o = 1 - c;
  33088. else {
  33089. if (o === l)
  33090. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33091. a += Math.pow(2, n),
  33092. o -= c
  33093. }
  33094. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33095. }
  33096. ,
  33097. i.write = function(e, t, i, n, r, o) {
  33098. 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;
  33099. for (t = Math.abs(t),
  33100. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33101. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33102. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33103. l *= 2),
  33104. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33105. t * l >= 2 && (a++,
  33106. l /= 2),
  33107. a + u >= h ? (s = 0,
  33108. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33109. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33110. a = 0)); r >= 8; e[i + p] = 255 & s,
  33111. p += f,
  33112. s /= 256,
  33113. r -= 8)
  33114. ;
  33115. for (a = a << r | s,
  33116. c += r; c > 0; e[i + p] = 255 & a,
  33117. p += f,
  33118. a /= 256,
  33119. c -= 8)
  33120. ;
  33121. e[i + p - f] |= 128 * g
  33122. }
  33123. }
  33124. , {}],
  33125. 201: [function(e, t, i) {
  33126. var n = {}.toString;
  33127. t.exports = Array.isArray || function(e) {
  33128. return "[object Array]" == n.call(e)
  33129. }
  33130. }
  33131. , {}],
  33132. 202: [function(e, t, i) {
  33133. function n() {
  33134. this._events = this._events || {},
  33135. this._maxListeners = this._maxListeners || void 0
  33136. }
  33137. function r(e) {
  33138. return "function" == typeof e
  33139. }
  33140. function o(e) {
  33141. return "number" == typeof e
  33142. }
  33143. function a(e) {
  33144. return "object" == typeof e && null !== e
  33145. }
  33146. function s(e) {
  33147. return void 0 === e
  33148. }
  33149. t.exports = n,
  33150. n.EventEmitter = n,
  33151. n.prototype._events = void 0,
  33152. n.prototype._maxListeners = void 0,
  33153. n.defaultMaxListeners = 10,
  33154. n.prototype.setMaxListeners = function(e) {
  33155. if (!o(e) || e < 0 || isNaN(e))
  33156. throw TypeError("n must be a positive number");
  33157. return this._maxListeners = e,
  33158. this
  33159. }
  33160. ,
  33161. n.prototype.emit = function(e) {
  33162. var t, i, n, o, l, c;
  33163. if (this._events || (this._events = {}),
  33164. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33165. if (t = arguments[1],
  33166. t instanceof Error)
  33167. throw t;
  33168. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33169. throw h.context = t,
  33170. h
  33171. }
  33172. if (i = this._events[e],
  33173. s(i))
  33174. return !1;
  33175. if (r(i))
  33176. switch (arguments.length) {
  33177. case 1:
  33178. i.call(this);
  33179. break;
  33180. case 2:
  33181. i.call(this, arguments[1]);
  33182. break;
  33183. case 3:
  33184. i.call(this, arguments[1], arguments[2]);
  33185. break;
  33186. default:
  33187. o = Array.prototype.slice.call(arguments, 1),
  33188. i.apply(this, o)
  33189. }
  33190. else if (a(i))
  33191. for (o = Array.prototype.slice.call(arguments, 1),
  33192. c = i.slice(),
  33193. n = c.length,
  33194. l = 0; l < n; l++)
  33195. c[l].apply(this, o);
  33196. return !0
  33197. }
  33198. ,
  33199. n.prototype.addListener = function(e, t) {
  33200. var i;
  33201. if (!r(t))
  33202. throw TypeError("listener must be a function");
  33203. return this._events || (this._events = {}),
  33204. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33205. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33206. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33207. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33208. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33209. "function" == typeof console.trace && console.trace())),
  33210. this
  33211. }
  33212. ,
  33213. n.prototype.on = n.prototype.addListener,
  33214. n.prototype.once = function(e, t) {
  33215. function i() {
  33216. this.removeListener(e, i),
  33217. n || (n = !0,
  33218. t.apply(this, arguments))
  33219. }
  33220. if (!r(t))
  33221. throw TypeError("listener must be a function");
  33222. var n = !1;
  33223. return i.listener = t,
  33224. this.on(e, i),
  33225. this
  33226. }
  33227. ,
  33228. n.prototype.removeListener = function(e, t) {
  33229. var i, n, o, s;
  33230. if (!r(t))
  33231. throw TypeError("listener must be a function");
  33232. if (!this._events || !this._events[e])
  33233. return this;
  33234. if (i = this._events[e],
  33235. o = i.length,
  33236. n = -1,
  33237. i === t || r(i.listener) && i.listener === t)
  33238. delete this._events[e],
  33239. this._events.removeListener && this.emit("removeListener", e, t);
  33240. else if (a(i)) {
  33241. for (s = o; s-- > 0; )
  33242. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33243. n = s;
  33244. break
  33245. }
  33246. if (n < 0)
  33247. return this;
  33248. 1 === i.length ? (i.length = 0,
  33249. delete this._events[e]) : i.splice(n, 1),
  33250. this._events.removeListener && this.emit("removeListener", e, t)
  33251. }
  33252. return this
  33253. }
  33254. ,
  33255. n.prototype.removeAllListeners = function(e) {
  33256. var t, i;
  33257. if (!this._events)
  33258. return this;
  33259. if (!this._events.removeListener)
  33260. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33261. this;
  33262. if (0 === arguments.length) {
  33263. for (t in this._events)
  33264. "removeListener" !== t && this.removeAllListeners(t);
  33265. return this.removeAllListeners("removeListener"),
  33266. this._events = {},
  33267. this
  33268. }
  33269. if (i = this._events[e],
  33270. r(i))
  33271. this.removeListener(e, i);
  33272. else if (i)
  33273. for (; i.length; )
  33274. this.removeListener(e, i[i.length - 1]);
  33275. return delete this._events[e],
  33276. this
  33277. }
  33278. ,
  33279. n.prototype.listeners = function(e) {
  33280. var t;
  33281. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33282. }
  33283. ,
  33284. n.prototype.listenerCount = function(e) {
  33285. if (this._events) {
  33286. var t = this._events[e];
  33287. if (r(t))
  33288. return 1;
  33289. if (t)
  33290. return t.length
  33291. }
  33292. return 0
  33293. }
  33294. ,
  33295. n.listenerCount = function(e, t) {
  33296. return e.listenerCount(t)
  33297. }
  33298. }
  33299. , {}],
  33300. 203: [function(e, t, i) {
  33301. function n() {
  33302. throw new Error("setTimeout has not been defined")
  33303. }
  33304. function r() {
  33305. throw new Error("clearTimeout has not been defined")
  33306. }
  33307. function o(e) {
  33308. if (u === setTimeout)
  33309. return setTimeout(e, 0);
  33310. if ((u === n || !u) && setTimeout)
  33311. return u = setTimeout,
  33312. setTimeout(e, 0);
  33313. try {
  33314. return u(e, 0)
  33315. } catch (t) {
  33316. try {
  33317. return u.call(null, e, 0)
  33318. } catch (t) {
  33319. return u.call(this, e, 0)
  33320. }
  33321. }
  33322. }
  33323. function a(e) {
  33324. if (d === clearTimeout)
  33325. return clearTimeout(e);
  33326. if ((d === r || !d) && clearTimeout)
  33327. return d = clearTimeout,
  33328. clearTimeout(e);
  33329. try {
  33330. return d(e)
  33331. } catch (t) {
  33332. try {
  33333. return d.call(null, e)
  33334. } catch (t) {
  33335. return d.call(this, e)
  33336. }
  33337. }
  33338. }
  33339. function s() {
  33340. m && f && (m = !1,
  33341. f.length ? g = f.concat(g) : v = -1,
  33342. g.length && l())
  33343. }
  33344. function l() {
  33345. if (!m) {
  33346. var e = o(s);
  33347. m = !0;
  33348. for (var t = g.length; t; ) {
  33349. for (f = g,
  33350. g = []; ++v < t; )
  33351. f && f[v].run();
  33352. v = -1,
  33353. t = g.length
  33354. }
  33355. f = null,
  33356. m = !1,
  33357. a(e)
  33358. }
  33359. }
  33360. function c(e, t) {
  33361. this.fun = e,
  33362. this.array = t
  33363. }
  33364. function h() {}
  33365. var u, d, p = t.exports = {};
  33366. !function() {
  33367. try {
  33368. u = "function" == typeof setTimeout ? setTimeout : n
  33369. } catch (e) {
  33370. u = n
  33371. }
  33372. try {
  33373. d = "function" == typeof clearTimeout ? clearTimeout : r
  33374. } catch (e) {
  33375. d = r
  33376. }
  33377. }();
  33378. var f, g = [], m = !1, v = -1;
  33379. p.nextTick = function(e) {
  33380. var t = new Array(arguments.length - 1);
  33381. if (arguments.length > 1)
  33382. for (var i = 1; i < arguments.length; i++)
  33383. t[i - 1] = arguments[i];
  33384. g.push(new c(e,t)),
  33385. 1 !== g.length || m || o(l)
  33386. }
  33387. ,
  33388. c.prototype.run = function() {
  33389. this.fun.apply(null, this.array)
  33390. }
  33391. ,
  33392. p.title = "browser",
  33393. p.browser = !0,
  33394. p.env = {},
  33395. p.argv = [],
  33396. p.version = "",
  33397. p.versions = {},
  33398. p.on = h,
  33399. p.addListener = h,
  33400. p.once = h,
  33401. p.off = h,
  33402. p.removeListener = h,
  33403. p.removeAllListeners = h,
  33404. p.emit = h,
  33405. p.binding = function(e) {
  33406. throw new Error("process.binding is not supported")
  33407. }
  33408. ,
  33409. p.cwd = function() {
  33410. return "/"
  33411. }
  33412. ,
  33413. p.chdir = function(e) {
  33414. throw new Error("process.chdir is not supported")
  33415. }
  33416. ,
  33417. p.umask = function() {
  33418. return 0
  33419. }
  33420. }
  33421. , {}],
  33422. 204: [function(e, t, i) {
  33423. (function(e) {
  33424. !function(n) {
  33425. function r(e) {
  33426. throw new RangeError(L[e])
  33427. }
  33428. function o(e, t) {
  33429. for (var i = e.length, n = []; i--; )
  33430. n[i] = t(e[i]);
  33431. return n
  33432. }
  33433. function a(e, t) {
  33434. var i = e.split("@")
  33435. , n = "";
  33436. i.length > 1 && (n = i[0] + "@",
  33437. e = i[1]),
  33438. e = e.replace(O, ".");
  33439. var r = e.split(".")
  33440. , a = o(r, t).join(".");
  33441. return n + a
  33442. }
  33443. function s(e) {
  33444. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33445. t = e.charCodeAt(r++),
  33446. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33447. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33448. r--)) : n.push(t);
  33449. return n
  33450. }
  33451. function l(e) {
  33452. return o(e, function(e) {
  33453. var t = "";
  33454. return e > 65535 && (e -= 65536,
  33455. t += B(e >>> 10 & 1023 | 55296),
  33456. e = 56320 | 1023 & e),
  33457. t += B(e)
  33458. }).join("")
  33459. }
  33460. function c(e) {
  33461. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33462. }
  33463. function h(e, t) {
  33464. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33465. }
  33466. function u(e, t, i) {
  33467. var n = 0;
  33468. for (e = i ? N(e / T) : e >> 1,
  33469. e += N(e / t); e > D * w >> 1; n += E)
  33470. e = N(e / D);
  33471. return N(n + (D + 1) * e / (e + _))
  33472. }
  33473. function d(e) {
  33474. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33475. for (i = e.lastIndexOf(M),
  33476. i < 0 && (i = 0),
  33477. n = 0; n < i; ++n)
  33478. e.charCodeAt(n) >= 128 && r("not-basic"),
  33479. g.push(e.charCodeAt(n));
  33480. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33481. for (a = v,
  33482. s = 1,
  33483. h = E; o >= m && r("invalid-input"),
  33484. d = c(e.charCodeAt(o++)),
  33485. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33486. v += d * s,
  33487. p = h <= y ? b : h >= y + w ? w : h - y,
  33488. !(d < p); h += E)
  33489. f = E - p,
  33490. s > N(I / f) && r("overflow"),
  33491. s *= f;
  33492. t = g.length + 1,
  33493. y = u(v - a, t, 0 == a),
  33494. N(v / t) > I - A && r("overflow"),
  33495. A += N(v / t),
  33496. v %= t,
  33497. g.splice(v++, 0, A)
  33498. }
  33499. return l(g)
  33500. }
  33501. function p(e) {
  33502. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33503. for (e = s(e),
  33504. m = e.length,
  33505. t = S,
  33506. i = 0,
  33507. a = x,
  33508. l = 0; l < m; ++l)
  33509. g = e[l],
  33510. g < 128 && C.push(B(g));
  33511. for (n = o = C.length,
  33512. o && C.push(M); n < m; ) {
  33513. for (c = I,
  33514. l = 0; l < m; ++l)
  33515. g = e[l],
  33516. g >= t && g < c && (c = g);
  33517. for (v = n + 1,
  33518. c - t > N((I - i) / v) && r("overflow"),
  33519. i += (c - t) * v,
  33520. t = c,
  33521. l = 0; l < m; ++l)
  33522. if (g = e[l],
  33523. g < t && ++i > I && r("overflow"),
  33524. g == t) {
  33525. for (d = i,
  33526. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33527. !(d < f); p += E)
  33528. y = d - f,
  33529. A = E - f,
  33530. C.push(B(h(f + y % A, 0))),
  33531. d = N(y / A);
  33532. C.push(B(h(d, 0))),
  33533. a = u(i, v, n == o),
  33534. i = 0,
  33535. ++n
  33536. }
  33537. ++i,
  33538. ++t
  33539. }
  33540. return C.join("")
  33541. }
  33542. function f(e) {
  33543. return a(e, function(e) {
  33544. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33545. })
  33546. }
  33547. function g(e) {
  33548. return a(e, function(e) {
  33549. return P.test(e) ? "xn--" + p(e) : e
  33550. })
  33551. }
  33552. var m = "object" == typeof i && i && !i.nodeType && i
  33553. , v = "object" == typeof t && t && !t.nodeType && t
  33554. , A = "object" == typeof e && e;
  33555. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33556. 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 = {
  33557. overflow: "Overflow: input needs wider integers to process",
  33558. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33559. "invalid-input": "Invalid input"
  33560. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33561. if (y = {
  33562. version: "1.4.1",
  33563. ucs2: {
  33564. decode: s,
  33565. encode: l
  33566. },
  33567. decode: d,
  33568. encode: p,
  33569. toASCII: g,
  33570. toUnicode: f
  33571. },
  33572. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33573. define("punycode", function() {
  33574. return y
  33575. });
  33576. else if (m && v)
  33577. if (t.exports == m)
  33578. v.exports = y;
  33579. else
  33580. for (C in y)
  33581. y.hasOwnProperty(C) && (m[C] = y[C]);
  33582. else
  33583. n.punycode = y
  33584. }(this)
  33585. }
  33586. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33587. }
  33588. , {}],
  33589. 205: [function(e, t, i) {
  33590. "use strict";
  33591. function n(e, t) {
  33592. return Object.prototype.hasOwnProperty.call(e, t)
  33593. }
  33594. t.exports = function(e, t, i, o) {
  33595. t = t || "&",
  33596. i = i || "=";
  33597. var a = {};
  33598. if ("string" != typeof e || 0 === e.length)
  33599. return a;
  33600. var s = /\+/g;
  33601. e = e.split(t);
  33602. var l = 1e3;
  33603. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33604. var c = e.length;
  33605. l > 0 && c > l && (c = l);
  33606. for (var h = 0; h < c; ++h) {
  33607. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33608. m >= 0 ? (u = g.substr(0, m),
  33609. d = g.substr(m + 1)) : (u = g,
  33610. d = ""),
  33611. p = decodeURIComponent(u),
  33612. f = decodeURIComponent(d),
  33613. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33614. }
  33615. return a
  33616. }
  33617. ;
  33618. var r = Array.isArray || function(e) {
  33619. return "[object Array]" === Object.prototype.toString.call(e)
  33620. }
  33621. }
  33622. , {}],
  33623. 206: [function(e, t, i) {
  33624. "use strict";
  33625. function n(e, t) {
  33626. if (e.map)
  33627. return e.map(t);
  33628. for (var i = [], n = 0; n < e.length; n++)
  33629. i.push(t(e[n], n));
  33630. return i
  33631. }
  33632. var r = function(e) {
  33633. switch (typeof e) {
  33634. case "string":
  33635. return e;
  33636. case "boolean":
  33637. return e ? "true" : "false";
  33638. case "number":
  33639. return isFinite(e) ? e : "";
  33640. default:
  33641. return ""
  33642. }
  33643. };
  33644. t.exports = function(e, t, i, s) {
  33645. return t = t || "&",
  33646. i = i || "=",
  33647. null === e && (e = void 0),
  33648. "object" == typeof e ? n(a(e), function(a) {
  33649. var s = encodeURIComponent(r(a)) + i;
  33650. return o(e[a]) ? n(e[a], function(e) {
  33651. return s + encodeURIComponent(r(e))
  33652. }).join(t) : s + encodeURIComponent(r(e[a]))
  33653. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33654. }
  33655. ;
  33656. var o = Array.isArray || function(e) {
  33657. return "[object Array]" === Object.prototype.toString.call(e)
  33658. }
  33659. , a = Object.keys || function(e) {
  33660. var t = [];
  33661. for (var i in e)
  33662. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33663. return t
  33664. }
  33665. }
  33666. , {}],
  33667. 207: [function(e, t, i) {
  33668. "use strict";
  33669. i.decode = i.parse = e("./decode"),
  33670. i.encode = i.stringify = e("./encode")
  33671. }
  33672. , {
  33673. "./decode": 205,
  33674. "./encode": 206
  33675. }],
  33676. 208: [function(e, t, i) {
  33677. "use strict";
  33678. function n() {
  33679. this.protocol = null,
  33680. this.slashes = null,
  33681. this.auth = null,
  33682. this.host = null,
  33683. this.port = null,
  33684. this.hostname = null,
  33685. this.hash = null,
  33686. this.search = null,
  33687. this.query = null,
  33688. this.pathname = null,
  33689. this.path = null,
  33690. this.href = null
  33691. }
  33692. function r(e, t, i) {
  33693. if (e && c.isObject(e) && e instanceof n)
  33694. return e;
  33695. var r = new n;
  33696. return r.parse(e, t, i),
  33697. r
  33698. }
  33699. function o(e) {
  33700. return c.isString(e) && (e = r(e)),
  33701. e instanceof n ? e.format() : n.prototype.format.call(e)
  33702. }
  33703. function a(e, t) {
  33704. return r(e, !1, !0).resolve(t)
  33705. }
  33706. function s(e, t) {
  33707. return e ? r(e, !1, !0).resolveObject(t) : t
  33708. }
  33709. var l = e("punycode")
  33710. , c = e("./util");
  33711. i.parse = r,
  33712. i.resolve = a,
  33713. i.resolveObject = s,
  33714. i.format = o,
  33715. i.Url = n;
  33716. var h = /^([a-z0-9.+-]+:)/i
  33717. , u = /:[0-9]*$/
  33718. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33719. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33720. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33721. , g = ["'"].concat(f)
  33722. , m = ["%", "/", "?", ";", "#"].concat(g)
  33723. , v = ["/", "?", "#"]
  33724. , A = 255
  33725. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33726. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33727. , I = {
  33728. javascript: !0,
  33729. "javascript:": !0
  33730. }
  33731. , E = {
  33732. javascript: !0,
  33733. "javascript:": !0
  33734. }
  33735. , b = {
  33736. http: !0,
  33737. https: !0,
  33738. ftp: !0,
  33739. gopher: !0,
  33740. file: !0,
  33741. "http:": !0,
  33742. "https:": !0,
  33743. "ftp:": !0,
  33744. "gopher:": !0,
  33745. "file:": !0
  33746. }
  33747. , w = e("querystring");
  33748. n.prototype.parse = function(e, t, i) {
  33749. if (!c.isString(e))
  33750. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33751. var n = e.indexOf("?")
  33752. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33753. , o = e.split(r)
  33754. , a = /\\/g;
  33755. o[0] = o[0].replace(a, "/"),
  33756. e = o.join(r);
  33757. var s = e;
  33758. if (s = s.trim(),
  33759. !i && 1 === e.split("#").length) {
  33760. var u = d.exec(s);
  33761. if (u)
  33762. return this.path = s,
  33763. this.href = s,
  33764. this.pathname = u[1],
  33765. u[2] ? (this.search = u[2],
  33766. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33767. this.query = {}),
  33768. this
  33769. }
  33770. var p = h.exec(s);
  33771. if (p) {
  33772. p = p[0];
  33773. var f = p.toLowerCase();
  33774. this.protocol = f,
  33775. s = s.substr(p.length)
  33776. }
  33777. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33778. var _ = "//" === s.substr(0, 2);
  33779. !_ || p && E[p] || (s = s.substr(2),
  33780. this.slashes = !0)
  33781. }
  33782. if (!E[p] && (_ || p && !b[p])) {
  33783. for (var T = -1, x = 0; x < v.length; x++) {
  33784. var S = s.indexOf(v[x]);
  33785. S !== -1 && (T === -1 || S < T) && (T = S)
  33786. }
  33787. var M, R;
  33788. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33789. R !== -1 && (M = s.slice(0, R),
  33790. s = s.slice(R + 1),
  33791. this.auth = decodeURIComponent(M)),
  33792. T = -1;
  33793. for (var x = 0; x < m.length; x++) {
  33794. var S = s.indexOf(m[x]);
  33795. S !== -1 && (T === -1 || S < T) && (T = S)
  33796. }
  33797. T === -1 && (T = s.length),
  33798. this.host = s.slice(0, T),
  33799. s = s.slice(T),
  33800. this.parseHost(),
  33801. this.hostname = this.hostname || "";
  33802. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33803. if (!P)
  33804. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33805. var D = O[x];
  33806. if (D && !D.match(y)) {
  33807. for (var N = "", B = 0, F = D.length; B < F; B++)
  33808. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33809. if (!N.match(y)) {
  33810. var V = O.slice(0, x)
  33811. , U = O.slice(x + 1)
  33812. , k = D.match(C);
  33813. k && (V.push(k[1]),
  33814. U.unshift(k[2])),
  33815. U.length && (s = "/" + U.join(".") + s),
  33816. this.hostname = V.join(".");
  33817. break
  33818. }
  33819. }
  33820. }
  33821. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33822. P || (this.hostname = l.toASCII(this.hostname));
  33823. var H = this.port ? ":" + this.port : ""
  33824. , G = this.hostname || "";
  33825. this.host = G + H,
  33826. this.href += this.host,
  33827. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33828. "/" !== s[0] && (s = "/" + s))
  33829. }
  33830. if (!I[f])
  33831. for (var x = 0, L = g.length; x < L; x++) {
  33832. var z = g[x];
  33833. if (s.indexOf(z) !== -1) {
  33834. var W = encodeURIComponent(z);
  33835. W === z && (W = escape(z)),
  33836. s = s.split(z).join(W)
  33837. }
  33838. }
  33839. var j = s.indexOf("#");
  33840. j !== -1 && (this.hash = s.substr(j),
  33841. s = s.slice(0, j));
  33842. var Y = s.indexOf("?");
  33843. if (Y !== -1 ? (this.search = s.substr(Y),
  33844. this.query = s.substr(Y + 1),
  33845. t && (this.query = w.parse(this.query)),
  33846. s = s.slice(0, Y)) : t && (this.search = "",
  33847. this.query = {}),
  33848. s && (this.pathname = s),
  33849. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33850. this.pathname || this.search) {
  33851. var H = this.pathname || ""
  33852. , X = this.search || "";
  33853. this.path = H + X
  33854. }
  33855. return this.href = this.format(),
  33856. this
  33857. }
  33858. ,
  33859. n.prototype.format = function() {
  33860. var e = this.auth || "";
  33861. e && (e = encodeURIComponent(e),
  33862. e = e.replace(/%3A/i, ":"),
  33863. e += "@");
  33864. var t = this.protocol || ""
  33865. , i = this.pathname || ""
  33866. , n = this.hash || ""
  33867. , r = !1
  33868. , o = "";
  33869. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33870. this.port && (r += ":" + this.port)),
  33871. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33872. var a = this.search || o && "?" + o || "";
  33873. return t && ":" !== t.substr(-1) && (t += ":"),
  33874. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33875. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33876. n && "#" !== n.charAt(0) && (n = "#" + n),
  33877. a && "?" !== a.charAt(0) && (a = "?" + a),
  33878. i = i.replace(/[?#]/g, function(e) {
  33879. return encodeURIComponent(e)
  33880. }),
  33881. a = a.replace("#", "%23"),
  33882. t + r + i + a + n
  33883. }
  33884. ,
  33885. n.prototype.resolve = function(e) {
  33886. return this.resolveObject(r(e, !1, !0)).format()
  33887. }
  33888. ,
  33889. n.prototype.resolveObject = function(e) {
  33890. if (c.isString(e)) {
  33891. var t = new n;
  33892. t.parse(e, !1, !0),
  33893. e = t
  33894. }
  33895. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33896. var a = r[o];
  33897. i[a] = this[a]
  33898. }
  33899. if (i.hash = e.hash,
  33900. "" === e.href)
  33901. return i.href = i.format(),
  33902. i;
  33903. if (e.slashes && !e.protocol) {
  33904. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33905. var h = s[l];
  33906. "protocol" !== h && (i[h] = e[h])
  33907. }
  33908. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33909. i.href = i.format(),
  33910. i
  33911. }
  33912. if (e.protocol && e.protocol !== i.protocol) {
  33913. if (!b[e.protocol]) {
  33914. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33915. var p = u[d];
  33916. i[p] = e[p]
  33917. }
  33918. return i.href = i.format(),
  33919. i
  33920. }
  33921. if (i.protocol = e.protocol,
  33922. e.host || E[e.protocol])
  33923. i.pathname = e.pathname;
  33924. else {
  33925. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33926. ;
  33927. e.host || (e.host = ""),
  33928. e.hostname || (e.hostname = ""),
  33929. "" !== f[0] && f.unshift(""),
  33930. f.length < 2 && f.unshift(""),
  33931. i.pathname = f.join("/")
  33932. }
  33933. if (i.search = e.search,
  33934. i.query = e.query,
  33935. i.host = e.host || "",
  33936. i.auth = e.auth,
  33937. i.hostname = e.hostname || e.host,
  33938. i.port = e.port,
  33939. i.pathname || i.search) {
  33940. var g = i.pathname || ""
  33941. , m = i.search || "";
  33942. i.path = g + m
  33943. }
  33944. return i.slashes = i.slashes || e.slashes,
  33945. i.href = i.format(),
  33946. i
  33947. }
  33948. var v = i.pathname && "/" === i.pathname.charAt(0)
  33949. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33950. , y = A || v || i.host && e.pathname
  33951. , C = y
  33952. , I = i.pathname && i.pathname.split("/") || []
  33953. , f = e.pathname && e.pathname.split("/") || []
  33954. , w = i.protocol && !b[i.protocol];
  33955. if (w && (i.hostname = "",
  33956. i.port = null,
  33957. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33958. i.host = "",
  33959. e.protocol && (e.hostname = null,
  33960. e.port = null,
  33961. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33962. e.host = null),
  33963. y = y && ("" === f[0] || "" === I[0])),
  33964. A)
  33965. i.host = e.host || "" === e.host ? e.host : i.host,
  33966. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33967. i.search = e.search,
  33968. i.query = e.query,
  33969. I = f;
  33970. else if (f.length)
  33971. I || (I = []),
  33972. I.pop(),
  33973. I = I.concat(f),
  33974. i.search = e.search,
  33975. i.query = e.query;
  33976. else if (!c.isNullOrUndefined(e.search)) {
  33977. if (w) {
  33978. i.hostname = i.host = I.shift();
  33979. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33980. _ && (i.auth = _.shift(),
  33981. i.host = i.hostname = _.shift())
  33982. }
  33983. return i.search = e.search,
  33984. i.query = e.query,
  33985. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33986. i.href = i.format(),
  33987. i
  33988. }
  33989. if (!I.length)
  33990. return i.pathname = null,
  33991. i.search ? i.path = "/" + i.search : i.path = null,
  33992. i.href = i.format(),
  33993. i;
  33994. 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--)
  33995. T = I[M],
  33996. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33997. S++) : S && (I.splice(M, 1),
  33998. S--);
  33999. if (!y && !C)
  34000. for (; S--; S)
  34001. I.unshift("..");
  34002. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34003. x && "/" !== I.join("/").substr(-1) && I.push("");
  34004. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34005. if (w) {
  34006. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34007. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34008. _ && (i.auth = _.shift(),
  34009. i.host = i.hostname = _.shift())
  34010. }
  34011. return y = y || i.host && I.length,
  34012. y && !R && I.unshift(""),
  34013. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34014. i.path = null),
  34015. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34016. i.auth = e.auth || i.auth,
  34017. i.slashes = i.slashes || e.slashes,
  34018. i.href = i.format(),
  34019. i
  34020. }
  34021. ,
  34022. n.prototype.parseHost = function() {
  34023. var e = this.host
  34024. , t = u.exec(e);
  34025. t && (t = t[0],
  34026. ":" !== t && (this.port = t.substr(1)),
  34027. e = e.substr(0, e.length - t.length)),
  34028. e && (this.hostname = e)
  34029. }
  34030. }
  34031. , {
  34032. "./util": 209,
  34033. punycode: 204,
  34034. querystring: 207
  34035. }],
  34036. 209: [function(e, t, i) {
  34037. "use strict";
  34038. t.exports = {
  34039. isString: function(e) {
  34040. return "string" == typeof e
  34041. },
  34042. isObject: function(e) {
  34043. return "object" == typeof e && null !== e
  34044. },
  34045. isNull: function(e) {
  34046. return null === e
  34047. },
  34048. isNullOrUndefined: function(e) {
  34049. return null == e
  34050. }
  34051. }
  34052. }
  34053. , {}],
  34054. 210: [function(e, t, i) {
  34055. "use strict";
  34056. function n(e) {
  34057. return l + e
  34058. }
  34059. function r(e) {
  34060. return e.substring(l.length)
  34061. }
  34062. function o(e, t) {
  34063. for (var i in t)
  34064. Object.defineProperty(e, i, {
  34065. value: t[i],
  34066. configurable: !0,
  34067. writable: !0
  34068. })
  34069. }
  34070. function a(e) {
  34071. if ("string" != typeof e)
  34072. throw new TypeError("key must be a string.")
  34073. }
  34074. var s = Object.prototype.hasOwnProperty
  34075. , l = "~";
  34076. t.exports = function(e) {
  34077. var t = Object.create(null)
  34078. , i = 0
  34079. , l = {};
  34080. return o(l, {
  34081. get: function(e, i) {
  34082. a(e);
  34083. var r = n(e);
  34084. return r in t ? t[r] : i
  34085. },
  34086. set: function(e, r) {
  34087. a(e);
  34088. var o = n(e);
  34089. return o in t || ++i,
  34090. t[o] = r
  34091. },
  34092. has: function(e) {
  34093. return a(e),
  34094. n(e)in t
  34095. },
  34096. delete: function(e) {
  34097. a(e);
  34098. var r = n(e);
  34099. return r in t && (--i,
  34100. delete t[r],
  34101. !0)
  34102. },
  34103. clear: function() {
  34104. t = Object.create(null),
  34105. i = 0
  34106. },
  34107. forEach: function(e, i) {
  34108. if ("function" != typeof e)
  34109. throw new TypeError("`callback` must be a function");
  34110. for (var n in t)
  34111. if (s.call(t, n)) {
  34112. var o = r(n)
  34113. , a = t[n];
  34114. e.call(i, a, o, l)
  34115. }
  34116. }
  34117. }),
  34118. Object.defineProperty(l, "size", {
  34119. get: function() {
  34120. return i
  34121. },
  34122. configurable: !0
  34123. }),
  34124. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34125. l.set(t, e[t])
  34126. }),
  34127. l
  34128. }
  34129. }
  34130. , {}],
  34131. 211: [function(e, t, i) {
  34132. t.exports = e("./lib/heap")
  34133. }
  34134. , {
  34135. "./lib/heap": 212
  34136. }],
  34137. 212: [function(e, t, i) {
  34138. (function() {
  34139. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34140. r = Math.floor,
  34141. u = Math.min,
  34142. n = function(e, t) {
  34143. return e < t ? -1 : e > t ? 1 : 0
  34144. }
  34145. ,
  34146. h = function(e, t, i, o, a) {
  34147. var s;
  34148. if (null == i && (i = 0),
  34149. null == a && (a = n),
  34150. i < 0)
  34151. throw new Error("lo must be non-negative");
  34152. for (null == o && (o = e.length); i < o; )
  34153. s = r((i + o) / 2),
  34154. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34155. return [].splice.apply(e, [i, i - i].concat(t)),
  34156. t
  34157. }
  34158. ,
  34159. s = function(e, t, i) {
  34160. return null == i && (i = n),
  34161. e.push(t),
  34162. g(e, 0, e.length - 1, i)
  34163. }
  34164. ,
  34165. a = function(e, t) {
  34166. var i, r;
  34167. return null == t && (t = n),
  34168. i = e.pop(),
  34169. e.length ? (r = e[0],
  34170. e[0] = i,
  34171. m(e, 0, t)) : r = i,
  34172. r
  34173. }
  34174. ,
  34175. c = function(e, t, i) {
  34176. var r;
  34177. return null == i && (i = n),
  34178. r = e[0],
  34179. e[0] = t,
  34180. m(e, 0, i),
  34181. r
  34182. }
  34183. ,
  34184. l = function(e, t, i) {
  34185. var r;
  34186. return null == i && (i = n),
  34187. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34188. t = r[0],
  34189. e[0] = r[1],
  34190. m(e, 0, i)),
  34191. t
  34192. }
  34193. ,
  34194. o = function(e, t) {
  34195. var i, o, a, s, l, c;
  34196. for (null == t && (t = n),
  34197. s = function() {
  34198. c = [];
  34199. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34200. c.push(t);
  34201. return c
  34202. }
  34203. .apply(this).reverse(),
  34204. l = [],
  34205. o = 0,
  34206. a = s.length; o < a; o++)
  34207. i = s[o],
  34208. l.push(m(e, i, t));
  34209. return l
  34210. }
  34211. ,
  34212. f = function(e, t, i) {
  34213. var r;
  34214. if (null == i && (i = n),
  34215. r = e.indexOf(t),
  34216. r !== -1)
  34217. return g(e, 0, r, i),
  34218. m(e, r, i)
  34219. }
  34220. ,
  34221. d = function(e, t, i) {
  34222. var r, a, s, c, h;
  34223. if (null == i && (i = n),
  34224. a = e.slice(0, t),
  34225. !a.length)
  34226. return a;
  34227. for (o(a, i),
  34228. h = e.slice(t),
  34229. s = 0,
  34230. c = h.length; s < c; s++)
  34231. r = h[s],
  34232. l(a, r, i);
  34233. return a.sort(i).reverse()
  34234. }
  34235. ,
  34236. p = function(e, t, i) {
  34237. var r, s, l, c, d, p, f, g, m, v;
  34238. if (null == i && (i = n),
  34239. 10 * t <= e.length) {
  34240. if (c = e.slice(0, t).sort(i),
  34241. !c.length)
  34242. return c;
  34243. for (l = c[c.length - 1],
  34244. g = e.slice(t),
  34245. d = 0,
  34246. f = g.length; d < f; d++)
  34247. r = g[d],
  34248. i(r, l) < 0 && (h(c, r, 0, null, i),
  34249. c.pop(),
  34250. l = c[c.length - 1]);
  34251. return c
  34252. }
  34253. for (o(e, i),
  34254. v = [],
  34255. s = p = 0,
  34256. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34257. v.push(a(e, i));
  34258. return v
  34259. }
  34260. ,
  34261. g = function(e, t, i, r) {
  34262. var o, a, s;
  34263. for (null == r && (r = n),
  34264. o = e[i]; i > t && (s = i - 1 >> 1,
  34265. a = e[s],
  34266. r(o, a) < 0); )
  34267. e[i] = a,
  34268. i = s;
  34269. return e[i] = o
  34270. }
  34271. ,
  34272. m = function(e, t, i) {
  34273. var r, o, a, s, l;
  34274. for (null == i && (i = n),
  34275. o = e.length,
  34276. l = t,
  34277. a = e[t],
  34278. r = 2 * t + 1; r < o; )
  34279. s = r + 1,
  34280. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34281. e[t] = e[r],
  34282. t = r,
  34283. r = 2 * t + 1;
  34284. return e[t] = a,
  34285. g(e, l, t, i)
  34286. }
  34287. ,
  34288. e = function() {
  34289. function e(e) {
  34290. this.cmp = null != e ? e : n,
  34291. this.nodes = []
  34292. }
  34293. return e.push = s,
  34294. e.pop = a,
  34295. e.replace = c,
  34296. e.pushpop = l,
  34297. e.heapify = o,
  34298. e.updateItem = f,
  34299. e.nlargest = d,
  34300. e.nsmallest = p,
  34301. e.prototype.push = function(e) {
  34302. return s(this.nodes, e, this.cmp)
  34303. }
  34304. ,
  34305. e.prototype.pop = function() {
  34306. return a(this.nodes, this.cmp)
  34307. }
  34308. ,
  34309. e.prototype.peek = function() {
  34310. return this.nodes[0]
  34311. }
  34312. ,
  34313. e.prototype.contains = function(e) {
  34314. return this.nodes.indexOf(e) !== -1
  34315. }
  34316. ,
  34317. e.prototype.replace = function(e) {
  34318. return c(this.nodes, e, this.cmp)
  34319. }
  34320. ,
  34321. e.prototype.pushpop = function(e) {
  34322. return l(this.nodes, e, this.cmp)
  34323. }
  34324. ,
  34325. e.prototype.heapify = function() {
  34326. return o(this.nodes, this.cmp)
  34327. }
  34328. ,
  34329. e.prototype.updateItem = function(e) {
  34330. return f(this.nodes, e, this.cmp)
  34331. }
  34332. ,
  34333. e.prototype.clear = function() {
  34334. return this.nodes = []
  34335. }
  34336. ,
  34337. e.prototype.empty = function() {
  34338. return 0 === this.nodes.length
  34339. }
  34340. ,
  34341. e.prototype.size = function() {
  34342. return this.nodes.length
  34343. }
  34344. ,
  34345. e.prototype.clone = function() {
  34346. var t;
  34347. return t = new e,
  34348. t.nodes = this.nodes.slice(0),
  34349. t
  34350. }
  34351. ,
  34352. e.prototype.toArray = function() {
  34353. return this.nodes.slice(0)
  34354. }
  34355. ,
  34356. e.prototype.insert = e.prototype.push,
  34357. e.prototype.top = e.prototype.peek,
  34358. e.prototype.front = e.prototype.peek,
  34359. e.prototype.has = e.prototype.contains,
  34360. e.prototype.copy = e.prototype.clone,
  34361. e
  34362. }(),
  34363. function(e, n) {
  34364. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34365. }(this, function() {
  34366. return e
  34367. })
  34368. }
  34369. ).call(this)
  34370. }
  34371. , {}],
  34372. 213: [function(e, t, i) {
  34373. !function(e) {
  34374. function i() {}
  34375. function n(e, t) {
  34376. return function() {
  34377. e.apply(t, arguments)
  34378. }
  34379. }
  34380. function r(e) {
  34381. if ("object" != typeof this)
  34382. throw new TypeError("Promises must be constructed via new");
  34383. if ("function" != typeof e)
  34384. throw new TypeError("not a function");
  34385. this._state = 0,
  34386. this._handled = !1,
  34387. this._value = void 0,
  34388. this._deferreds = [],
  34389. h(e, this)
  34390. }
  34391. function o(e, t) {
  34392. for (; 3 === e._state; )
  34393. e = e._value;
  34394. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34395. void r._immediateFn(function() {
  34396. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34397. if (null === i)
  34398. return void (1 === e._state ? a : s)(t.promise, e._value);
  34399. var n;
  34400. try {
  34401. n = i(e._value)
  34402. } catch (e) {
  34403. return void s(t.promise, e)
  34404. }
  34405. a(t.promise, n)
  34406. }))
  34407. }
  34408. function a(e, t) {
  34409. try {
  34410. if (t === e)
  34411. throw new TypeError("A promise cannot be resolved with itself.");
  34412. if (t && ("object" == typeof t || "function" == typeof t)) {
  34413. var i = t.then;
  34414. if (t instanceof r)
  34415. return e._state = 3,
  34416. e._value = t,
  34417. void l(e);
  34418. if ("function" == typeof i)
  34419. return void h(n(i, t), e)
  34420. }
  34421. e._state = 1,
  34422. e._value = t,
  34423. l(e)
  34424. } catch (t) {
  34425. s(e, t)
  34426. }
  34427. }
  34428. function s(e, t) {
  34429. e._state = 2,
  34430. e._value = t,
  34431. l(e)
  34432. }
  34433. function l(e) {
  34434. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34435. e._handled || r._unhandledRejectionFn(e._value)
  34436. });
  34437. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34438. o(e, e._deferreds[t]);
  34439. e._deferreds = null
  34440. }
  34441. function c(e, t, i) {
  34442. this.onFulfilled = "function" == typeof e ? e : null,
  34443. this.onRejected = "function" == typeof t ? t : null,
  34444. this.promise = i
  34445. }
  34446. function h(e, t) {
  34447. var i = !1;
  34448. try {
  34449. e(function(e) {
  34450. i || (i = !0,
  34451. a(t, e))
  34452. }, function(e) {
  34453. i || (i = !0,
  34454. s(t, e))
  34455. })
  34456. } catch (e) {
  34457. if (i)
  34458. return;
  34459. i = !0,
  34460. s(t, e)
  34461. }
  34462. }
  34463. var u = setTimeout;
  34464. r.prototype.catch = function(e) {
  34465. return this.then(null, e)
  34466. }
  34467. ,
  34468. r.prototype.then = function(e, t) {
  34469. var n = new this.constructor(i);
  34470. return o(this, new c(e,t,n)),
  34471. n
  34472. }
  34473. ,
  34474. r.all = function(e) {
  34475. var t = Array.prototype.slice.call(e);
  34476. return new r(function(e, i) {
  34477. function n(o, a) {
  34478. try {
  34479. if (a && ("object" == typeof a || "function" == typeof a)) {
  34480. var s = a.then;
  34481. if ("function" == typeof s)
  34482. return void s.call(a, function(e) {
  34483. n(o, e)
  34484. }, i)
  34485. }
  34486. t[o] = a,
  34487. 0 === --r && e(t)
  34488. } catch (e) {
  34489. i(e)
  34490. }
  34491. }
  34492. if (0 === t.length)
  34493. return e([]);
  34494. for (var r = t.length, o = 0; o < t.length; o++)
  34495. n(o, t[o])
  34496. }
  34497. )
  34498. }
  34499. ,
  34500. r.resolve = function(e) {
  34501. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34502. t(e)
  34503. }
  34504. )
  34505. }
  34506. ,
  34507. r.reject = function(e) {
  34508. return new r(function(t, i) {
  34509. i(e)
  34510. }
  34511. )
  34512. }
  34513. ,
  34514. r.race = function(e) {
  34515. return new r(function(t, i) {
  34516. for (var n = 0, r = e.length; n < r; n++)
  34517. e[n].then(t, i)
  34518. }
  34519. )
  34520. }
  34521. ,
  34522. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34523. setImmediate(e)
  34524. }
  34525. || function(e) {
  34526. u(e, 0)
  34527. }
  34528. ,
  34529. r._unhandledRejectionFn = function(e) {
  34530. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34531. }
  34532. ,
  34533. r._setImmediateFn = function(e) {
  34534. r._immediateFn = e
  34535. }
  34536. ,
  34537. r._setUnhandledRejectionFn = function(e) {
  34538. r._unhandledRejectionFn = e
  34539. }
  34540. ,
  34541. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34542. }(this)
  34543. }
  34544. , {}],
  34545. 214: [function(e, t, i) {
  34546. (function(i) {
  34547. !function(i, n) {
  34548. "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)
  34549. }(this, function(t, n) {
  34550. "use strict";
  34551. var r = {};
  34552. return r.ByteBuffer = t,
  34553. r.Long = t.Long || null,
  34554. r.VERSION = "5.0.1",
  34555. r.WIRE_TYPES = {},
  34556. r.WIRE_TYPES.VARINT = 0,
  34557. r.WIRE_TYPES.BITS64 = 1,
  34558. r.WIRE_TYPES.LDELIM = 2,
  34559. r.WIRE_TYPES.STARTGROUP = 3,
  34560. r.WIRE_TYPES.ENDGROUP = 4,
  34561. r.WIRE_TYPES.BITS32 = 5,
  34562. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34563. r.TYPES = {
  34564. int32: {
  34565. name: "int32",
  34566. wireType: r.WIRE_TYPES.VARINT,
  34567. defaultValue: 0
  34568. },
  34569. uint32: {
  34570. name: "uint32",
  34571. wireType: r.WIRE_TYPES.VARINT,
  34572. defaultValue: 0
  34573. },
  34574. sint32: {
  34575. name: "sint32",
  34576. wireType: r.WIRE_TYPES.VARINT,
  34577. defaultValue: 0
  34578. },
  34579. int64: {
  34580. name: "int64",
  34581. wireType: r.WIRE_TYPES.VARINT,
  34582. defaultValue: r.Long ? r.Long.ZERO : void 0
  34583. },
  34584. uint64: {
  34585. name: "uint64",
  34586. wireType: r.WIRE_TYPES.VARINT,
  34587. defaultValue: r.Long ? r.Long.UZERO : void 0
  34588. },
  34589. sint64: {
  34590. name: "sint64",
  34591. wireType: r.WIRE_TYPES.VARINT,
  34592. defaultValue: r.Long ? r.Long.ZERO : void 0
  34593. },
  34594. bool: {
  34595. name: "bool",
  34596. wireType: r.WIRE_TYPES.VARINT,
  34597. defaultValue: !1
  34598. },
  34599. double: {
  34600. name: "double",
  34601. wireType: r.WIRE_TYPES.BITS64,
  34602. defaultValue: 0
  34603. },
  34604. string: {
  34605. name: "string",
  34606. wireType: r.WIRE_TYPES.LDELIM,
  34607. defaultValue: ""
  34608. },
  34609. bytes: {
  34610. name: "bytes",
  34611. wireType: r.WIRE_TYPES.LDELIM,
  34612. defaultValue: null
  34613. },
  34614. fixed32: {
  34615. name: "fixed32",
  34616. wireType: r.WIRE_TYPES.BITS32,
  34617. defaultValue: 0
  34618. },
  34619. sfixed32: {
  34620. name: "sfixed32",
  34621. wireType: r.WIRE_TYPES.BITS32,
  34622. defaultValue: 0
  34623. },
  34624. fixed64: {
  34625. name: "fixed64",
  34626. wireType: r.WIRE_TYPES.BITS64,
  34627. defaultValue: r.Long ? r.Long.UZERO : void 0
  34628. },
  34629. sfixed64: {
  34630. name: "sfixed64",
  34631. wireType: r.WIRE_TYPES.BITS64,
  34632. defaultValue: r.Long ? r.Long.ZERO : void 0
  34633. },
  34634. float: {
  34635. name: "float",
  34636. wireType: r.WIRE_TYPES.BITS32,
  34637. defaultValue: 0
  34638. },
  34639. enum: {
  34640. name: "enum",
  34641. wireType: r.WIRE_TYPES.VARINT,
  34642. defaultValue: 0
  34643. },
  34644. message: {
  34645. name: "message",
  34646. wireType: r.WIRE_TYPES.LDELIM,
  34647. defaultValue: null
  34648. },
  34649. group: {
  34650. name: "group",
  34651. wireType: r.WIRE_TYPES.STARTGROUP,
  34652. defaultValue: null
  34653. }
  34654. },
  34655. 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],
  34656. r.ID_MIN = 1,
  34657. r.ID_MAX = 536870911,
  34658. r.convertFieldsToCamelCase = !1,
  34659. r.populateAccessors = !0,
  34660. r.populateDefaults = !0,
  34661. r.Util = function() {
  34662. var t = {};
  34663. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34664. t.XHR = function() {
  34665. for (var e = [function() {
  34666. return new XMLHttpRequest
  34667. }
  34668. , function() {
  34669. return new ActiveXObject("Msxml2.XMLHTTP")
  34670. }
  34671. , function() {
  34672. return new ActiveXObject("Msxml3.XMLHTTP")
  34673. }
  34674. , function() {
  34675. return new ActiveXObject("Microsoft.XMLHTTP")
  34676. }
  34677. ], t = null, i = 0; i < e.length; i++) {
  34678. try {
  34679. t = e[i]()
  34680. } catch (e) {
  34681. continue
  34682. }
  34683. break
  34684. }
  34685. if (!t)
  34686. throw Error("XMLHttpRequest is not supported");
  34687. return t
  34688. }
  34689. ,
  34690. t.fetch = function(i, n) {
  34691. if (n && "function" != typeof n && (n = null),
  34692. t.IS_NODE) {
  34693. var r = e("fs");
  34694. if (n)
  34695. r.readFile(i, function(e, t) {
  34696. n(e ? null : "" + t)
  34697. });
  34698. else
  34699. try {
  34700. return r.readFileSync(i)
  34701. } catch (e) {
  34702. return null
  34703. }
  34704. } else {
  34705. var o = t.XHR();
  34706. if (o.open("GET", i, !!n),
  34707. o.setRequestHeader("Accept", "text/plain"),
  34708. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34709. !n)
  34710. return o.send(null),
  34711. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34712. if (o.onreadystatechange = function() {
  34713. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34714. }
  34715. ,
  34716. 4 == o.readyState)
  34717. return;
  34718. o.send(null)
  34719. }
  34720. }
  34721. ,
  34722. t.toCamelCase = function(e) {
  34723. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34724. return t.toUpperCase()
  34725. })
  34726. }
  34727. ,
  34728. t
  34729. }(),
  34730. r.Lang = {
  34731. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34732. RULE: /^(?:required|optional|repeated|map)$/,
  34733. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34734. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34735. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34736. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34737. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34738. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34739. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34740. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34741. NUMBER_OCT: /^0[0-7]+$/,
  34742. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34743. BOOL: /^(?:true|false)$/i,
  34744. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34745. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34746. WHITESPACE: /\s/,
  34747. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34748. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34749. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34750. },
  34751. r.DotProto = function(e, t) {
  34752. function i(e, i) {
  34753. var n = -1
  34754. , r = 1;
  34755. if ("-" == e.charAt(0) && (r = -1,
  34756. e = e.substring(1)),
  34757. t.NUMBER_DEC.test(e))
  34758. n = parseInt(e);
  34759. else if (t.NUMBER_HEX.test(e))
  34760. n = parseInt(e.substring(2), 16);
  34761. else {
  34762. if (!t.NUMBER_OCT.test(e))
  34763. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34764. n = parseInt(e.substring(1), 8)
  34765. }
  34766. if (n = r * n | 0,
  34767. !i && n < 0)
  34768. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34769. return n
  34770. }
  34771. function n(e) {
  34772. var i = 1;
  34773. if ("-" == e.charAt(0) && (i = -1,
  34774. e = e.substring(1)),
  34775. t.NUMBER_DEC.test(e))
  34776. return i * parseInt(e, 10);
  34777. if (t.NUMBER_HEX.test(e))
  34778. return i * parseInt(e.substring(2), 16);
  34779. if (t.NUMBER_OCT.test(e))
  34780. return i * parseInt(e.substring(1), 8);
  34781. if ("inf" === e)
  34782. return i * (1 / 0);
  34783. if ("nan" === e)
  34784. return NaN;
  34785. if (t.NUMBER_FLT.test(e))
  34786. return i * parseFloat(e);
  34787. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34788. }
  34789. function r(e, t, i) {
  34790. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34791. e[t].push(i))
  34792. }
  34793. var o = {}
  34794. , a = function(e) {
  34795. this.source = e + "",
  34796. this.index = 0,
  34797. this.line = 1,
  34798. this.stack = [],
  34799. this._stringOpen = null
  34800. }
  34801. , s = a.prototype;
  34802. s._readString = function() {
  34803. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34804. e.lastIndex = this.index - 1;
  34805. var i = e.exec(this.source);
  34806. if (!i)
  34807. throw Error("unterminated string");
  34808. return this.index = e.lastIndex,
  34809. this.stack.push(this._stringOpen),
  34810. this._stringOpen = null,
  34811. i[1]
  34812. }
  34813. ,
  34814. s.next = function() {
  34815. if (this.stack.length > 0)
  34816. return this.stack.shift();
  34817. if (this.index >= this.source.length)
  34818. return null;
  34819. if (null !== this._stringOpen)
  34820. return this._readString();
  34821. var e, i, n;
  34822. do {
  34823. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34824. if ("\n" === n && ++this.line,
  34825. ++this.index === this.source.length)
  34826. return null;
  34827. if ("/" === this.source.charAt(this.index))
  34828. if (++this.index,
  34829. "/" === this.source.charAt(this.index)) {
  34830. for (; "\n" !== this.source.charAt(++this.index); )
  34831. if (this.index == this.source.length)
  34832. return null;
  34833. ++this.index,
  34834. ++this.line,
  34835. e = !0
  34836. } else {
  34837. if ("*" !== (n = this.source.charAt(this.index)))
  34838. return "/";
  34839. do {
  34840. if ("\n" === n && ++this.line,
  34841. ++this.index === this.source.length)
  34842. return null;
  34843. i = n,
  34844. n = this.source.charAt(this.index)
  34845. } while ("*" !== i || "/" !== n);++this.index,
  34846. e = !0
  34847. }
  34848. } while (e);if (this.index === this.source.length)
  34849. return null;
  34850. var r = this.index;
  34851. t.DELIM.lastIndex = 0;
  34852. var o = t.DELIM.test(this.source.charAt(r++));
  34853. if (!o)
  34854. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34855. ++r;
  34856. var a = this.source.substring(this.index, this.index = r);
  34857. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34858. a
  34859. }
  34860. ,
  34861. s.peek = function() {
  34862. if (0 === this.stack.length) {
  34863. var e = this.next();
  34864. if (null === e)
  34865. return null;
  34866. this.stack.push(e)
  34867. }
  34868. return this.stack[0]
  34869. }
  34870. ,
  34871. s.skip = function(e) {
  34872. var t = this.next();
  34873. if (t !== e)
  34874. throw Error("illegal '" + t + "', '" + e + "' expected")
  34875. }
  34876. ,
  34877. s.omit = function(e) {
  34878. return this.peek() === e && (this.next(),
  34879. !0)
  34880. }
  34881. ,
  34882. s.toString = function() {
  34883. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34884. }
  34885. ,
  34886. o.Tokenizer = a;
  34887. var l = function(e) {
  34888. this.tn = new a(e),
  34889. this.proto3 = !1
  34890. }
  34891. , c = l.prototype;
  34892. return c.parse = function() {
  34893. var e, i, n = {
  34894. name: "[ROOT]",
  34895. package: null,
  34896. messages: [],
  34897. enums: [],
  34898. imports: [],
  34899. options: {},
  34900. services: []
  34901. }, r = !0;
  34902. try {
  34903. for (; e = this.tn.next(); )
  34904. switch (e) {
  34905. case "package":
  34906. if (!r || null !== n.package)
  34907. throw Error("unexpected 'package'");
  34908. if (e = this.tn.next(),
  34909. !t.TYPEREF.test(e))
  34910. throw Error("illegal package name: " + e);
  34911. this.tn.skip(";"),
  34912. n.package = e;
  34913. break;
  34914. case "import":
  34915. if (!r)
  34916. throw Error("unexpected 'import'");
  34917. e = this.tn.peek(),
  34918. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34919. e = this._readString(),
  34920. this.tn.skip(";"),
  34921. i || n.imports.push(e);
  34922. break;
  34923. case "syntax":
  34924. if (!r)
  34925. throw Error("unexpected 'syntax'");
  34926. this.tn.skip("="),
  34927. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34928. this.tn.skip(";");
  34929. break;
  34930. case "message":
  34931. this._parseMessage(n, null),
  34932. r = !1;
  34933. break;
  34934. case "enum":
  34935. this._parseEnum(n),
  34936. r = !1;
  34937. break;
  34938. case "option":
  34939. this._parseOption(n);
  34940. break;
  34941. case "service":
  34942. this._parseService(n);
  34943. break;
  34944. case "extend":
  34945. this._parseExtend(n);
  34946. break;
  34947. default:
  34948. throw Error("unexpected '" + e + "'")
  34949. }
  34950. } catch (e) {
  34951. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34952. e
  34953. }
  34954. return delete n.name,
  34955. n
  34956. }
  34957. ,
  34958. l.parse = function(e) {
  34959. return new l(e).parse()
  34960. }
  34961. ,
  34962. c._readString = function() {
  34963. var e, t, i = "";
  34964. do {
  34965. if (t = this.tn.next(),
  34966. "'" !== t && '"' !== t)
  34967. throw Error("illegal string delimiter: " + t);
  34968. i += this.tn.next(),
  34969. this.tn.skip(t),
  34970. e = this.tn.peek()
  34971. } while ('"' === e || '"' === e);return i
  34972. }
  34973. ,
  34974. c._readValue = function(e) {
  34975. var i = this.tn.peek();
  34976. if ('"' === i || "'" === i)
  34977. return this._readString();
  34978. if (this.tn.next(),
  34979. t.NUMBER.test(i))
  34980. return n(i);
  34981. if (t.BOOL.test(i))
  34982. return "true" === i.toLowerCase();
  34983. if (e && t.TYPEREF.test(i))
  34984. return i;
  34985. throw Error("illegal value: " + i)
  34986. }
  34987. ,
  34988. c._parseOption = function(e, i) {
  34989. var n = this.tn.next()
  34990. , r = !1;
  34991. if ("(" === n && (r = !0,
  34992. n = this.tn.next()),
  34993. !t.TYPEREF.test(n))
  34994. throw Error("illegal option name: " + n);
  34995. var o = n;
  34996. r && (this.tn.skip(")"),
  34997. o = "(" + o + ")",
  34998. n = this.tn.peek(),
  34999. t.FQTYPEREF.test(n) && (o += n,
  35000. this.tn.next())),
  35001. this.tn.skip("="),
  35002. this._parseOptionValue(e, o),
  35003. i || this.tn.skip(";")
  35004. }
  35005. ,
  35006. c._parseOptionValue = function(e, i) {
  35007. var n = this.tn.peek();
  35008. if ("{" !== n)
  35009. r(e.options, i, this._readValue(!0));
  35010. else
  35011. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35012. if (!t.NAME.test(n))
  35013. throw Error("illegal option name: " + i + "." + n);
  35014. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35015. }
  35016. }
  35017. ,
  35018. c._parseService = function(e) {
  35019. var i = this.tn.next();
  35020. if (!t.NAME.test(i))
  35021. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35022. var n = i
  35023. , r = {
  35024. name: n,
  35025. rpc: {},
  35026. options: {}
  35027. };
  35028. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35029. if ("option" === i)
  35030. this._parseOption(r);
  35031. else {
  35032. if ("rpc" !== i)
  35033. throw Error("illegal service token: " + i);
  35034. this._parseServiceRPC(r)
  35035. }
  35036. this.tn.omit(";"),
  35037. e.services.push(r)
  35038. }
  35039. ,
  35040. c._parseServiceRPC = function(e) {
  35041. var i = "rpc"
  35042. , n = this.tn.next();
  35043. if (!t.NAME.test(n))
  35044. throw Error("illegal rpc service method name: " + n);
  35045. var r = n
  35046. , o = {
  35047. request: null,
  35048. response: null,
  35049. request_stream: !1,
  35050. response_stream: !1,
  35051. options: {}
  35052. };
  35053. if (this.tn.skip("("),
  35054. n = this.tn.next(),
  35055. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35056. n = this.tn.next()),
  35057. !t.TYPEREF.test(n))
  35058. throw Error("illegal rpc service request type: " + n);
  35059. if (o.request = n,
  35060. this.tn.skip(")"),
  35061. n = this.tn.next(),
  35062. "returns" !== n.toLowerCase())
  35063. throw Error("illegal rpc service request type delimiter: " + n);
  35064. if (this.tn.skip("("),
  35065. n = this.tn.next(),
  35066. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35067. n = this.tn.next()),
  35068. o.response = n,
  35069. this.tn.skip(")"),
  35070. n = this.tn.peek(),
  35071. "{" === n) {
  35072. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35073. if ("option" !== n)
  35074. throw Error("illegal rpc service token: " + n);
  35075. this._parseOption(o)
  35076. }
  35077. this.tn.omit(";")
  35078. } else
  35079. this.tn.skip(";");
  35080. "undefined" == typeof e[i] && (e[i] = {}),
  35081. e[i][r] = o
  35082. }
  35083. ,
  35084. c._parseMessage = function(e, n) {
  35085. var r = !!n
  35086. , o = this.tn.next()
  35087. , a = {
  35088. name: "",
  35089. fields: [],
  35090. enums: [],
  35091. messages: [],
  35092. options: {},
  35093. services: [],
  35094. oneofs: {}
  35095. };
  35096. if (!t.NAME.test(o))
  35097. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35098. for (a.name = o,
  35099. r && (this.tn.skip("="),
  35100. n.id = i(this.tn.next()),
  35101. a.isGroup = !0),
  35102. o = this.tn.peek(),
  35103. "[" === o && n && this._parseFieldOptions(n),
  35104. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35105. if (t.RULE.test(o))
  35106. this._parseMessageField(a, o);
  35107. else if ("oneof" === o)
  35108. this._parseMessageOneOf(a);
  35109. else if ("enum" === o)
  35110. this._parseEnum(a);
  35111. else if ("message" === o)
  35112. this._parseMessage(a);
  35113. else if ("option" === o)
  35114. this._parseOption(a);
  35115. else if ("service" === o)
  35116. this._parseService(a);
  35117. else if ("extensions" === o)
  35118. a.extensions = this._parseExtensionRanges();
  35119. else if ("reserved" === o)
  35120. this._parseIgnored();
  35121. else if ("extend" === o)
  35122. this._parseExtend(a);
  35123. else {
  35124. if (!t.TYPEREF.test(o))
  35125. throw Error("illegal message token: " + o);
  35126. if (!this.proto3)
  35127. throw Error("illegal field rule: " + o);
  35128. this._parseMessageField(a, "optional", o)
  35129. }
  35130. return this.tn.omit(";"),
  35131. e.messages.push(a),
  35132. a
  35133. }
  35134. ,
  35135. c._parseIgnored = function() {
  35136. for (; ";" !== this.tn.peek(); )
  35137. this.tn.next();
  35138. this.tn.skip(";")
  35139. }
  35140. ,
  35141. c._parseMessageField = function(e, n, r) {
  35142. if (!t.RULE.test(n))
  35143. throw Error("illegal message field rule: " + n);
  35144. var o, a = {
  35145. rule: n,
  35146. type: "",
  35147. name: "",
  35148. options: {},
  35149. id: 0
  35150. };
  35151. if ("map" === n) {
  35152. if (r)
  35153. throw Error("illegal type: " + r);
  35154. if (this.tn.skip("<"),
  35155. o = this.tn.next(),
  35156. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35157. throw Error("illegal message field type: " + o);
  35158. if (a.keytype = o,
  35159. this.tn.skip(","),
  35160. o = this.tn.next(),
  35161. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35162. throw Error("illegal message field: " + o);
  35163. if (a.type = o,
  35164. this.tn.skip(">"),
  35165. o = this.tn.next(),
  35166. !t.NAME.test(o))
  35167. throw Error("illegal message field name: " + o);
  35168. a.name = o,
  35169. this.tn.skip("="),
  35170. a.id = i(this.tn.next()),
  35171. o = this.tn.peek(),
  35172. "[" === o && this._parseFieldOptions(a),
  35173. this.tn.skip(";")
  35174. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35175. "group" === r) {
  35176. var s = this._parseMessage(e, a);
  35177. if (!/^[A-Z]/.test(s.name))
  35178. throw Error("illegal group name: " + s.name);
  35179. a.type = s.name,
  35180. a.name = s.name.toLowerCase(),
  35181. this.tn.omit(";")
  35182. } else {
  35183. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35184. throw Error("illegal message field type: " + r);
  35185. if (a.type = r,
  35186. o = this.tn.next(),
  35187. !t.NAME.test(o))
  35188. throw Error("illegal message field name: " + o);
  35189. a.name = o,
  35190. this.tn.skip("="),
  35191. a.id = i(this.tn.next()),
  35192. o = this.tn.peek(),
  35193. "[" === o && this._parseFieldOptions(a),
  35194. this.tn.skip(";")
  35195. }
  35196. return e.fields.push(a),
  35197. a
  35198. }
  35199. ,
  35200. c._parseMessageOneOf = function(e) {
  35201. var i = this.tn.next();
  35202. if (!t.NAME.test(i))
  35203. throw Error("illegal oneof name: " + i);
  35204. var n, r = i, o = [];
  35205. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35206. n = this._parseMessageField(e, "optional", i),
  35207. n.oneof = r,
  35208. o.push(n.id);
  35209. this.tn.omit(";"),
  35210. e.oneofs[r] = o
  35211. }
  35212. ,
  35213. c._parseFieldOptions = function(e) {
  35214. this.tn.skip("[");
  35215. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35216. i || this.tn.skip(","),
  35217. this._parseOption(e, !0),
  35218. i = !1;
  35219. this.tn.next()
  35220. }
  35221. ,
  35222. c._parseEnum = function(e) {
  35223. var n = {
  35224. name: "",
  35225. values: [],
  35226. options: {}
  35227. }
  35228. , r = this.tn.next();
  35229. if (!t.NAME.test(r))
  35230. throw Error("illegal name: " + r);
  35231. for (n.name = r,
  35232. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35233. if ("option" === r)
  35234. this._parseOption(n);
  35235. else {
  35236. if (!t.NAME.test(r))
  35237. throw Error("illegal name: " + r);
  35238. this.tn.skip("=");
  35239. var o = {
  35240. name: r,
  35241. id: i(this.tn.next(), !0)
  35242. };
  35243. r = this.tn.peek(),
  35244. "[" === r && this._parseFieldOptions({
  35245. options: {}
  35246. }),
  35247. this.tn.skip(";"),
  35248. n.values.push(o)
  35249. }
  35250. this.tn.omit(";"),
  35251. e.enums.push(n)
  35252. }
  35253. ,
  35254. c._parseExtensionRanges = function() {
  35255. var t, i, r, o = [];
  35256. do {
  35257. for (i = []; ; ) {
  35258. switch (t = this.tn.next()) {
  35259. case "min":
  35260. r = e.ID_MIN;
  35261. break;
  35262. case "max":
  35263. r = e.ID_MAX;
  35264. break;
  35265. default:
  35266. r = n(t)
  35267. }
  35268. if (i.push(r),
  35269. 2 === i.length)
  35270. break;
  35271. if ("to" !== this.tn.peek()) {
  35272. i.push(r);
  35273. break
  35274. }
  35275. this.tn.next()
  35276. }
  35277. o.push(i)
  35278. } while (this.tn.omit(","));return this.tn.skip(";"),
  35279. o
  35280. }
  35281. ,
  35282. c._parseExtend = function(e) {
  35283. var i = this.tn.next();
  35284. if (!t.TYPEREF.test(i))
  35285. throw Error("illegal extend reference: " + i);
  35286. var n = {
  35287. ref: i,
  35288. fields: []
  35289. };
  35290. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35291. if (t.RULE.test(i))
  35292. this._parseMessageField(n, i);
  35293. else {
  35294. if (!t.TYPEREF.test(i))
  35295. throw Error("illegal extend token: " + i);
  35296. if (!this.proto3)
  35297. throw Error("illegal field rule: " + i);
  35298. this._parseMessageField(n, "optional", i)
  35299. }
  35300. return this.tn.omit(";"),
  35301. e.messages.push(n),
  35302. n
  35303. }
  35304. ,
  35305. c.toString = function() {
  35306. return "Parser at line " + this.tn.line
  35307. }
  35308. ,
  35309. o.Parser = l,
  35310. o
  35311. }(r, r.Lang),
  35312. r.Reflect = function(e) {
  35313. function i(i) {
  35314. if ("string" == typeof i && (i = e.TYPES[i]),
  35315. "undefined" == typeof i.defaultValue)
  35316. throw Error("default value for type " + i.name + " is not supported");
  35317. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35318. }
  35319. function n(t, i) {
  35320. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35321. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35322. if ("string" == typeof t)
  35323. return e.Long.fromString(t, i || !1, 10);
  35324. if ("number" == typeof t)
  35325. return e.Long.fromNumber(t, i || !1);
  35326. throw Error("not convertible to Long")
  35327. }
  35328. function r(t, i) {
  35329. var n = i.readVarint32()
  35330. , o = 7 & n
  35331. , a = n >>> 3;
  35332. switch (o) {
  35333. case e.WIRE_TYPES.VARINT:
  35334. do
  35335. n = i.readUint8();
  35336. while (128 === (128 & n));break;
  35337. case e.WIRE_TYPES.BITS64:
  35338. i.offset += 8;
  35339. break;
  35340. case e.WIRE_TYPES.LDELIM:
  35341. n = i.readVarint32(),
  35342. i.offset += n;
  35343. break;
  35344. case e.WIRE_TYPES.STARTGROUP:
  35345. r(a, i);
  35346. break;
  35347. case e.WIRE_TYPES.ENDGROUP:
  35348. if (a === t)
  35349. return !1;
  35350. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35351. case e.WIRE_TYPES.BITS32:
  35352. i.offset += 4;
  35353. break;
  35354. default:
  35355. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35356. }
  35357. return !0
  35358. }
  35359. var o = {}
  35360. , a = function(e, t, i) {
  35361. this.builder = e,
  35362. this.parent = t,
  35363. this.name = i,
  35364. this.className
  35365. }
  35366. , s = a.prototype;
  35367. s.fqn = function() {
  35368. for (var e = this.name, t = this; ; ) {
  35369. if (t = t.parent,
  35370. null == t)
  35371. break;
  35372. e = t.name + "." + e
  35373. }
  35374. return e
  35375. }
  35376. ,
  35377. s.toString = function(e) {
  35378. return (e ? this.className + " " : "") + this.fqn()
  35379. }
  35380. ,
  35381. s.build = function() {
  35382. throw Error(this.toString(!0) + " cannot be built directly")
  35383. }
  35384. ,
  35385. o.T = a;
  35386. var l = function(e, t, i, n, r) {
  35387. a.call(this, e, t, i),
  35388. this.className = "Namespace",
  35389. this.children = [],
  35390. this.options = n || {},
  35391. this.syntax = r || "proto2"
  35392. }
  35393. , c = l.prototype = Object.create(a.prototype);
  35394. c.getChildren = function(e) {
  35395. if (e = e || null,
  35396. null == e)
  35397. return this.children.slice();
  35398. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35399. this.children[i]instanceof e && t.push(this.children[i]);
  35400. return t
  35401. }
  35402. ,
  35403. c.addChild = function(e) {
  35404. var t;
  35405. if (t = this.getChild(e.name))
  35406. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35407. t.name = t.originalName;
  35408. else {
  35409. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35410. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35411. e.name = e.originalName
  35412. }
  35413. this.children.push(e)
  35414. }
  35415. ,
  35416. c.getChild = function(e) {
  35417. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35418. if (this.children[i][t] === e)
  35419. return this.children[i];
  35420. return null
  35421. }
  35422. ,
  35423. c.resolve = function(e, t) {
  35424. var i = "string" == typeof e ? e.split(".") : e
  35425. , n = this
  35426. , r = 0;
  35427. if ("" === i[r]) {
  35428. for (; null !== n.parent; )
  35429. n = n.parent;
  35430. r++
  35431. }
  35432. var a;
  35433. do {
  35434. do {
  35435. if (!(n instanceof o.Namespace)) {
  35436. n = null;
  35437. break
  35438. }
  35439. if (a = n.getChild(i[r]),
  35440. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35441. n = null;
  35442. break
  35443. }
  35444. n = a,
  35445. r++
  35446. } while (r < i.length);if (null != n)
  35447. break;
  35448. if (null !== this.parent)
  35449. return this.parent.resolve(e, t)
  35450. } while (null != n);return n
  35451. }
  35452. ,
  35453. c.qn = function(e) {
  35454. var t = []
  35455. , i = e;
  35456. do
  35457. t.unshift(i.name),
  35458. i = i.parent;
  35459. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35460. var r = t.slice(t.length - n);
  35461. if (e === this.resolve(r, e instanceof o.Namespace))
  35462. return r.join(".")
  35463. }
  35464. return e.fqn()
  35465. }
  35466. ,
  35467. c.build = function() {
  35468. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35469. e = i[n],
  35470. e instanceof l && (t[e.name] = e.build());
  35471. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35472. value: this.buildOpt()
  35473. }),
  35474. t
  35475. }
  35476. ,
  35477. c.buildOpt = function() {
  35478. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35479. var r = t[i]
  35480. , o = this.options[t[i]];
  35481. e[r] = o
  35482. }
  35483. return e
  35484. }
  35485. ,
  35486. c.getOption = function(e) {
  35487. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35488. }
  35489. ,
  35490. o.Namespace = l;
  35491. var h = function(t, i, n, r) {
  35492. if (this.type = t,
  35493. this.resolvedType = i,
  35494. this.isMapKey = n,
  35495. this.syntax = r,
  35496. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35497. throw Error("Invalid map key type: " + t.name)
  35498. }
  35499. , u = h.prototype;
  35500. h.defaultFieldValue = i,
  35501. u.verifyValue = function(i) {
  35502. function r(e, t) {
  35503. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35504. }
  35505. var o = this;
  35506. switch (this.type) {
  35507. case e.TYPES.int32:
  35508. case e.TYPES.sint32:
  35509. case e.TYPES.sfixed32:
  35510. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35511. i > 4294967295 ? 0 | i : i;
  35512. case e.TYPES.uint32:
  35513. case e.TYPES.fixed32:
  35514. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35515. i < 0 ? i >>> 0 : i;
  35516. case e.TYPES.int64:
  35517. case e.TYPES.sint64:
  35518. case e.TYPES.sfixed64:
  35519. if (e.Long)
  35520. try {
  35521. return n(i, !1)
  35522. } catch (e) {
  35523. r(typeof i, e.message)
  35524. }
  35525. else
  35526. r(typeof i, "requires Long.js");
  35527. case e.TYPES.uint64:
  35528. case e.TYPES.fixed64:
  35529. if (e.Long)
  35530. try {
  35531. return n(i, !0)
  35532. } catch (e) {
  35533. r(typeof i, e.message)
  35534. }
  35535. else
  35536. r(typeof i, "requires Long.js");
  35537. case e.TYPES.bool:
  35538. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35539. i;
  35540. case e.TYPES.float:
  35541. case e.TYPES.double:
  35542. return "number" != typeof i && r(typeof i, "not a number"),
  35543. i;
  35544. case e.TYPES.string:
  35545. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35546. "" + i;
  35547. case e.TYPES.bytes:
  35548. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35549. case e.TYPES.enum:
  35550. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35551. for (l = 0; l < a.length; l++) {
  35552. if (a[l].name == i)
  35553. return a[l].id;
  35554. if (a[l].id == i)
  35555. return a[l].id
  35556. }
  35557. if ("proto3" === this.syntax)
  35558. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35559. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35560. i;
  35561. r(i, "not a valid enum value");
  35562. case e.TYPES.group:
  35563. case e.TYPES.message:
  35564. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35565. i instanceof this.resolvedType.clazz)
  35566. return i;
  35567. if (i instanceof e.Builder.Message) {
  35568. var s = {};
  35569. for (var l in i)
  35570. i.hasOwnProperty(l) && (s[l] = i[l]);
  35571. i = s
  35572. }
  35573. return new this.resolvedType.clazz(i)
  35574. }
  35575. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35576. }
  35577. ,
  35578. u.calculateLength = function(i, n) {
  35579. if (null === n)
  35580. return 0;
  35581. var r;
  35582. switch (this.type) {
  35583. case e.TYPES.int32:
  35584. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35585. case e.TYPES.uint32:
  35586. return t.calculateVarint32(n);
  35587. case e.TYPES.sint32:
  35588. return t.calculateVarint32(t.zigZagEncode32(n));
  35589. case e.TYPES.fixed32:
  35590. case e.TYPES.sfixed32:
  35591. case e.TYPES.float:
  35592. return 4;
  35593. case e.TYPES.int64:
  35594. case e.TYPES.uint64:
  35595. return t.calculateVarint64(n);
  35596. case e.TYPES.sint64:
  35597. return t.calculateVarint64(t.zigZagEncode64(n));
  35598. case e.TYPES.fixed64:
  35599. case e.TYPES.sfixed64:
  35600. return 8;
  35601. case e.TYPES.bool:
  35602. return 1;
  35603. case e.TYPES.enum:
  35604. return t.calculateVarint32(n);
  35605. case e.TYPES.double:
  35606. return 8;
  35607. case e.TYPES.string:
  35608. return r = t.calculateUTF8Bytes(n),
  35609. t.calculateVarint32(r) + r;
  35610. case e.TYPES.bytes:
  35611. if (n.remaining() < 0)
  35612. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35613. return t.calculateVarint32(n.remaining()) + n.remaining();
  35614. case e.TYPES.message:
  35615. return r = this.resolvedType.calculate(n),
  35616. t.calculateVarint32(r) + r;
  35617. case e.TYPES.group:
  35618. return r = this.resolvedType.calculate(n),
  35619. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35620. }
  35621. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35622. }
  35623. ,
  35624. u.encodeValue = function(i, n, r) {
  35625. if (null === n)
  35626. return r;
  35627. switch (this.type) {
  35628. case e.TYPES.int32:
  35629. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35630. break;
  35631. case e.TYPES.uint32:
  35632. r.writeVarint32(n);
  35633. break;
  35634. case e.TYPES.sint32:
  35635. r.writeVarint32ZigZag(n);
  35636. break;
  35637. case e.TYPES.fixed32:
  35638. r.writeUint32(n);
  35639. break;
  35640. case e.TYPES.sfixed32:
  35641. r.writeInt32(n);
  35642. break;
  35643. case e.TYPES.int64:
  35644. case e.TYPES.uint64:
  35645. r.writeVarint64(n);
  35646. break;
  35647. case e.TYPES.sint64:
  35648. r.writeVarint64ZigZag(n);
  35649. break;
  35650. case e.TYPES.fixed64:
  35651. r.writeUint64(n);
  35652. break;
  35653. case e.TYPES.sfixed64:
  35654. r.writeInt64(n);
  35655. break;
  35656. case e.TYPES.bool:
  35657. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35658. break;
  35659. case e.TYPES.enum:
  35660. r.writeVarint32(n);
  35661. break;
  35662. case e.TYPES.float:
  35663. r.writeFloat32(n);
  35664. break;
  35665. case e.TYPES.double:
  35666. r.writeFloat64(n);
  35667. break;
  35668. case e.TYPES.string:
  35669. r.writeVString(n);
  35670. break;
  35671. case e.TYPES.bytes:
  35672. if (n.remaining() < 0)
  35673. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35674. var o = n.offset;
  35675. r.writeVarint32(n.remaining()),
  35676. r.append(n),
  35677. n.offset = o;
  35678. break;
  35679. case e.TYPES.message:
  35680. var a = (new t).LE();
  35681. this.resolvedType.encode(n, a),
  35682. r.writeVarint32(a.offset),
  35683. r.append(a.flip());
  35684. break;
  35685. case e.TYPES.group:
  35686. this.resolvedType.encode(n, r),
  35687. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35688. break;
  35689. default:
  35690. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35691. }
  35692. return r
  35693. }
  35694. ,
  35695. u.decode = function(t, i, n) {
  35696. if (i != this.type.wireType)
  35697. throw Error("Unexpected wire type for element");
  35698. var r, o;
  35699. switch (this.type) {
  35700. case e.TYPES.int32:
  35701. return 0 | t.readVarint32();
  35702. case e.TYPES.uint32:
  35703. return t.readVarint32() >>> 0;
  35704. case e.TYPES.sint32:
  35705. return 0 | t.readVarint32ZigZag();
  35706. case e.TYPES.fixed32:
  35707. return t.readUint32() >>> 0;
  35708. case e.TYPES.sfixed32:
  35709. return 0 | t.readInt32();
  35710. case e.TYPES.int64:
  35711. return t.readVarint64();
  35712. case e.TYPES.uint64:
  35713. return t.readVarint64().toUnsigned();
  35714. case e.TYPES.sint64:
  35715. return t.readVarint64ZigZag();
  35716. case e.TYPES.fixed64:
  35717. return t.readUint64();
  35718. case e.TYPES.sfixed64:
  35719. return t.readInt64();
  35720. case e.TYPES.bool:
  35721. return !!t.readVarint32();
  35722. case e.TYPES.enum:
  35723. return t.readVarint32();
  35724. case e.TYPES.float:
  35725. return t.readFloat();
  35726. case e.TYPES.double:
  35727. return t.readDouble();
  35728. case e.TYPES.string:
  35729. return t.readVString();
  35730. case e.TYPES.bytes:
  35731. if (o = t.readVarint32(),
  35732. t.remaining() < o)
  35733. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35734. return r = t.clone(),
  35735. r.limit = r.offset + o,
  35736. t.offset += o,
  35737. r;
  35738. case e.TYPES.message:
  35739. return o = t.readVarint32(),
  35740. this.resolvedType.decode(t, o);
  35741. case e.TYPES.group:
  35742. return this.resolvedType.decode(t, -1, n)
  35743. }
  35744. throw Error("[INTERNAL] Illegal decode type")
  35745. }
  35746. ,
  35747. u.valueFromString = function(i) {
  35748. if (!this.isMapKey)
  35749. throw Error("valueFromString() called on non-map-key element");
  35750. switch (this.type) {
  35751. case e.TYPES.int32:
  35752. case e.TYPES.sint32:
  35753. case e.TYPES.sfixed32:
  35754. case e.TYPES.uint32:
  35755. case e.TYPES.fixed32:
  35756. return this.verifyValue(parseInt(i));
  35757. case e.TYPES.int64:
  35758. case e.TYPES.sint64:
  35759. case e.TYPES.sfixed64:
  35760. case e.TYPES.uint64:
  35761. case e.TYPES.fixed64:
  35762. return this.verifyValue(i);
  35763. case e.TYPES.bool:
  35764. return "true" === i;
  35765. case e.TYPES.string:
  35766. return this.verifyValue(i);
  35767. case e.TYPES.bytes:
  35768. return t.fromBinary(i)
  35769. }
  35770. }
  35771. ,
  35772. u.valueToString = function(t) {
  35773. if (!this.isMapKey)
  35774. throw Error("valueToString() called on non-map-key element");
  35775. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35776. }
  35777. ,
  35778. o.Element = h;
  35779. var d = function(e, t, i, n, r, o) {
  35780. l.call(this, e, t, i, n, o),
  35781. this.className = "Message",
  35782. this.extensions = void 0,
  35783. this.clazz = null,
  35784. this.isGroup = !!r,
  35785. this._fields = null,
  35786. this._fieldsById = null,
  35787. this._fieldsByName = null
  35788. }
  35789. , p = d.prototype = Object.create(l.prototype);
  35790. p.build = function(i) {
  35791. if (this.clazz && !i)
  35792. return this.clazz;
  35793. var n = function(e, i) {
  35794. function n(i, r, o, a) {
  35795. if (null === i || "object" != typeof i) {
  35796. if (a && a instanceof e.Reflect.Enum) {
  35797. var s = e.Reflect.Enum.getName(a.object, i);
  35798. if (null !== s)
  35799. return s
  35800. }
  35801. return i
  35802. }
  35803. if (t.isByteBuffer(i))
  35804. return r ? i.toBase64() : i.toBuffer();
  35805. if (e.Long.isLong(i))
  35806. return o ? i.toString() : e.Long.fromValue(i);
  35807. var l;
  35808. if (Array.isArray(i))
  35809. return l = [],
  35810. i.forEach(function(e, t) {
  35811. l[t] = n(e, r, o, a)
  35812. }),
  35813. l;
  35814. if (l = {},
  35815. i instanceof e.Map) {
  35816. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35817. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35818. return l
  35819. }
  35820. var u = i.$type
  35821. , d = void 0;
  35822. for (var p in i)
  35823. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35824. return l
  35825. }
  35826. var r = i.getChildren(e.Reflect.Message.Field)
  35827. , o = i.getChildren(e.Reflect.Message.OneOf)
  35828. , a = function(n, s) {
  35829. e.Builder.Message.call(this);
  35830. for (var l = 0, c = o.length; l < c; ++l)
  35831. this[o[l].name] = null;
  35832. for (l = 0,
  35833. c = r.length; l < c; ++l) {
  35834. var h = r[l];
  35835. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35836. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35837. }
  35838. if (arguments.length > 0) {
  35839. var u;
  35840. 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)
  35841. for (l = 0,
  35842. c = arguments.length; l < c; ++l)
  35843. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35844. else
  35845. this.$set(n)
  35846. }
  35847. }
  35848. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35849. s.add = function(t, n, r) {
  35850. var o = i._fieldsByName[t];
  35851. if (!r) {
  35852. if (!o)
  35853. throw Error(this + "#" + t + " is undefined");
  35854. if (!(o instanceof e.Reflect.Message.Field))
  35855. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35856. if (!o.repeated)
  35857. throw Error(this + "#" + t + " is not a repeated field");
  35858. n = o.verifyValue(n, !0)
  35859. }
  35860. return null === this[t] && (this[t] = []),
  35861. this[t].push(n),
  35862. this
  35863. }
  35864. ,
  35865. s.$add = s.add,
  35866. s.set = function(t, n, r) {
  35867. if (t && "object" == typeof t) {
  35868. r = n;
  35869. for (var o in t)
  35870. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35871. return this
  35872. }
  35873. var a = i._fieldsByName[t];
  35874. if (r)
  35875. this[t] = n;
  35876. else {
  35877. if (!a)
  35878. throw Error(this + "#" + t + " is not a field: undefined");
  35879. if (!(a instanceof e.Reflect.Message.Field))
  35880. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35881. this[a.name] = n = a.verifyValue(n)
  35882. }
  35883. if (a && a.oneof) {
  35884. var s = this[a.oneof.name];
  35885. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35886. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35887. }
  35888. return this
  35889. }
  35890. ,
  35891. s.$set = s.set,
  35892. s.get = function(t, n) {
  35893. if (n)
  35894. return this[t];
  35895. var r = i._fieldsByName[t];
  35896. if (!(r && r instanceof e.Reflect.Message.Field))
  35897. throw Error(this + "#" + t + " is not a field: undefined");
  35898. if (!(r instanceof e.Reflect.Message.Field))
  35899. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35900. return this[r.name]
  35901. }
  35902. ,
  35903. s.$get = s.get;
  35904. for (var l = 0; l < r.length; l++) {
  35905. var c = r[l];
  35906. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35907. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35908. return e.toUpperCase().replace("_", "")
  35909. });
  35910. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35911. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35912. return "_" + e
  35913. })
  35914. , r = function(t, i) {
  35915. return this[e.name] = i ? t : e.verifyValue(t),
  35916. this
  35917. }
  35918. , o = function() {
  35919. return this[e.name]
  35920. };
  35921. null === i.getChild("set" + t) && (s["set" + t] = r),
  35922. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35923. null === i.getChild("get" + t) && (s["get" + t] = o),
  35924. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35925. }(c)
  35926. }
  35927. s.encode = function(e, n) {
  35928. "boolean" == typeof e && (n = e,
  35929. e = void 0);
  35930. var r = !1;
  35931. e || (e = new t,
  35932. r = !0);
  35933. var o = e.littleEndian;
  35934. try {
  35935. return i.encode(this, e.LE(), n),
  35936. (r ? e.flip() : e).LE(o)
  35937. } catch (t) {
  35938. throw e.LE(o),
  35939. t
  35940. }
  35941. }
  35942. ,
  35943. a.encode = function(e, t, i) {
  35944. return new a(e).encode(t, i)
  35945. }
  35946. ,
  35947. s.calculate = function() {
  35948. return i.calculate(this)
  35949. }
  35950. ,
  35951. s.encodeDelimited = function(e, n) {
  35952. var r = !1;
  35953. e || (e = new t,
  35954. r = !0);
  35955. var o = (new t).LE();
  35956. return i.encode(this, o, n).flip(),
  35957. e.writeVarint32(o.remaining()),
  35958. e.append(o),
  35959. r ? e.flip() : e
  35960. }
  35961. ,
  35962. s.encodeAB = function() {
  35963. try {
  35964. return this.encode().toArrayBuffer()
  35965. } catch (e) {
  35966. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35967. e
  35968. }
  35969. }
  35970. ,
  35971. s.toArrayBuffer = s.encodeAB,
  35972. s.encodeNB = function() {
  35973. try {
  35974. return this.encode().toBuffer()
  35975. } catch (e) {
  35976. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35977. e
  35978. }
  35979. }
  35980. ,
  35981. s.toBuffer = s.encodeNB,
  35982. s.encode64 = function() {
  35983. try {
  35984. return this.encode().toBase64()
  35985. } catch (e) {
  35986. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35987. e
  35988. }
  35989. }
  35990. ,
  35991. s.toBase64 = s.encode64,
  35992. s.encodeHex = function() {
  35993. try {
  35994. return this.encode().toHex()
  35995. } catch (e) {
  35996. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35997. e
  35998. }
  35999. }
  36000. ,
  36001. s.toHex = s.encodeHex,
  36002. s.toRaw = function(e, t) {
  36003. return n(this, !!e, !!t, this.$type)
  36004. }
  36005. ,
  36006. s.encodeJSON = function() {
  36007. return JSON.stringify(n(this, !0, !0, this.$type))
  36008. }
  36009. ,
  36010. a.decode = function(e, n, r) {
  36011. "string" == typeof n && (r = n,
  36012. n = -1),
  36013. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36014. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36015. var o = e.littleEndian;
  36016. try {
  36017. var a = i.decode(e.LE());
  36018. return e.LE(o),
  36019. a
  36020. } catch (t) {
  36021. throw e.LE(o),
  36022. t
  36023. }
  36024. }
  36025. ,
  36026. a.decodeDelimited = function(e, n) {
  36027. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36028. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36029. e.remaining() < 1)
  36030. return null;
  36031. var r = e.offset
  36032. , o = e.readVarint32();
  36033. if (e.remaining() < o)
  36034. return e.offset = r,
  36035. null;
  36036. try {
  36037. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36038. return e.offset += o,
  36039. a
  36040. } catch (t) {
  36041. throw e.offset += o,
  36042. t
  36043. }
  36044. }
  36045. ,
  36046. a.decode64 = function(e) {
  36047. return a.decode(e, "base64")
  36048. }
  36049. ,
  36050. a.decodeHex = function(e) {
  36051. return a.decode(e, "hex")
  36052. }
  36053. ,
  36054. a.decodeJSON = function(e) {
  36055. return new a(JSON.parse(e))
  36056. }
  36057. ,
  36058. s.toString = function() {
  36059. return i.toString()
  36060. }
  36061. ;
  36062. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36063. value: i.buildOpt()
  36064. }),
  36065. Object.defineProperty(s, "$options", {
  36066. value: a.$options
  36067. }),
  36068. Object.defineProperty(a, "$type", {
  36069. value: i
  36070. }),
  36071. Object.defineProperty(s, "$type", {
  36072. value: i
  36073. })),
  36074. a
  36075. }(e, this);
  36076. this._fields = [],
  36077. this._fieldsById = {},
  36078. this._fieldsByName = {};
  36079. for (var r, o = 0, a = this.children.length; o < a; o++)
  36080. if (r = this.children[o],
  36081. r instanceof A || r instanceof d || r instanceof E) {
  36082. if (n.hasOwnProperty(r.name))
  36083. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36084. n[r.name] = r.build()
  36085. } else if (r instanceof d.Field)
  36086. r.build(),
  36087. this._fields.push(r),
  36088. this._fieldsById[r.id] = r,
  36089. this._fieldsByName[r.name] = r;
  36090. else if (!(r instanceof d.OneOf || r instanceof I))
  36091. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36092. return this.clazz = n
  36093. }
  36094. ,
  36095. p.encode = function(e, t, i) {
  36096. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36097. n = this._fields[a],
  36098. r = e[n.name],
  36099. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36100. if (null !== o) {
  36101. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36102. throw l.encoded = t,
  36103. l
  36104. }
  36105. return t
  36106. }
  36107. ,
  36108. p.calculate = function(e) {
  36109. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36110. if (t = this._fields[r],
  36111. i = e[t.name],
  36112. t.required && null === i)
  36113. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36114. n += t.calculate(i, e)
  36115. }
  36116. return n
  36117. }
  36118. ,
  36119. p.decode = function(t, i, n) {
  36120. i = "number" == typeof i ? i : -1;
  36121. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36122. if (o = t.readVarint32(),
  36123. a = 7 & o,
  36124. s = o >>> 3,
  36125. a === e.WIRE_TYPES.ENDGROUP) {
  36126. if (s !== n)
  36127. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36128. break
  36129. }
  36130. if (l = this._fieldsById[s]) {
  36131. if (l.repeated && !l.options.packed)
  36132. h[l.name].push(l.decode(a, t));
  36133. else if (l.map) {
  36134. var u = l.decode(a, t);
  36135. h[l.name].set(u[0], u[1])
  36136. } else if (h[l.name] = l.decode(a, t),
  36137. l.oneof) {
  36138. var d = h[l.oneof.name];
  36139. null !== d && d !== l.name && (h[d] = null),
  36140. h[l.oneof.name] = l.name
  36141. }
  36142. } else
  36143. switch (a) {
  36144. case e.WIRE_TYPES.VARINT:
  36145. t.readVarint32();
  36146. break;
  36147. case e.WIRE_TYPES.BITS32:
  36148. t.offset += 4;
  36149. break;
  36150. case e.WIRE_TYPES.BITS64:
  36151. t.offset += 8;
  36152. break;
  36153. case e.WIRE_TYPES.LDELIM:
  36154. var p = t.readVarint32();
  36155. t.offset += p;
  36156. break;
  36157. case e.WIRE_TYPES.STARTGROUP:
  36158. for (; r(s, t); )
  36159. ;
  36160. break;
  36161. default:
  36162. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36163. }
  36164. }
  36165. for (var f = 0, g = this._fields.length; f < g; ++f)
  36166. if (l = this._fields[f],
  36167. null === h[l.name])
  36168. if ("proto3" === this.syntax)
  36169. h[l.name] = l.defaultValue;
  36170. else {
  36171. if (l.required) {
  36172. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36173. throw m.decoded = h,
  36174. m
  36175. }
  36176. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36177. }
  36178. return h
  36179. }
  36180. ,
  36181. o.Message = d;
  36182. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36183. a.call(this, t, i, s),
  36184. this.className = "Message.Field",
  36185. this.required = "required" === n,
  36186. this.repeated = "repeated" === n,
  36187. this.map = "map" === n,
  36188. this.keyType = r || null,
  36189. this.type = o,
  36190. this.resolvedType = null,
  36191. this.id = l,
  36192. this.options = c || {},
  36193. this.defaultValue = null,
  36194. this.oneof = h || null,
  36195. this.syntax = u || "proto2",
  36196. this.originalName = this.name,
  36197. this.element = null,
  36198. this.keyElement = null,
  36199. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36200. }
  36201. , g = f.prototype = Object.create(a.prototype);
  36202. g.build = function() {
  36203. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36204. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36205. "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)
  36206. }
  36207. ,
  36208. g.verifyValue = function(t, i) {
  36209. function n(e, t) {
  36210. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36211. }
  36212. i = i || !1;
  36213. var r = this;
  36214. if (null === t)
  36215. return this.required && n(typeof t, "required"),
  36216. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36217. null;
  36218. var o;
  36219. if (this.repeated && !i) {
  36220. Array.isArray(t) || (t = [t]);
  36221. var a = [];
  36222. for (o = 0; o < t.length; o++)
  36223. a.push(this.element.verifyValue(t[o]));
  36224. return a
  36225. }
  36226. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36227. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36228. this.element.verifyValue(t))
  36229. }
  36230. ,
  36231. g.hasWirePresence = function(t, i) {
  36232. if ("proto3" !== this.syntax)
  36233. return null !== t;
  36234. if (this.oneof && i[this.oneof.name] === this.name)
  36235. return !0;
  36236. switch (this.type) {
  36237. case e.TYPES.int32:
  36238. case e.TYPES.sint32:
  36239. case e.TYPES.sfixed32:
  36240. case e.TYPES.uint32:
  36241. case e.TYPES.fixed32:
  36242. return 0 !== t;
  36243. case e.TYPES.int64:
  36244. case e.TYPES.sint64:
  36245. case e.TYPES.sfixed64:
  36246. case e.TYPES.uint64:
  36247. case e.TYPES.fixed64:
  36248. return 0 !== t.low || 0 !== t.high;
  36249. case e.TYPES.bool:
  36250. return t;
  36251. case e.TYPES.float:
  36252. case e.TYPES.double:
  36253. return 0 !== t;
  36254. case e.TYPES.string:
  36255. return t.length > 0;
  36256. case e.TYPES.bytes:
  36257. return t.remaining() > 0;
  36258. case e.TYPES.enum:
  36259. return 0 !== t;
  36260. case e.TYPES.message:
  36261. return null !== t;
  36262. default:
  36263. return !0
  36264. }
  36265. }
  36266. ,
  36267. g.encode = function(i, n, r) {
  36268. if (null === this.type || "object" != typeof this.type)
  36269. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36270. if (null === i || this.repeated && 0 == i.length)
  36271. return n;
  36272. try {
  36273. if (this.repeated) {
  36274. var o;
  36275. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36276. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36277. n.ensureCapacity(n.offset += 1);
  36278. var a = n.offset;
  36279. for (o = 0; o < i.length; o++)
  36280. this.element.encodeValue(this.id, i[o], n);
  36281. var s = n.offset - a
  36282. , l = t.calculateVarint32(s);
  36283. if (l > 1) {
  36284. var c = n.slice(a, n.offset);
  36285. a += l - 1,
  36286. n.offset = a,
  36287. n.append(c)
  36288. }
  36289. n.writeVarint32(s, a - l)
  36290. } else
  36291. for (o = 0; o < i.length; o++)
  36292. n.writeVarint32(this.id << 3 | this.type.wireType),
  36293. this.element.encodeValue(this.id, i[o], n)
  36294. } else
  36295. this.map ? i.forEach(function(i, r, o) {
  36296. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36297. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36298. n.writeVarint32(a),
  36299. n.writeVarint32(8 | this.keyType.wireType),
  36300. this.keyElement.encodeValue(1, r, n),
  36301. n.writeVarint32(16 | this.type.wireType),
  36302. this.element.encodeValue(2, i, n)
  36303. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36304. this.element.encodeValue(this.id, i, n))
  36305. } catch (e) {
  36306. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36307. }
  36308. return n
  36309. }
  36310. ,
  36311. g.calculate = function(i, n) {
  36312. if (i = this.verifyValue(i),
  36313. null === this.type || "object" != typeof this.type)
  36314. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36315. if (null === i || this.repeated && 0 == i.length)
  36316. return 0;
  36317. var r = 0;
  36318. try {
  36319. if (this.repeated) {
  36320. var o, a;
  36321. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36322. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36323. a = 0,
  36324. o = 0; o < i.length; o++)
  36325. a += this.element.calculateLength(this.id, i[o]);
  36326. r += t.calculateVarint32(a),
  36327. r += a
  36328. } else
  36329. for (o = 0; o < i.length; o++)
  36330. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36331. r += this.element.calculateLength(this.id, i[o])
  36332. } else
  36333. this.map ? i.forEach(function(i, n, o) {
  36334. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36335. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36336. r += t.calculateVarint32(a),
  36337. r += a
  36338. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36339. r += this.element.calculateLength(this.id, i))
  36340. } catch (e) {
  36341. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36342. }
  36343. return r
  36344. }
  36345. ,
  36346. g.decode = function(t, i, n) {
  36347. 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;
  36348. if (!a)
  36349. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36350. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36351. o = i.readVarint32(),
  36352. o = i.offset + o;
  36353. for (var s = []; i.offset < o; )
  36354. s.push(this.decode(this.type.wireType, i, !0));
  36355. return s
  36356. }
  36357. if (this.map) {
  36358. var l = h.defaultFieldValue(this.keyType);
  36359. if (r = h.defaultFieldValue(this.type),
  36360. o = i.readVarint32(),
  36361. i.remaining() < o)
  36362. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36363. var c = i.clone();
  36364. for (c.limit = c.offset + o,
  36365. i.offset += o; c.remaining() > 0; ) {
  36366. var u = c.readVarint32();
  36367. t = 7 & u;
  36368. var d = u >>> 3;
  36369. if (1 === d)
  36370. l = this.keyElement.decode(c, t, d);
  36371. else {
  36372. if (2 !== d)
  36373. throw Error("Unexpected tag in map field key/value submessage");
  36374. r = this.element.decode(c, t, d)
  36375. }
  36376. }
  36377. return [l, r]
  36378. }
  36379. return this.element.decode(i, t, this.id)
  36380. }
  36381. ,
  36382. o.Message.Field = f;
  36383. var m = function(e, t, i, n, r, o, a) {
  36384. f.call(this, e, t, i, null, n, r, o, a),
  36385. this.extension
  36386. };
  36387. m.prototype = Object.create(f.prototype),
  36388. o.Message.ExtensionField = m;
  36389. var v = function(e, t, i) {
  36390. a.call(this, e, t, i),
  36391. this.fields = []
  36392. };
  36393. o.Message.OneOf = v;
  36394. var A = function(e, t, i, n, r) {
  36395. l.call(this, e, t, i, n, r),
  36396. this.className = "Enum",
  36397. this.object = null
  36398. };
  36399. A.getName = function(e, t) {
  36400. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36401. if (e[i = n[r]] === t)
  36402. return i;
  36403. return null
  36404. }
  36405. ;
  36406. var y = A.prototype = Object.create(l.prototype);
  36407. y.build = function(t) {
  36408. if (this.object && !t)
  36409. return this.object;
  36410. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36411. i[n[r].name] = n[r].id;
  36412. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36413. value: this.buildOpt(),
  36414. enumerable: !1
  36415. }),
  36416. this.object = i
  36417. }
  36418. ,
  36419. o.Enum = A;
  36420. var C = function(e, t, i, n) {
  36421. a.call(this, e, t, i),
  36422. this.className = "Enum.Value",
  36423. this.id = n
  36424. };
  36425. C.prototype = Object.create(a.prototype),
  36426. o.Enum.Value = C;
  36427. var I = function(e, t, i, n) {
  36428. a.call(this, e, t, i),
  36429. this.field = n
  36430. };
  36431. I.prototype = Object.create(a.prototype),
  36432. o.Extension = I;
  36433. var E = function(e, t, i, n) {
  36434. l.call(this, e, t, i, n),
  36435. this.className = "Service",
  36436. this.clazz = null
  36437. }
  36438. , b = E.prototype = Object.create(l.prototype);
  36439. b.build = function(i) {
  36440. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36441. for (var n = function(t) {
  36442. e.Builder.Service.call(this),
  36443. this.rpcImpl = t || function(e, t, i) {
  36444. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36445. }
  36446. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36447. !function(e) {
  36448. r[e.name] = function(n, r) {
  36449. try {
  36450. try {
  36451. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36452. } catch (e) {
  36453. if (!(e instanceof TypeError))
  36454. throw e
  36455. }
  36456. if (null === n || "object" != typeof n)
  36457. throw Error("Illegal arguments");
  36458. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36459. this.rpcImpl(e.fqn(), n, function(t, n) {
  36460. if (t)
  36461. return void r(t);
  36462. null === n && (n = "");
  36463. try {
  36464. n = e.resolvedResponseType.clazz.decode(n)
  36465. } catch (e) {}
  36466. 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))
  36467. })
  36468. } catch (e) {
  36469. setTimeout(r.bind(this, e), 0)
  36470. }
  36471. }
  36472. ,
  36473. n[e.name] = function(t, i, r) {
  36474. new n(t)[e.name](i, r)
  36475. }
  36476. ,
  36477. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36478. value: e.buildOpt()
  36479. }),
  36480. Object.defineProperty(r[e.name], "$options", {
  36481. value: n[e.name].$options
  36482. }))
  36483. }(o[a]);
  36484. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36485. value: i.buildOpt()
  36486. }),
  36487. Object.defineProperty(r, "$options", {
  36488. value: n.$options
  36489. }),
  36490. Object.defineProperty(n, "$type", {
  36491. value: i
  36492. }),
  36493. Object.defineProperty(r, "$type", {
  36494. value: i
  36495. })),
  36496. n
  36497. }(e, this)
  36498. }
  36499. ,
  36500. o.Service = E;
  36501. var w = function(e, t, i, n) {
  36502. a.call(this, e, t, i),
  36503. this.className = "Service.Method",
  36504. this.options = n || {}
  36505. }
  36506. , _ = w.prototype = Object.create(a.prototype);
  36507. _.buildOpt = c.buildOpt,
  36508. o.Service.Method = w;
  36509. var T = function(e, t, i, n, r, o, a, s) {
  36510. w.call(this, e, t, i, s),
  36511. this.className = "Service.RPCMethod",
  36512. this.requestName = n,
  36513. this.responseName = r,
  36514. this.requestStream = o,
  36515. this.responseStream = a,
  36516. this.resolvedRequestType = null,
  36517. this.resolvedResponseType = null
  36518. };
  36519. return T.prototype = Object.create(w.prototype),
  36520. o.Service.RPCMethod = T,
  36521. o
  36522. }(r),
  36523. r.Builder = function(t, i, n) {
  36524. function r(e) {
  36525. e.messages && e.messages.forEach(function(t) {
  36526. t.syntax = e.syntax,
  36527. r(t)
  36528. }),
  36529. e.enums && e.enums.forEach(function(t) {
  36530. t.syntax = e.syntax
  36531. })
  36532. }
  36533. var o = function(e) {
  36534. this.ns = new n.Namespace(this,null,""),
  36535. this.ptr = this.ns,
  36536. this.resolved = !1,
  36537. this.result = null,
  36538. this.files = {},
  36539. this.importRoot = null,
  36540. this.options = e || {}
  36541. }
  36542. , a = o.prototype;
  36543. return o.isMessage = function(e) {
  36544. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36545. }
  36546. ,
  36547. o.isMessageField = function(e) {
  36548. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36549. }
  36550. ,
  36551. o.isEnum = function(e) {
  36552. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36553. }
  36554. ,
  36555. o.isService = function(e) {
  36556. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36557. }
  36558. ,
  36559. o.isExtend = function(e) {
  36560. return "string" == typeof e.ref
  36561. }
  36562. ,
  36563. a.reset = function() {
  36564. return this.ptr = this.ns,
  36565. this
  36566. }
  36567. ,
  36568. a.define = function(e) {
  36569. if ("string" != typeof e || !i.TYPEREF.test(e))
  36570. throw Error("illegal namespace: " + e);
  36571. return e.split(".").forEach(function(e) {
  36572. var t = this.ptr.getChild(e);
  36573. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36574. this.ptr = t
  36575. }, this),
  36576. this
  36577. }
  36578. ,
  36579. a.create = function(e) {
  36580. if (!e)
  36581. return this;
  36582. if (Array.isArray(e)) {
  36583. if (0 === e.length)
  36584. return this;
  36585. e = e.slice()
  36586. } else
  36587. e = [e];
  36588. for (var i = [e]; i.length > 0; ) {
  36589. if (e = i.pop(),
  36590. !Array.isArray(e))
  36591. throw Error("not a valid namespace: " + JSON.stringify(e));
  36592. for (; e.length > 0; ) {
  36593. var r = e.shift();
  36594. if (o.isMessage(r)) {
  36595. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36596. , s = {};
  36597. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36598. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36599. }, this),
  36600. r.fields && r.fields.forEach(function(e) {
  36601. if (null !== a.getChild(0 | e.id))
  36602. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36603. if (e.options && "object" != typeof e.options)
  36604. throw Error("illegal field options in " + a.name + "#" + e.name);
  36605. var t = null;
  36606. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36607. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36608. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36609. t && t.fields.push(e),
  36610. a.addChild(e)
  36611. }, this);
  36612. var l = [];
  36613. if (r.enums && r.enums.forEach(function(e) {
  36614. l.push(e)
  36615. }),
  36616. r.messages && r.messages.forEach(function(e) {
  36617. l.push(e)
  36618. }),
  36619. r.services && r.services.forEach(function(e) {
  36620. l.push(e)
  36621. }),
  36622. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36623. this.ptr.addChild(a),
  36624. l.length > 0) {
  36625. i.push(e),
  36626. e = l,
  36627. l = null,
  36628. this.ptr = a,
  36629. a = null;
  36630. continue
  36631. }
  36632. l = null
  36633. } else if (o.isEnum(r))
  36634. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36635. r.values.forEach(function(e) {
  36636. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36637. }, this),
  36638. this.ptr.addChild(a);
  36639. else if (o.isService(r))
  36640. a = new n.Service(this,this.ptr,r.name,r.options),
  36641. Object.keys(r.rpc).forEach(function(e) {
  36642. var t = r.rpc[e];
  36643. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36644. }, this),
  36645. this.ptr.addChild(a);
  36646. else {
  36647. if (!o.isExtend(r))
  36648. throw Error("not a valid definition: " + JSON.stringify(r));
  36649. if (a = this.ptr.resolve(r.ref, !0))
  36650. r.fields.forEach(function(e) {
  36651. if (null !== a.getChild(0 | e.id))
  36652. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36653. if (a.extensions) {
  36654. var i = !1;
  36655. if (a.extensions.forEach(function(t) {
  36656. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36657. }),
  36658. !i)
  36659. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36660. }
  36661. var r = e.name;
  36662. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36663. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36664. , s = new n.Extension(this,this.ptr,e.name,o);
  36665. o.extension = s,
  36666. this.ptr.addChild(s),
  36667. a.addChild(o)
  36668. }, this);
  36669. else if (!/\.?google\.protobuf\./.test(r.ref))
  36670. throw Error("extended message " + r.ref + " is not defined")
  36671. }
  36672. r = null,
  36673. a = null
  36674. }
  36675. e = null,
  36676. this.ptr = this.ptr.parent
  36677. }
  36678. return this.resolved = !1,
  36679. this.result = null,
  36680. this
  36681. }
  36682. ,
  36683. a.import = function(i, n) {
  36684. var o = "/";
  36685. if ("string" == typeof n) {
  36686. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36687. this.files[n] === !0)
  36688. return this.reset();
  36689. this.files[n] = !0
  36690. } else if ("object" == typeof n) {
  36691. var a = n.root;
  36692. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36693. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36694. var s = a + o + n.file;
  36695. if (this.files[s] === !0)
  36696. return this.reset();
  36697. this.files[s] = !0
  36698. }
  36699. if (i.imports && i.imports.length > 0) {
  36700. var l, c = !1;
  36701. "object" == typeof n ? (this.importRoot = n.root,
  36702. c = !0,
  36703. l = this.importRoot,
  36704. n = n.file,
  36705. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36706. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36707. o = "\\") : l = "." : l = null;
  36708. for (var h = 0; h < i.imports.length; h++)
  36709. if ("string" == typeof i.imports[h]) {
  36710. if (!l)
  36711. throw Error("cannot determine import root");
  36712. var u = i.imports[h];
  36713. if ("google/protobuf/descriptor.proto" === u)
  36714. continue;
  36715. if (u = l + o + u,
  36716. this.files[u] === !0)
  36717. continue;
  36718. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36719. var d = t.Util.fetch(u);
  36720. if (null === d)
  36721. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36722. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36723. } else
  36724. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36725. return t + "_import" + h + "." + i
  36726. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36727. c && (this.importRoot = null)
  36728. }
  36729. i.package && this.define(i.package),
  36730. i.syntax && r(i);
  36731. var p = this.ptr;
  36732. return i.options && Object.keys(i.options).forEach(function(e) {
  36733. p.options[e] = i.options[e]
  36734. }),
  36735. i.messages && (this.create(i.messages),
  36736. this.ptr = p),
  36737. i.enums && (this.create(i.enums),
  36738. this.ptr = p),
  36739. i.services && (this.create(i.services),
  36740. this.ptr = p),
  36741. i.extends && this.create(i.extends),
  36742. this.reset()
  36743. }
  36744. ,
  36745. a.resolveAll = function() {
  36746. var e;
  36747. if (null == this.ptr || "object" == typeof this.ptr.type)
  36748. return this;
  36749. if (this.ptr instanceof n.Namespace)
  36750. this.ptr.children.forEach(function(e) {
  36751. this.ptr = e,
  36752. this.resolveAll()
  36753. }, this);
  36754. else if (this.ptr instanceof n.Message.Field) {
  36755. if (i.TYPE.test(this.ptr.type))
  36756. this.ptr.type = t.TYPES[this.ptr.type];
  36757. else {
  36758. if (!i.TYPEREF.test(this.ptr.type))
  36759. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36760. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36761. !e)
  36762. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36763. if (this.ptr.resolvedType = e,
  36764. e instanceof n.Enum) {
  36765. if (this.ptr.type = t.TYPES.enum,
  36766. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36767. throw Error("proto3 message cannot reference proto2 enum")
  36768. } else {
  36769. if (!(e instanceof n.Message))
  36770. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36771. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36772. }
  36773. }
  36774. if (this.ptr.map) {
  36775. if (!i.TYPE.test(this.ptr.keyType))
  36776. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36777. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36778. }
  36779. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36780. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36781. throw Error("illegal service type in " + this.ptr.toString(!0));
  36782. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36783. !(e && e instanceof t.Reflect.Message))
  36784. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36785. if (this.ptr.resolvedRequestType = e,
  36786. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36787. !(e && e instanceof t.Reflect.Message))
  36788. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36789. this.ptr.resolvedResponseType = e
  36790. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36791. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36792. return this.reset()
  36793. }
  36794. ,
  36795. a.build = function(e) {
  36796. if (this.reset(),
  36797. this.resolved || (this.resolveAll(),
  36798. this.resolved = !0,
  36799. this.result = null),
  36800. null === this.result && (this.result = this.ns.build()),
  36801. !e)
  36802. return this.result;
  36803. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36804. if (!i[t[n]]) {
  36805. i = null;
  36806. break
  36807. }
  36808. i = i[t[n]]
  36809. }
  36810. return i
  36811. }
  36812. ,
  36813. a.lookup = function(e, t) {
  36814. return e ? this.ns.resolve(e, t) : this.ns
  36815. }
  36816. ,
  36817. a.toString = function() {
  36818. return "Builder"
  36819. }
  36820. ,
  36821. o.Message = function() {}
  36822. ,
  36823. o.Enum = function() {}
  36824. ,
  36825. o.Service = function() {}
  36826. ,
  36827. o
  36828. }(r, r.Lang, r.Reflect),
  36829. r.Map = function(e, t) {
  36830. function i(e) {
  36831. var t = 0;
  36832. return {
  36833. next: function() {
  36834. return t < e.length ? {
  36835. done: !1,
  36836. value: e[t++]
  36837. } : {
  36838. done: !0
  36839. }
  36840. }
  36841. }
  36842. }
  36843. var n = function(e, i) {
  36844. if (!e.map)
  36845. throw Error("field is not a map");
  36846. if (this.field = e,
  36847. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36848. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36849. this.map = {},
  36850. Object.defineProperty(this, "size", {
  36851. get: function() {
  36852. return Object.keys(this.map).length
  36853. }
  36854. }),
  36855. i)
  36856. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36857. var o = this.keyElem.valueFromString(n[r])
  36858. , a = this.valueElem.verifyValue(i[n[r]]);
  36859. this.map[this.keyElem.valueToString(o)] = {
  36860. key: o,
  36861. value: a
  36862. }
  36863. }
  36864. }
  36865. , r = n.prototype;
  36866. return r.clear = function() {
  36867. this.map = {}
  36868. }
  36869. ,
  36870. r.delete = function(e) {
  36871. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36872. , i = t in this.map;
  36873. return delete this.map[t],
  36874. i
  36875. }
  36876. ,
  36877. r.entries = function() {
  36878. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36879. t.push([(e = this.map[n[r]]).key, e.value]);
  36880. return i(t)
  36881. }
  36882. ,
  36883. r.keys = function() {
  36884. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36885. e.push(this.map[t[n]].key);
  36886. return i(e)
  36887. }
  36888. ,
  36889. r.values = function() {
  36890. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36891. e.push(this.map[t[n]].value);
  36892. return i(e)
  36893. }
  36894. ,
  36895. r.forEach = function(e, t) {
  36896. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36897. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36898. }
  36899. ,
  36900. r.set = function(e, t) {
  36901. var i = this.keyElem.verifyValue(e)
  36902. , n = this.valueElem.verifyValue(t);
  36903. return this.map[this.keyElem.valueToString(i)] = {
  36904. key: i,
  36905. value: n
  36906. },
  36907. this
  36908. }
  36909. ,
  36910. r.get = function(e) {
  36911. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36912. if (t in this.map)
  36913. return this.map[t].value
  36914. }
  36915. ,
  36916. r.has = function(e) {
  36917. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36918. return t in this.map
  36919. }
  36920. ,
  36921. n
  36922. }(r, r.Reflect),
  36923. r.loadProto = function(e, t, i) {
  36924. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36925. t = void 0),
  36926. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36927. }
  36928. ,
  36929. r.protoFromString = r.loadProto,
  36930. r.loadProtoFile = function(e, t, i) {
  36931. if (t && "object" == typeof t ? (i = t,
  36932. t = null) : t && "function" == typeof t || (t = null),
  36933. t)
  36934. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36935. if (null === n)
  36936. return void t(Error("Failed to fetch file"));
  36937. try {
  36938. t(null, r.loadProto(n, i, e))
  36939. } catch (e) {
  36940. t(e)
  36941. }
  36942. });
  36943. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36944. return null === n ? null : r.loadProto(n, i, e)
  36945. }
  36946. ,
  36947. r.protoFromFile = r.loadProtoFile,
  36948. r.newBuilder = function(e) {
  36949. return e = e || {},
  36950. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36951. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36952. new r.Builder(e)
  36953. }
  36954. ,
  36955. r.loadJson = function(e, t, i) {
  36956. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36957. t = null),
  36958. t && "object" == typeof t || (t = r.newBuilder()),
  36959. "string" == typeof e && (e = JSON.parse(e)),
  36960. t.import(e, i),
  36961. t.resolveAll(),
  36962. t
  36963. }
  36964. ,
  36965. r.loadJsonFile = function(e, t, i) {
  36966. if (t && "object" == typeof t ? (i = t,
  36967. t = null) : t && "function" == typeof t || (t = null),
  36968. t)
  36969. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36970. if (null === n)
  36971. return void t(Error("Failed to fetch file"));
  36972. try {
  36973. t(null, r.loadJson(JSON.parse(n), i, e))
  36974. } catch (e) {
  36975. t(e)
  36976. }
  36977. });
  36978. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36979. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36980. }
  36981. ,
  36982. r
  36983. })
  36984. }
  36985. ).call(this, e("_process"))
  36986. }
  36987. , {
  36988. _process: 203,
  36989. bytebuffer: 215,
  36990. fs: 197,
  36991. path: 197
  36992. }],
  36993. 215: [function(e, t, i) {
  36994. !function(i, n) {
  36995. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36996. var t;
  36997. try {
  36998. t = e("long")
  36999. } catch (e) {}
  37000. return n(t)
  37001. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37002. }(this, function(e) {
  37003. "use strict";
  37004. function t(e) {
  37005. var t = 0;
  37006. return function() {
  37007. return t < e.length ? e.charCodeAt(t++) : null
  37008. }
  37009. }
  37010. function i() {
  37011. var e = []
  37012. , t = [];
  37013. return function() {
  37014. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37015. e.length = 0),
  37016. void Array.prototype.push.apply(e, arguments))
  37017. }
  37018. }
  37019. function n(e, t, i, n, r) {
  37020. 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];
  37021. for (u += d,
  37022. o = p & (1 << -h) - 1,
  37023. p >>= -h,
  37024. h += s; h > 0; o = 256 * o + e[t + u],
  37025. u += d,
  37026. h -= 8)
  37027. ;
  37028. for (a = o & (1 << -h) - 1,
  37029. o >>= -h,
  37030. h += n; h > 0; a = 256 * a + e[t + u],
  37031. u += d,
  37032. h -= 8)
  37033. ;
  37034. if (0 === o)
  37035. o = 1 - c;
  37036. else {
  37037. if (o === l)
  37038. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37039. a += Math.pow(2, n),
  37040. o -= c
  37041. }
  37042. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37043. }
  37044. function r(e, t, i, n, r, o) {
  37045. 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;
  37046. for (t = Math.abs(t),
  37047. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37048. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37049. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37050. l *= 2),
  37051. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37052. t * l >= 2 && (a++,
  37053. l /= 2),
  37054. a + u >= h ? (s = 0,
  37055. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37056. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37057. a = 0)); r >= 8; e[i + p] = 255 & s,
  37058. p += f,
  37059. s /= 256,
  37060. r -= 8)
  37061. ;
  37062. for (a = a << r | s,
  37063. c += r; c > 0; e[i + p] = 255 & a,
  37064. p += f,
  37065. a /= 256,
  37066. c -= 8)
  37067. ;
  37068. e[i + p - f] |= 128 * g
  37069. }
  37070. var o = function(e, t, i) {
  37071. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37072. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37073. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37074. !i) {
  37075. if (e |= 0,
  37076. e < 0)
  37077. throw RangeError("Illegal capacity");
  37078. t = !!t,
  37079. i = !!i
  37080. }
  37081. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37082. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37083. this.offset = 0,
  37084. this.markedOffset = -1,
  37085. this.limit = e,
  37086. this.littleEndian = t,
  37087. this.noAssert = i
  37088. };
  37089. o.VERSION = "5.0.1",
  37090. o.LITTLE_ENDIAN = !0,
  37091. o.BIG_ENDIAN = !1,
  37092. o.DEFAULT_CAPACITY = 16,
  37093. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37094. o.DEFAULT_NOASSERT = !1,
  37095. o.Long = e || null;
  37096. var a = o.prototype;
  37097. a.__isByteBuffer__,
  37098. Object.defineProperty(a, "__isByteBuffer__", {
  37099. value: !0,
  37100. enumerable: !1,
  37101. configurable: !1
  37102. });
  37103. var s = new ArrayBuffer(0)
  37104. , l = String.fromCharCode;
  37105. o.accessor = function() {
  37106. return Uint8Array
  37107. }
  37108. ,
  37109. o.allocate = function(e, t, i) {
  37110. return new o(e,t,i)
  37111. }
  37112. ,
  37113. o.concat = function(e, t, i, n) {
  37114. "boolean" != typeof t && "string" == typeof t || (n = i,
  37115. i = t,
  37116. t = void 0);
  37117. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37118. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37119. r = e[s].limit - e[s].offset,
  37120. r > 0 && (a += r);
  37121. if (0 === a)
  37122. return new o(0,i,n);
  37123. var c, h = new o(a,i,n);
  37124. for (s = 0; s < l; )
  37125. c = e[s++],
  37126. r = c.limit - c.offset,
  37127. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37128. h.offset += r);
  37129. return h.limit = h.offset,
  37130. h.offset = 0,
  37131. h
  37132. }
  37133. ,
  37134. o.isByteBuffer = function(e) {
  37135. return (e && e.__isByteBuffer__) === !0
  37136. }
  37137. ,
  37138. o.type = function() {
  37139. return ArrayBuffer
  37140. }
  37141. ,
  37142. o.wrap = function(e, t, i, n) {
  37143. if ("string" != typeof t && (n = i,
  37144. i = t,
  37145. t = void 0),
  37146. "string" == typeof e)
  37147. switch ("undefined" == typeof t && (t = "utf8"),
  37148. t) {
  37149. case "base64":
  37150. return o.fromBase64(e, i);
  37151. case "hex":
  37152. return o.fromHex(e, i);
  37153. case "binary":
  37154. return o.fromBinary(e, i);
  37155. case "utf8":
  37156. return o.fromUTF8(e, i);
  37157. case "debug":
  37158. return o.fromDebug(e, i);
  37159. default:
  37160. throw Error("Unsupported encoding: " + t)
  37161. }
  37162. if (null === e || "object" != typeof e)
  37163. throw TypeError("Illegal buffer");
  37164. var r;
  37165. if (o.isByteBuffer(e))
  37166. return r = a.clone.call(e),
  37167. r.markedOffset = -1,
  37168. r;
  37169. if (e instanceof Uint8Array)
  37170. r = new o(0,i,n),
  37171. e.length > 0 && (r.buffer = e.buffer,
  37172. r.offset = e.byteOffset,
  37173. r.limit = e.byteOffset + e.byteLength,
  37174. r.view = new Uint8Array(e.buffer));
  37175. else if (e instanceof ArrayBuffer)
  37176. r = new o(0,i,n),
  37177. e.byteLength > 0 && (r.buffer = e,
  37178. r.offset = 0,
  37179. r.limit = e.byteLength,
  37180. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37181. else {
  37182. if ("[object Array]" !== Object.prototype.toString.call(e))
  37183. throw TypeError("Illegal buffer");
  37184. r = new o(e.length,i,n),
  37185. r.limit = e.length;
  37186. for (var s = 0; s < e.length; ++s)
  37187. r.view[s] = e[s]
  37188. }
  37189. return r
  37190. }
  37191. ,
  37192. a.writeBitSet = function(e, t) {
  37193. var i = "undefined" == typeof t;
  37194. if (i && (t = this.offset),
  37195. !this.noAssert) {
  37196. if (!(e instanceof Array))
  37197. throw TypeError("Illegal BitSet: Not an array");
  37198. if ("number" != typeof t || t % 1 !== 0)
  37199. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37200. if (t >>>= 0,
  37201. t < 0 || t + 0 > this.buffer.byteLength)
  37202. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37203. }
  37204. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37205. for (t += this.writeVarint32(o, t); a--; )
  37206. 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,
  37207. this.writeByte(n, t++);
  37208. if (s < o) {
  37209. var l = 0;
  37210. for (n = 0; s < o; )
  37211. n |= (1 & !!e[s++]) << l++;
  37212. this.writeByte(n, t++)
  37213. }
  37214. return i ? (this.offset = t,
  37215. this) : t - r
  37216. }
  37217. ,
  37218. a.readBitSet = function(e) {
  37219. var t = "undefined" == typeof e;
  37220. t && (e = this.offset);
  37221. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37222. for (e += n.length; o--; )
  37223. i = this.readByte(e++),
  37224. s[a++] = !!(1 & i),
  37225. s[a++] = !!(2 & i),
  37226. s[a++] = !!(4 & i),
  37227. s[a++] = !!(8 & i),
  37228. s[a++] = !!(16 & i),
  37229. s[a++] = !!(32 & i),
  37230. s[a++] = !!(64 & i),
  37231. s[a++] = !!(128 & i);
  37232. if (a < r) {
  37233. var l = 0;
  37234. for (i = this.readByte(e++); a < r; )
  37235. s[a++] = !!(i >> l++ & 1)
  37236. }
  37237. return t && (this.offset = e),
  37238. s
  37239. }
  37240. ,
  37241. a.readBytes = function(e, t) {
  37242. var i = "undefined" == typeof t;
  37243. if (i && (t = this.offset),
  37244. !this.noAssert) {
  37245. if ("number" != typeof t || t % 1 !== 0)
  37246. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37247. if (t >>>= 0,
  37248. t < 0 || t + e > this.buffer.byteLength)
  37249. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37250. }
  37251. var n = this.slice(t, t + e);
  37252. return i && (this.offset += e),
  37253. n
  37254. }
  37255. ,
  37256. a.writeBytes = a.append,
  37257. a.writeInt8 = function(e, t) {
  37258. var i = "undefined" == typeof t;
  37259. if (i && (t = this.offset),
  37260. !this.noAssert) {
  37261. if ("number" != typeof e || e % 1 !== 0)
  37262. throw TypeError("Illegal value: " + e + " (not an integer)");
  37263. if (e |= 0,
  37264. "number" != typeof t || t % 1 !== 0)
  37265. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37266. if (t >>>= 0,
  37267. t < 0 || t + 0 > this.buffer.byteLength)
  37268. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37269. }
  37270. t += 1;
  37271. var n = this.buffer.byteLength;
  37272. return t > n && this.resize((n *= 2) > t ? n : t),
  37273. t -= 1,
  37274. this.view[t] = e,
  37275. i && (this.offset += 1),
  37276. this
  37277. }
  37278. ,
  37279. a.writeByte = a.writeInt8,
  37280. a.readInt8 = function(e) {
  37281. var t = "undefined" == typeof e;
  37282. if (t && (e = this.offset),
  37283. !this.noAssert) {
  37284. if ("number" != typeof e || e % 1 !== 0)
  37285. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37286. if (e >>>= 0,
  37287. e < 0 || e + 1 > this.buffer.byteLength)
  37288. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37289. }
  37290. var i = this.view[e];
  37291. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37292. t && (this.offset += 1),
  37293. i
  37294. }
  37295. ,
  37296. a.readByte = a.readInt8,
  37297. a.writeUint8 = function(e, t) {
  37298. var i = "undefined" == typeof t;
  37299. if (i && (t = this.offset),
  37300. !this.noAssert) {
  37301. if ("number" != typeof e || e % 1 !== 0)
  37302. throw TypeError("Illegal value: " + e + " (not an integer)");
  37303. if (e >>>= 0,
  37304. "number" != typeof t || t % 1 !== 0)
  37305. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37306. if (t >>>= 0,
  37307. t < 0 || t + 0 > this.buffer.byteLength)
  37308. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37309. }
  37310. t += 1;
  37311. var n = this.buffer.byteLength;
  37312. return t > n && this.resize((n *= 2) > t ? n : t),
  37313. t -= 1,
  37314. this.view[t] = e,
  37315. i && (this.offset += 1),
  37316. this
  37317. }
  37318. ,
  37319. a.writeUInt8 = a.writeUint8,
  37320. a.readUint8 = function(e) {
  37321. var t = "undefined" == typeof e;
  37322. if (t && (e = this.offset),
  37323. !this.noAssert) {
  37324. if ("number" != typeof e || e % 1 !== 0)
  37325. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37326. if (e >>>= 0,
  37327. e < 0 || e + 1 > this.buffer.byteLength)
  37328. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37329. }
  37330. var i = this.view[e];
  37331. return t && (this.offset += 1),
  37332. i
  37333. }
  37334. ,
  37335. a.readUInt8 = a.readUint8,
  37336. a.writeInt16 = function(e, t) {
  37337. var i = "undefined" == typeof t;
  37338. if (i && (t = this.offset),
  37339. !this.noAssert) {
  37340. if ("number" != typeof e || e % 1 !== 0)
  37341. throw TypeError("Illegal value: " + e + " (not an integer)");
  37342. if (e |= 0,
  37343. "number" != typeof t || t % 1 !== 0)
  37344. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37345. if (t >>>= 0,
  37346. t < 0 || t + 0 > this.buffer.byteLength)
  37347. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37348. }
  37349. t += 2;
  37350. var n = this.buffer.byteLength;
  37351. return t > n && this.resize((n *= 2) > t ? n : t),
  37352. t -= 2,
  37353. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37354. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37355. this.view[t + 1] = 255 & e),
  37356. i && (this.offset += 2),
  37357. this
  37358. }
  37359. ,
  37360. a.writeShort = a.writeInt16,
  37361. a.readInt16 = function(e) {
  37362. var t = "undefined" == typeof e;
  37363. if (t && (e = this.offset),
  37364. !this.noAssert) {
  37365. if ("number" != typeof e || e % 1 !== 0)
  37366. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37367. if (e >>>= 0,
  37368. e < 0 || e + 2 > this.buffer.byteLength)
  37369. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37370. }
  37371. var i = 0;
  37372. return this.littleEndian ? (i = this.view[e],
  37373. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37374. i |= this.view[e + 1]),
  37375. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37376. t && (this.offset += 2),
  37377. i
  37378. }
  37379. ,
  37380. a.readShort = a.readInt16,
  37381. a.writeUint16 = function(e, t) {
  37382. var i = "undefined" == typeof t;
  37383. if (i && (t = this.offset),
  37384. !this.noAssert) {
  37385. if ("number" != typeof e || e % 1 !== 0)
  37386. throw TypeError("Illegal value: " + e + " (not an integer)");
  37387. if (e >>>= 0,
  37388. "number" != typeof t || t % 1 !== 0)
  37389. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37390. if (t >>>= 0,
  37391. t < 0 || t + 0 > this.buffer.byteLength)
  37392. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37393. }
  37394. t += 2;
  37395. var n = this.buffer.byteLength;
  37396. return t > n && this.resize((n *= 2) > t ? n : t),
  37397. t -= 2,
  37398. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37399. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37400. this.view[t + 1] = 255 & e),
  37401. i && (this.offset += 2),
  37402. this
  37403. }
  37404. ,
  37405. a.writeUInt16 = a.writeUint16,
  37406. a.readUint16 = function(e) {
  37407. var t = "undefined" == typeof e;
  37408. if (t && (e = this.offset),
  37409. !this.noAssert) {
  37410. if ("number" != typeof e || e % 1 !== 0)
  37411. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37412. if (e >>>= 0,
  37413. e < 0 || e + 2 > this.buffer.byteLength)
  37414. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37415. }
  37416. var i = 0;
  37417. return this.littleEndian ? (i = this.view[e],
  37418. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37419. i |= this.view[e + 1]),
  37420. t && (this.offset += 2),
  37421. i
  37422. }
  37423. ,
  37424. a.readUInt16 = a.readUint16,
  37425. a.writeInt32 = function(e, t) {
  37426. var i = "undefined" == typeof t;
  37427. if (i && (t = this.offset),
  37428. !this.noAssert) {
  37429. if ("number" != typeof e || e % 1 !== 0)
  37430. throw TypeError("Illegal value: " + e + " (not an integer)");
  37431. if (e |= 0,
  37432. "number" != typeof t || t % 1 !== 0)
  37433. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37434. if (t >>>= 0,
  37435. t < 0 || t + 0 > this.buffer.byteLength)
  37436. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37437. }
  37438. t += 4;
  37439. var n = this.buffer.byteLength;
  37440. return t > n && this.resize((n *= 2) > t ? n : t),
  37441. t -= 4,
  37442. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37443. this.view[t + 2] = e >>> 16 & 255,
  37444. this.view[t + 1] = e >>> 8 & 255,
  37445. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37446. this.view[t + 1] = e >>> 16 & 255,
  37447. this.view[t + 2] = e >>> 8 & 255,
  37448. this.view[t + 3] = 255 & e),
  37449. i && (this.offset += 4),
  37450. this
  37451. }
  37452. ,
  37453. a.writeInt = a.writeInt32,
  37454. a.readInt32 = function(e) {
  37455. var t = "undefined" == typeof e;
  37456. if (t && (e = this.offset),
  37457. !this.noAssert) {
  37458. if ("number" != typeof e || e % 1 !== 0)
  37459. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37460. if (e >>>= 0,
  37461. e < 0 || e + 4 > this.buffer.byteLength)
  37462. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37463. }
  37464. var i = 0;
  37465. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37466. i |= this.view[e + 1] << 8,
  37467. i |= this.view[e],
  37468. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37469. i |= this.view[e + 2] << 8,
  37470. i |= this.view[e + 3],
  37471. i += this.view[e] << 24 >>> 0),
  37472. i |= 0,
  37473. t && (this.offset += 4),
  37474. i
  37475. }
  37476. ,
  37477. a.readInt = a.readInt32,
  37478. a.writeUint32 = function(e, t) {
  37479. var i = "undefined" == typeof t;
  37480. if (i && (t = this.offset),
  37481. !this.noAssert) {
  37482. if ("number" != typeof e || e % 1 !== 0)
  37483. throw TypeError("Illegal value: " + e + " (not an integer)");
  37484. if (e >>>= 0,
  37485. "number" != typeof t || t % 1 !== 0)
  37486. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37487. if (t >>>= 0,
  37488. t < 0 || t + 0 > this.buffer.byteLength)
  37489. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37490. }
  37491. t += 4;
  37492. var n = this.buffer.byteLength;
  37493. return t > n && this.resize((n *= 2) > t ? n : t),
  37494. t -= 4,
  37495. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37496. this.view[t + 2] = e >>> 16 & 255,
  37497. this.view[t + 1] = e >>> 8 & 255,
  37498. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37499. this.view[t + 1] = e >>> 16 & 255,
  37500. this.view[t + 2] = e >>> 8 & 255,
  37501. this.view[t + 3] = 255 & e),
  37502. i && (this.offset += 4),
  37503. this
  37504. }
  37505. ,
  37506. a.writeUInt32 = a.writeUint32,
  37507. a.readUint32 = function(e) {
  37508. var t = "undefined" == typeof e;
  37509. if (t && (e = this.offset),
  37510. !this.noAssert) {
  37511. if ("number" != typeof e || e % 1 !== 0)
  37512. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37513. if (e >>>= 0,
  37514. e < 0 || e + 4 > this.buffer.byteLength)
  37515. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37516. }
  37517. var i = 0;
  37518. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37519. i |= this.view[e + 1] << 8,
  37520. i |= this.view[e],
  37521. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37522. i |= this.view[e + 2] << 8,
  37523. i |= this.view[e + 3],
  37524. i += this.view[e] << 24 >>> 0),
  37525. t && (this.offset += 4),
  37526. i
  37527. }
  37528. ,
  37529. a.readUInt32 = a.readUint32,
  37530. e && (a.writeInt64 = function(t, i) {
  37531. var n = "undefined" == typeof i;
  37532. if (n && (i = this.offset),
  37533. !this.noAssert) {
  37534. if ("number" == typeof t)
  37535. t = e.fromNumber(t);
  37536. else if ("string" == typeof t)
  37537. t = e.fromString(t);
  37538. else if (!(t && t instanceof e))
  37539. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37540. if ("number" != typeof i || i % 1 !== 0)
  37541. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37542. if (i >>>= 0,
  37543. i < 0 || i + 0 > this.buffer.byteLength)
  37544. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37545. }
  37546. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37547. i += 8;
  37548. var r = this.buffer.byteLength;
  37549. i > r && this.resize((r *= 2) > i ? r : i),
  37550. i -= 8;
  37551. var o = t.low
  37552. , a = t.high;
  37553. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37554. this.view[i + 2] = o >>> 16 & 255,
  37555. this.view[i + 1] = o >>> 8 & 255,
  37556. this.view[i] = 255 & o,
  37557. i += 4,
  37558. this.view[i + 3] = a >>> 24 & 255,
  37559. this.view[i + 2] = a >>> 16 & 255,
  37560. this.view[i + 1] = a >>> 8 & 255,
  37561. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37562. this.view[i + 1] = a >>> 16 & 255,
  37563. this.view[i + 2] = a >>> 8 & 255,
  37564. this.view[i + 3] = 255 & a,
  37565. i += 4,
  37566. this.view[i] = o >>> 24 & 255,
  37567. this.view[i + 1] = o >>> 16 & 255,
  37568. this.view[i + 2] = o >>> 8 & 255,
  37569. this.view[i + 3] = 255 & o),
  37570. n && (this.offset += 8),
  37571. this
  37572. }
  37573. ,
  37574. a.writeLong = a.writeInt64,
  37575. a.readInt64 = function(t) {
  37576. var i = "undefined" == typeof t;
  37577. if (i && (t = this.offset),
  37578. !this.noAssert) {
  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 + 8 > this.buffer.byteLength)
  37583. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37584. }
  37585. var n = 0
  37586. , r = 0;
  37587. this.littleEndian ? (n = this.view[t + 2] << 16,
  37588. n |= this.view[t + 1] << 8,
  37589. n |= this.view[t],
  37590. n += this.view[t + 3] << 24 >>> 0,
  37591. t += 4,
  37592. r = this.view[t + 2] << 16,
  37593. r |= this.view[t + 1] << 8,
  37594. r |= this.view[t],
  37595. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37596. r |= this.view[t + 2] << 8,
  37597. r |= this.view[t + 3],
  37598. r += this.view[t] << 24 >>> 0,
  37599. t += 4,
  37600. n = this.view[t + 1] << 16,
  37601. n |= this.view[t + 2] << 8,
  37602. n |= this.view[t + 3],
  37603. n += this.view[t] << 24 >>> 0);
  37604. var o = new e(n,r,!1);
  37605. return i && (this.offset += 8),
  37606. o
  37607. }
  37608. ,
  37609. a.readLong = a.readInt64,
  37610. a.writeUint64 = function(t, i) {
  37611. var n = "undefined" == typeof i;
  37612. if (n && (i = this.offset),
  37613. !this.noAssert) {
  37614. if ("number" == typeof t)
  37615. t = e.fromNumber(t);
  37616. else if ("string" == typeof t)
  37617. t = e.fromString(t);
  37618. else if (!(t && t instanceof e))
  37619. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37620. if ("number" != typeof i || i % 1 !== 0)
  37621. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37622. if (i >>>= 0,
  37623. i < 0 || i + 0 > this.buffer.byteLength)
  37624. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37625. }
  37626. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37627. i += 8;
  37628. var r = this.buffer.byteLength;
  37629. i > r && this.resize((r *= 2) > i ? r : i),
  37630. i -= 8;
  37631. var o = t.low
  37632. , a = t.high;
  37633. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37634. this.view[i + 2] = o >>> 16 & 255,
  37635. this.view[i + 1] = o >>> 8 & 255,
  37636. this.view[i] = 255 & o,
  37637. i += 4,
  37638. this.view[i + 3] = a >>> 24 & 255,
  37639. this.view[i + 2] = a >>> 16 & 255,
  37640. this.view[i + 1] = a >>> 8 & 255,
  37641. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37642. this.view[i + 1] = a >>> 16 & 255,
  37643. this.view[i + 2] = a >>> 8 & 255,
  37644. this.view[i + 3] = 255 & a,
  37645. i += 4,
  37646. this.view[i] = o >>> 24 & 255,
  37647. this.view[i + 1] = o >>> 16 & 255,
  37648. this.view[i + 2] = o >>> 8 & 255,
  37649. this.view[i + 3] = 255 & o),
  37650. n && (this.offset += 8),
  37651. this
  37652. }
  37653. ,
  37654. a.writeUInt64 = a.writeUint64,
  37655. a.readUint64 = function(t) {
  37656. var i = "undefined" == typeof t;
  37657. if (i && (t = this.offset),
  37658. !this.noAssert) {
  37659. if ("number" != typeof t || t % 1 !== 0)
  37660. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37661. if (t >>>= 0,
  37662. t < 0 || t + 8 > this.buffer.byteLength)
  37663. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37664. }
  37665. var n = 0
  37666. , r = 0;
  37667. this.littleEndian ? (n = this.view[t + 2] << 16,
  37668. n |= this.view[t + 1] << 8,
  37669. n |= this.view[t],
  37670. n += this.view[t + 3] << 24 >>> 0,
  37671. t += 4,
  37672. r = this.view[t + 2] << 16,
  37673. r |= this.view[t + 1] << 8,
  37674. r |= this.view[t],
  37675. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37676. r |= this.view[t + 2] << 8,
  37677. r |= this.view[t + 3],
  37678. r += this.view[t] << 24 >>> 0,
  37679. t += 4,
  37680. n = this.view[t + 1] << 16,
  37681. n |= this.view[t + 2] << 8,
  37682. n |= this.view[t + 3],
  37683. n += this.view[t] << 24 >>> 0);
  37684. var o = new e(n,r,!0);
  37685. return i && (this.offset += 8),
  37686. o
  37687. }
  37688. ,
  37689. a.readUInt64 = a.readUint64),
  37690. a.writeFloat32 = function(e, t) {
  37691. var i = "undefined" == typeof t;
  37692. if (i && (t = this.offset),
  37693. !this.noAssert) {
  37694. if ("number" != typeof e)
  37695. throw TypeError("Illegal value: " + e + " (not a number)");
  37696. if ("number" != typeof t || t % 1 !== 0)
  37697. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37698. if (t >>>= 0,
  37699. t < 0 || t + 0 > this.buffer.byteLength)
  37700. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37701. }
  37702. t += 4;
  37703. var n = this.buffer.byteLength;
  37704. return t > n && this.resize((n *= 2) > t ? n : t),
  37705. t -= 4,
  37706. r(this.view, e, t, this.littleEndian, 23, 4),
  37707. i && (this.offset += 4),
  37708. this
  37709. }
  37710. ,
  37711. a.writeFloat = a.writeFloat32,
  37712. a.readFloat32 = function(e) {
  37713. var t = "undefined" == typeof e;
  37714. if (t && (e = this.offset),
  37715. !this.noAssert) {
  37716. if ("number" != typeof e || e % 1 !== 0)
  37717. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37718. if (e >>>= 0,
  37719. e < 0 || e + 4 > this.buffer.byteLength)
  37720. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37721. }
  37722. var i = n(this.view, e, this.littleEndian, 23, 4);
  37723. return t && (this.offset += 4),
  37724. i
  37725. }
  37726. ,
  37727. a.readFloat = a.readFloat32,
  37728. a.writeFloat64 = function(e, t) {
  37729. var i = "undefined" == typeof t;
  37730. if (i && (t = this.offset),
  37731. !this.noAssert) {
  37732. if ("number" != typeof e)
  37733. throw TypeError("Illegal value: " + e + " (not a number)");
  37734. if ("number" != typeof t || t % 1 !== 0)
  37735. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37736. if (t >>>= 0,
  37737. t < 0 || t + 0 > this.buffer.byteLength)
  37738. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37739. }
  37740. t += 8;
  37741. var n = this.buffer.byteLength;
  37742. return t > n && this.resize((n *= 2) > t ? n : t),
  37743. t -= 8,
  37744. r(this.view, e, t, this.littleEndian, 52, 8),
  37745. i && (this.offset += 8),
  37746. this
  37747. }
  37748. ,
  37749. a.writeDouble = a.writeFloat64,
  37750. a.readFloat64 = function(e) {
  37751. var t = "undefined" == typeof e;
  37752. if (t && (e = this.offset),
  37753. !this.noAssert) {
  37754. if ("number" != typeof e || e % 1 !== 0)
  37755. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37756. if (e >>>= 0,
  37757. e < 0 || e + 8 > this.buffer.byteLength)
  37758. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37759. }
  37760. var i = n(this.view, e, this.littleEndian, 52, 8);
  37761. return t && (this.offset += 8),
  37762. i
  37763. }
  37764. ,
  37765. a.readDouble = a.readFloat64,
  37766. o.MAX_VARINT32_BYTES = 5,
  37767. o.calculateVarint32 = function(e) {
  37768. return e >>>= 0,
  37769. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37770. }
  37771. ,
  37772. o.zigZagEncode32 = function(e) {
  37773. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37774. }
  37775. ,
  37776. o.zigZagDecode32 = function(e) {
  37777. return e >>> 1 ^ -(1 & e) | 0
  37778. }
  37779. ,
  37780. a.writeVarint32 = function(e, t) {
  37781. var i = "undefined" == typeof t;
  37782. if (i && (t = this.offset),
  37783. !this.noAssert) {
  37784. if ("number" != typeof e || e % 1 !== 0)
  37785. throw TypeError("Illegal value: " + e + " (not an integer)");
  37786. if (e |= 0,
  37787. "number" != typeof t || t % 1 !== 0)
  37788. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37789. if (t >>>= 0,
  37790. t < 0 || t + 0 > this.buffer.byteLength)
  37791. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37792. }
  37793. var n, r = o.calculateVarint32(e);
  37794. t += r;
  37795. var a = this.buffer.byteLength;
  37796. for (t > a && this.resize((a *= 2) > t ? a : t),
  37797. t -= r,
  37798. e >>>= 0; e >= 128; )
  37799. n = 127 & e | 128,
  37800. this.view[t++] = n,
  37801. e >>>= 7;
  37802. return this.view[t++] = e,
  37803. i ? (this.offset = t,
  37804. this) : r
  37805. }
  37806. ,
  37807. a.writeVarint32ZigZag = function(e, t) {
  37808. return this.writeVarint32(o.zigZagEncode32(e), t)
  37809. }
  37810. ,
  37811. a.readVarint32 = function(e) {
  37812. var t = "undefined" == typeof e;
  37813. if (t && (e = this.offset),
  37814. !this.noAssert) {
  37815. if ("number" != typeof e || e % 1 !== 0)
  37816. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37817. if (e >>>= 0,
  37818. e < 0 || e + 1 > this.buffer.byteLength)
  37819. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37820. }
  37821. var i, n = 0, r = 0;
  37822. do {
  37823. if (!this.noAssert && e > this.limit) {
  37824. var o = Error("Truncated");
  37825. throw o.truncated = !0,
  37826. o
  37827. }
  37828. i = this.view[e++],
  37829. n < 5 && (r |= (127 & i) << 7 * n),
  37830. ++n
  37831. } while (0 !== (128 & i));return r |= 0,
  37832. t ? (this.offset = e,
  37833. r) : {
  37834. value: r,
  37835. length: n
  37836. }
  37837. }
  37838. ,
  37839. a.readVarint32ZigZag = function(e) {
  37840. var t = this.readVarint32(e);
  37841. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37842. t
  37843. }
  37844. ,
  37845. e && (o.MAX_VARINT64_BYTES = 10,
  37846. o.calculateVarint64 = function(t) {
  37847. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37848. var i = t.toInt() >>> 0
  37849. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37850. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37851. 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
  37852. }
  37853. ,
  37854. o.zigZagEncode64 = function(t) {
  37855. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37856. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37857. }
  37858. ,
  37859. o.zigZagDecode64 = function(t) {
  37860. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37861. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37862. }
  37863. ,
  37864. a.writeVarint64 = function(t, i) {
  37865. var n = "undefined" == typeof i;
  37866. if (n && (i = this.offset),
  37867. !this.noAssert) {
  37868. if ("number" == typeof t)
  37869. t = e.fromNumber(t);
  37870. else if ("string" == typeof t)
  37871. t = e.fromString(t);
  37872. else if (!(t && t instanceof e))
  37873. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37874. if ("number" != typeof i || i % 1 !== 0)
  37875. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37876. if (i >>>= 0,
  37877. i < 0 || i + 0 > this.buffer.byteLength)
  37878. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37879. }
  37880. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37881. var r = o.calculateVarint64(t)
  37882. , a = t.toInt() >>> 0
  37883. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37884. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37885. i += r;
  37886. var c = this.buffer.byteLength;
  37887. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37888. i -= r,
  37889. r) {
  37890. case 10:
  37891. this.view[i + 9] = l >>> 7 & 1;
  37892. case 9:
  37893. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37894. case 8:
  37895. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37896. case 7:
  37897. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37898. case 6:
  37899. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37900. case 5:
  37901. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37902. case 4:
  37903. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37904. case 3:
  37905. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37906. case 2:
  37907. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37908. case 1:
  37909. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37910. }
  37911. return n ? (this.offset += r,
  37912. this) : r
  37913. }
  37914. ,
  37915. a.writeVarint64ZigZag = function(e, t) {
  37916. return this.writeVarint64(o.zigZagEncode64(e), t)
  37917. }
  37918. ,
  37919. a.readVarint64 = function(t) {
  37920. var i = "undefined" == typeof t;
  37921. if (i && (t = this.offset),
  37922. !this.noAssert) {
  37923. if ("number" != typeof t || t % 1 !== 0)
  37924. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37925. if (t >>>= 0,
  37926. t < 0 || t + 1 > this.buffer.byteLength)
  37927. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37928. }
  37929. var n = t
  37930. , r = 0
  37931. , o = 0
  37932. , a = 0
  37933. , s = 0;
  37934. if (s = this.view[t++],
  37935. r = 127 & s,
  37936. 128 & s && (s = this.view[t++],
  37937. r |= (127 & s) << 7,
  37938. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37939. r |= (127 & s) << 14,
  37940. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37941. r |= (127 & s) << 21,
  37942. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37943. o = 127 & s,
  37944. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37945. o |= (127 & s) << 7,
  37946. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37947. o |= (127 & s) << 14,
  37948. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37949. o |= (127 & s) << 21,
  37950. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37951. a = 127 & s,
  37952. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37953. a |= (127 & s) << 7,
  37954. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37955. throw Error("Buffer overrun");
  37956. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37957. return i ? (this.offset = t,
  37958. l) : {
  37959. value: l,
  37960. length: t - n
  37961. }
  37962. }
  37963. ,
  37964. a.readVarint64ZigZag = function(t) {
  37965. var i = this.readVarint64(t);
  37966. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37967. i
  37968. }
  37969. ),
  37970. a.writeCString = function(e, i) {
  37971. var n = "undefined" == typeof i;
  37972. n && (i = this.offset);
  37973. var r, o = e.length;
  37974. if (!this.noAssert) {
  37975. if ("string" != typeof e)
  37976. throw TypeError("Illegal str: Not a string");
  37977. for (r = 0; r < o; ++r)
  37978. if (0 === e.charCodeAt(r))
  37979. throw RangeError("Illegal str: Contains NULL-characters");
  37980. if ("number" != typeof i || i % 1 !== 0)
  37981. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37982. if (i >>>= 0,
  37983. i < 0 || i + 0 > this.buffer.byteLength)
  37984. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37985. }
  37986. o = h.calculateUTF16asUTF8(t(e))[1],
  37987. i += o + 1;
  37988. var a = this.buffer.byteLength;
  37989. return i > a && this.resize((a *= 2) > i ? a : i),
  37990. i -= o + 1,
  37991. h.encodeUTF16toUTF8(t(e), function(e) {
  37992. this.view[i++] = e
  37993. }
  37994. .bind(this)),
  37995. this.view[i++] = 0,
  37996. n ? (this.offset = i,
  37997. this) : o
  37998. }
  37999. ,
  38000. a.readCString = function(e) {
  38001. var t = "undefined" == typeof e;
  38002. if (t && (e = this.offset),
  38003. !this.noAssert) {
  38004. if ("number" != typeof e || e % 1 !== 0)
  38005. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38006. if (e >>>= 0,
  38007. e < 0 || e + 1 > this.buffer.byteLength)
  38008. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38009. }
  38010. var n, r = e, o = -1;
  38011. return h.decodeUTF8toUTF16(function() {
  38012. if (0 === o)
  38013. return null;
  38014. if (e >= this.limit)
  38015. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38016. return o = this.view[e++],
  38017. 0 === o ? null : o
  38018. }
  38019. .bind(this), n = i(), !0),
  38020. t ? (this.offset = e,
  38021. n()) : {
  38022. string: n(),
  38023. length: e - r
  38024. }
  38025. }
  38026. ,
  38027. a.writeIString = function(e, i) {
  38028. var n = "undefined" == typeof i;
  38029. if (n && (i = this.offset),
  38030. !this.noAssert) {
  38031. if ("string" != typeof e)
  38032. throw TypeError("Illegal str: Not a string");
  38033. if ("number" != typeof i || i % 1 !== 0)
  38034. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38035. if (i >>>= 0,
  38036. i < 0 || i + 0 > this.buffer.byteLength)
  38037. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38038. }
  38039. var r, o = i;
  38040. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38041. i += 4 + r;
  38042. var a = this.buffer.byteLength;
  38043. if (i > a && this.resize((a *= 2) > i ? a : i),
  38044. i -= 4 + r,
  38045. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38046. this.view[i + 2] = r >>> 16 & 255,
  38047. this.view[i + 1] = r >>> 8 & 255,
  38048. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38049. this.view[i + 1] = r >>> 16 & 255,
  38050. this.view[i + 2] = r >>> 8 & 255,
  38051. this.view[i + 3] = 255 & r),
  38052. i += 4,
  38053. h.encodeUTF16toUTF8(t(e), function(e) {
  38054. this.view[i++] = e
  38055. }
  38056. .bind(this)),
  38057. i !== o + 4 + r)
  38058. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38059. return n ? (this.offset = i,
  38060. this) : i - o
  38061. }
  38062. ,
  38063. a.readIString = function(e) {
  38064. var t = "undefined" == typeof e;
  38065. if (t && (e = this.offset),
  38066. !this.noAssert) {
  38067. if ("number" != typeof e || e % 1 !== 0)
  38068. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38069. if (e >>>= 0,
  38070. e < 0 || e + 4 > this.buffer.byteLength)
  38071. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38072. }
  38073. var i = e
  38074. , n = this.readUint32(e)
  38075. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38076. return e += r.length,
  38077. t ? (this.offset = e,
  38078. r.string) : {
  38079. string: r.string,
  38080. length: e - i
  38081. }
  38082. }
  38083. ,
  38084. o.METRICS_CHARS = "c",
  38085. o.METRICS_BYTES = "b",
  38086. a.writeUTF8String = function(e, i) {
  38087. var n = "undefined" == typeof i;
  38088. if (n && (i = this.offset),
  38089. !this.noAssert) {
  38090. if ("number" != typeof i || i % 1 !== 0)
  38091. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38092. if (i >>>= 0,
  38093. i < 0 || i + 0 > this.buffer.byteLength)
  38094. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38095. }
  38096. var r, o = i;
  38097. r = h.calculateUTF16asUTF8(t(e))[1],
  38098. i += r;
  38099. var a = this.buffer.byteLength;
  38100. return i > a && this.resize((a *= 2) > i ? a : i),
  38101. i -= r,
  38102. h.encodeUTF16toUTF8(t(e), function(e) {
  38103. this.view[i++] = e
  38104. }
  38105. .bind(this)),
  38106. n ? (this.offset = i,
  38107. this) : i - o
  38108. }
  38109. ,
  38110. a.writeString = a.writeUTF8String,
  38111. o.calculateUTF8Chars = function(e) {
  38112. return h.calculateUTF16asUTF8(t(e))[0]
  38113. }
  38114. ,
  38115. o.calculateUTF8Bytes = function(e) {
  38116. return h.calculateUTF16asUTF8(t(e))[1]
  38117. }
  38118. ,
  38119. o.calculateString = o.calculateUTF8Bytes,
  38120. a.readUTF8String = function(e, t, n) {
  38121. "number" == typeof t && (n = t,
  38122. t = void 0);
  38123. var r = "undefined" == typeof n;
  38124. if (r && (n = this.offset),
  38125. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38126. !this.noAssert) {
  38127. if ("number" != typeof e || e % 1 !== 0)
  38128. throw TypeError("Illegal length: " + e + " (not an integer)");
  38129. if (e |= 0,
  38130. "number" != typeof n || n % 1 !== 0)
  38131. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38132. if (n >>>= 0,
  38133. n < 0 || n + 0 > this.buffer.byteLength)
  38134. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38135. }
  38136. var a, s = 0, l = n;
  38137. if (t === o.METRICS_CHARS) {
  38138. if (a = i(),
  38139. h.decodeUTF8(function() {
  38140. return s < e && n < this.limit ? this.view[n++] : null
  38141. }
  38142. .bind(this), function(e) {
  38143. ++s,
  38144. h.UTF8toUTF16(e, a)
  38145. }),
  38146. s !== e)
  38147. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38148. return r ? (this.offset = n,
  38149. a()) : {
  38150. string: a(),
  38151. length: n - l
  38152. }
  38153. }
  38154. if (t === o.METRICS_BYTES) {
  38155. if (!this.noAssert) {
  38156. if ("number" != typeof n || n % 1 !== 0)
  38157. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38158. if (n >>>= 0,
  38159. n < 0 || n + e > this.buffer.byteLength)
  38160. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38161. }
  38162. var c = n + e;
  38163. if (h.decodeUTF8toUTF16(function() {
  38164. return n < c ? this.view[n++] : null
  38165. }
  38166. .bind(this), a = i(), this.noAssert),
  38167. n !== c)
  38168. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38169. return r ? (this.offset = n,
  38170. a()) : {
  38171. string: a(),
  38172. length: n - l
  38173. }
  38174. }
  38175. throw TypeError("Unsupported metrics: " + t)
  38176. }
  38177. ,
  38178. a.readString = a.readUTF8String,
  38179. a.writeVString = function(e, i) {
  38180. var n = "undefined" == typeof i;
  38181. if (n && (i = this.offset),
  38182. !this.noAssert) {
  38183. if ("string" != typeof e)
  38184. throw TypeError("Illegal str: Not a string");
  38185. if ("number" != typeof i || i % 1 !== 0)
  38186. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38187. if (i >>>= 0,
  38188. i < 0 || i + 0 > this.buffer.byteLength)
  38189. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38190. }
  38191. var r, a, s = i;
  38192. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38193. a = o.calculateVarint32(r),
  38194. i += a + r;
  38195. var l = this.buffer.byteLength;
  38196. if (i > l && this.resize((l *= 2) > i ? l : i),
  38197. i -= a + r,
  38198. i += this.writeVarint32(r, i),
  38199. h.encodeUTF16toUTF8(t(e), function(e) {
  38200. this.view[i++] = e
  38201. }
  38202. .bind(this)),
  38203. i !== s + r + a)
  38204. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38205. return n ? (this.offset = i,
  38206. this) : i - s
  38207. }
  38208. ,
  38209. a.readVString = function(e) {
  38210. var t = "undefined" == typeof e;
  38211. if (t && (e = this.offset),
  38212. !this.noAssert) {
  38213. if ("number" != typeof e || e % 1 !== 0)
  38214. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38215. if (e >>>= 0,
  38216. e < 0 || e + 1 > this.buffer.byteLength)
  38217. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38218. }
  38219. var i = e
  38220. , n = this.readVarint32(e)
  38221. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38222. return e += r.length,
  38223. t ? (this.offset = e,
  38224. r.string) : {
  38225. string: r.string,
  38226. length: e - i
  38227. }
  38228. }
  38229. ,
  38230. a.append = function(e, t, i) {
  38231. "number" != typeof t && "string" == typeof t || (i = t,
  38232. t = void 0);
  38233. var n = "undefined" == typeof i;
  38234. if (n && (i = this.offset),
  38235. !this.noAssert) {
  38236. if ("number" != typeof i || i % 1 !== 0)
  38237. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38238. if (i >>>= 0,
  38239. i < 0 || i + 0 > this.buffer.byteLength)
  38240. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38241. }
  38242. e instanceof o || (e = o.wrap(e, t));
  38243. var r = e.limit - e.offset;
  38244. if (r <= 0)
  38245. return this;
  38246. i += r;
  38247. var a = this.buffer.byteLength;
  38248. return i > a && this.resize((a *= 2) > i ? a : i),
  38249. i -= r,
  38250. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38251. e.offset += r,
  38252. n && (this.offset += r),
  38253. this
  38254. }
  38255. ,
  38256. a.appendTo = function(e, t) {
  38257. return e.append(this, t),
  38258. this
  38259. }
  38260. ,
  38261. a.assert = function(e) {
  38262. return this.noAssert = !e,
  38263. this
  38264. }
  38265. ,
  38266. a.capacity = function() {
  38267. return this.buffer.byteLength
  38268. }
  38269. ,
  38270. a.clear = function() {
  38271. return this.offset = 0,
  38272. this.limit = this.buffer.byteLength,
  38273. this.markedOffset = -1,
  38274. this
  38275. }
  38276. ,
  38277. a.clone = function(e) {
  38278. var t = new o(0,this.littleEndian,this.noAssert);
  38279. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38280. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38281. t.view = this.view),
  38282. t.offset = this.offset,
  38283. t.markedOffset = this.markedOffset,
  38284. t.limit = this.limit,
  38285. t
  38286. }
  38287. ,
  38288. a.compact = function(e, t) {
  38289. if ("undefined" == typeof e && (e = this.offset),
  38290. "undefined" == typeof t && (t = this.limit),
  38291. !this.noAssert) {
  38292. if ("number" != typeof e || e % 1 !== 0)
  38293. throw TypeError("Illegal begin: Not an integer");
  38294. if (e >>>= 0,
  38295. "number" != typeof t || t % 1 !== 0)
  38296. throw TypeError("Illegal end: Not an integer");
  38297. if (t >>>= 0,
  38298. e < 0 || e > t || t > this.buffer.byteLength)
  38299. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38300. }
  38301. if (0 === e && t === this.buffer.byteLength)
  38302. return this;
  38303. var i = t - e;
  38304. if (0 === i)
  38305. return this.buffer = s,
  38306. this.view = null,
  38307. this.markedOffset >= 0 && (this.markedOffset -= e),
  38308. this.offset = 0,
  38309. this.limit = 0,
  38310. this;
  38311. var n = new ArrayBuffer(i)
  38312. , r = new Uint8Array(n);
  38313. return r.set(this.view.subarray(e, t)),
  38314. this.buffer = n,
  38315. this.view = r,
  38316. this.markedOffset >= 0 && (this.markedOffset -= e),
  38317. this.offset = 0,
  38318. this.limit = i,
  38319. this
  38320. }
  38321. ,
  38322. a.copy = function(e, t) {
  38323. if ("undefined" == typeof e && (e = this.offset),
  38324. "undefined" == typeof t && (t = this.limit),
  38325. !this.noAssert) {
  38326. if ("number" != typeof e || e % 1 !== 0)
  38327. throw TypeError("Illegal begin: Not an integer");
  38328. if (e >>>= 0,
  38329. "number" != typeof t || t % 1 !== 0)
  38330. throw TypeError("Illegal end: Not an integer");
  38331. if (t >>>= 0,
  38332. e < 0 || e > t || t > this.buffer.byteLength)
  38333. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38334. }
  38335. if (e === t)
  38336. return new o(0,this.littleEndian,this.noAssert);
  38337. var i = t - e
  38338. , n = new o(i,this.littleEndian,this.noAssert);
  38339. return n.offset = 0,
  38340. n.limit = i,
  38341. n.markedOffset >= 0 && (n.markedOffset -= e),
  38342. this.copyTo(n, 0, e, t),
  38343. n
  38344. }
  38345. ,
  38346. a.copyTo = function(e, t, i, n) {
  38347. var r, a;
  38348. if (!this.noAssert && !o.isByteBuffer(e))
  38349. throw TypeError("Illegal target: Not a ByteBuffer");
  38350. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38351. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38352. n = "undefined" == typeof n ? this.limit : 0 | n,
  38353. t < 0 || t > e.buffer.byteLength)
  38354. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38355. if (i < 0 || n > this.buffer.byteLength)
  38356. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38357. var s = n - i;
  38358. return 0 === s ? e : (e.ensureCapacity(t + s),
  38359. e.view.set(this.view.subarray(i, n), t),
  38360. r && (this.offset += s),
  38361. a && (e.offset += s),
  38362. this)
  38363. }
  38364. ,
  38365. a.ensureCapacity = function(e) {
  38366. var t = this.buffer.byteLength;
  38367. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38368. }
  38369. ,
  38370. a.fill = function(e, t, i) {
  38371. var n = "undefined" == typeof t;
  38372. if (n && (t = this.offset),
  38373. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38374. "undefined" == typeof t && (t = this.offset),
  38375. "undefined" == typeof i && (i = this.limit),
  38376. !this.noAssert) {
  38377. if ("number" != typeof e || e % 1 !== 0)
  38378. throw TypeError("Illegal value: " + e + " (not an integer)");
  38379. if (e |= 0,
  38380. "number" != typeof t || t % 1 !== 0)
  38381. throw TypeError("Illegal begin: Not an integer");
  38382. if (t >>>= 0,
  38383. "number" != typeof i || i % 1 !== 0)
  38384. throw TypeError("Illegal end: Not an integer");
  38385. if (i >>>= 0,
  38386. t < 0 || t > i || i > this.buffer.byteLength)
  38387. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38388. }
  38389. if (t >= i)
  38390. return this;
  38391. for (; t < i; )
  38392. this.view[t++] = e;
  38393. return n && (this.offset = t),
  38394. this
  38395. }
  38396. ,
  38397. a.flip = function() {
  38398. return this.limit = this.offset,
  38399. this.offset = 0,
  38400. this
  38401. }
  38402. ,
  38403. a.mark = function(e) {
  38404. if (e = "undefined" == typeof e ? this.offset : e,
  38405. !this.noAssert) {
  38406. if ("number" != typeof e || e % 1 !== 0)
  38407. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38408. if (e >>>= 0,
  38409. e < 0 || e + 0 > this.buffer.byteLength)
  38410. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38411. }
  38412. return this.markedOffset = e,
  38413. this
  38414. }
  38415. ,
  38416. a.order = function(e) {
  38417. if (!this.noAssert && "boolean" != typeof e)
  38418. throw TypeError("Illegal littleEndian: Not a boolean");
  38419. return this.littleEndian = !!e,
  38420. this
  38421. }
  38422. ,
  38423. a.LE = function(e) {
  38424. return this.littleEndian = "undefined" == typeof e || !!e,
  38425. this
  38426. }
  38427. ,
  38428. a.BE = function(e) {
  38429. return this.littleEndian = "undefined" != typeof e && !e,
  38430. this
  38431. }
  38432. ,
  38433. a.prepend = function(e, t, i) {
  38434. "number" != typeof t && "string" == typeof t || (i = t,
  38435. t = void 0);
  38436. var n = "undefined" == typeof i;
  38437. if (n && (i = this.offset),
  38438. !this.noAssert) {
  38439. if ("number" != typeof i || i % 1 !== 0)
  38440. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38441. if (i >>>= 0,
  38442. i < 0 || i + 0 > this.buffer.byteLength)
  38443. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38444. }
  38445. e instanceof o || (e = o.wrap(e, t));
  38446. var r = e.limit - e.offset;
  38447. if (r <= 0)
  38448. return this;
  38449. var a = r - i;
  38450. if (a > 0) {
  38451. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38452. , l = new Uint8Array(s);
  38453. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38454. this.buffer = s,
  38455. this.view = l,
  38456. this.offset += a,
  38457. this.markedOffset >= 0 && (this.markedOffset += a),
  38458. this.limit += a,
  38459. i += a
  38460. } else {
  38461. new Uint8Array(this.buffer)
  38462. }
  38463. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38464. e.offset = e.limit,
  38465. n && (this.offset -= r),
  38466. this
  38467. }
  38468. ,
  38469. a.prependTo = function(e, t) {
  38470. return e.prepend(this, t),
  38471. this
  38472. }
  38473. ,
  38474. a.printDebug = function(e) {
  38475. "function" != typeof e && (e = console.log.bind(console)),
  38476. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38477. }
  38478. ,
  38479. a.remaining = function() {
  38480. return this.limit - this.offset
  38481. }
  38482. ,
  38483. a.reset = function() {
  38484. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38485. this.markedOffset = -1) : this.offset = 0,
  38486. this
  38487. }
  38488. ,
  38489. a.resize = function(e) {
  38490. if (!this.noAssert) {
  38491. if ("number" != typeof e || e % 1 !== 0)
  38492. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38493. if (e |= 0,
  38494. e < 0)
  38495. throw RangeError("Illegal capacity: 0 <= " + e)
  38496. }
  38497. if (this.buffer.byteLength < e) {
  38498. var t = new ArrayBuffer(e)
  38499. , i = new Uint8Array(t);
  38500. i.set(this.view),
  38501. this.buffer = t,
  38502. this.view = i
  38503. }
  38504. return this
  38505. }
  38506. ,
  38507. a.reverse = function(e, t) {
  38508. if ("undefined" == typeof e && (e = this.offset),
  38509. "undefined" == typeof t && (t = this.limit),
  38510. !this.noAssert) {
  38511. if ("number" != typeof e || e % 1 !== 0)
  38512. throw TypeError("Illegal begin: Not an integer");
  38513. if (e >>>= 0,
  38514. "number" != typeof t || t % 1 !== 0)
  38515. throw TypeError("Illegal end: Not an integer");
  38516. if (t >>>= 0,
  38517. e < 0 || e > t || t > this.buffer.byteLength)
  38518. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38519. }
  38520. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38521. this)
  38522. }
  38523. ,
  38524. a.skip = function(e) {
  38525. if (!this.noAssert) {
  38526. if ("number" != typeof e || e % 1 !== 0)
  38527. throw TypeError("Illegal length: " + e + " (not an integer)");
  38528. e |= 0
  38529. }
  38530. var t = this.offset + e;
  38531. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38532. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38533. return this.offset = t,
  38534. this
  38535. }
  38536. ,
  38537. a.slice = function(e, t) {
  38538. if ("undefined" == typeof e && (e = this.offset),
  38539. "undefined" == typeof t && (t = this.limit),
  38540. !this.noAssert) {
  38541. if ("number" != typeof e || e % 1 !== 0)
  38542. throw TypeError("Illegal begin: Not an integer");
  38543. if (e >>>= 0,
  38544. "number" != typeof t || t % 1 !== 0)
  38545. throw TypeError("Illegal end: Not an integer");
  38546. if (t >>>= 0,
  38547. e < 0 || e > t || t > this.buffer.byteLength)
  38548. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38549. }
  38550. var i = this.clone();
  38551. return i.offset = e,
  38552. i.limit = t,
  38553. i
  38554. }
  38555. ,
  38556. a.toBuffer = function(e) {
  38557. var t = this.offset
  38558. , i = this.limit;
  38559. if (!this.noAssert) {
  38560. if ("number" != typeof t || t % 1 !== 0)
  38561. throw TypeError("Illegal offset: Not an integer");
  38562. if (t >>>= 0,
  38563. "number" != typeof i || i % 1 !== 0)
  38564. throw TypeError("Illegal limit: Not an integer");
  38565. if (i >>>= 0,
  38566. t < 0 || t > i || i > this.buffer.byteLength)
  38567. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38568. }
  38569. if (!e && 0 === t && i === this.buffer.byteLength)
  38570. return this.buffer;
  38571. if (t === i)
  38572. return s;
  38573. var n = new ArrayBuffer(i - t);
  38574. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38575. n
  38576. }
  38577. ,
  38578. a.toArrayBuffer = a.toBuffer,
  38579. a.toString = function(e, t, i) {
  38580. if ("undefined" == typeof e)
  38581. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38582. switch ("number" == typeof e && (e = "utf8",
  38583. t = e,
  38584. i = t),
  38585. e) {
  38586. case "utf8":
  38587. return this.toUTF8(t, i);
  38588. case "base64":
  38589. return this.toBase64(t, i);
  38590. case "hex":
  38591. return this.toHex(t, i);
  38592. case "binary":
  38593. return this.toBinary(t, i);
  38594. case "debug":
  38595. return this.toDebug();
  38596. case "columns":
  38597. return this.toColumns();
  38598. default:
  38599. throw Error("Unsupported encoding: " + e)
  38600. }
  38601. }
  38602. ;
  38603. var c = function() {
  38604. 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)
  38605. i[t[n]] = n;
  38606. return e.encode = function(e, i) {
  38607. for (var n, r; null !== (n = e()); )
  38608. i(t[n >> 2 & 63]),
  38609. r = (3 & n) << 4,
  38610. null !== (n = e()) ? (r |= n >> 4 & 15,
  38611. i(t[63 & (r | n >> 4 & 15)]),
  38612. r = (15 & n) << 2,
  38613. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38614. i(t[63 & n])) : (i(t[63 & r]),
  38615. i(61))) : (i(t[63 & r]),
  38616. i(61),
  38617. i(61))
  38618. }
  38619. ,
  38620. e.decode = function(e, t) {
  38621. function n(e) {
  38622. throw Error("Illegal character code: " + e)
  38623. }
  38624. for (var r, o, a; null !== (r = e()); )
  38625. if (o = i[r],
  38626. "undefined" == typeof o && n(r),
  38627. null !== (r = e()) && (a = i[r],
  38628. "undefined" == typeof a && n(r),
  38629. t(o << 2 >>> 0 | (48 & a) >> 4),
  38630. null !== (r = e()))) {
  38631. if (o = i[r],
  38632. "undefined" == typeof o) {
  38633. if (61 === r)
  38634. break;
  38635. n(r)
  38636. }
  38637. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38638. null !== (r = e())) {
  38639. if (a = i[r],
  38640. "undefined" == typeof a) {
  38641. if (61 === r)
  38642. break;
  38643. n(r)
  38644. }
  38645. t((3 & o) << 6 >>> 0 | a)
  38646. }
  38647. }
  38648. }
  38649. ,
  38650. e.test = function(e) {
  38651. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38652. }
  38653. ,
  38654. e
  38655. }();
  38656. a.toBase64 = function(e, t) {
  38657. if ("undefined" == typeof e && (e = this.offset),
  38658. "undefined" == typeof t && (t = this.limit),
  38659. e |= 0,
  38660. t |= 0,
  38661. e < 0 || t > this.capacity || e > t)
  38662. throw RangeError("begin, end");
  38663. var n;
  38664. return c.encode(function() {
  38665. return e < t ? this.view[e++] : null
  38666. }
  38667. .bind(this), n = i()),
  38668. n()
  38669. }
  38670. ,
  38671. o.fromBase64 = function(e, i) {
  38672. if ("string" != typeof e)
  38673. throw TypeError("str");
  38674. var n = new o(e.length / 4 * 3,i)
  38675. , r = 0;
  38676. return c.decode(t(e), function(e) {
  38677. n.view[r++] = e
  38678. }),
  38679. n.limit = r,
  38680. n
  38681. }
  38682. ,
  38683. o.btoa = function(e) {
  38684. return o.fromBinary(e).toBase64()
  38685. }
  38686. ,
  38687. o.atob = function(e) {
  38688. return o.fromBase64(e).toBinary()
  38689. }
  38690. ,
  38691. a.toBinary = function(e, t) {
  38692. if ("undefined" == typeof e && (e = this.offset),
  38693. "undefined" == typeof t && (t = this.limit),
  38694. e |= 0,
  38695. t |= 0,
  38696. e < 0 || t > this.capacity() || e > t)
  38697. throw RangeError("begin, end");
  38698. if (e === t)
  38699. return "";
  38700. for (var i = [], n = []; e < t; )
  38701. i.push(this.view[e++]),
  38702. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38703. i = []);
  38704. return n.join("") + String.fromCharCode.apply(String, i)
  38705. }
  38706. ,
  38707. o.fromBinary = function(e, t) {
  38708. if ("string" != typeof e)
  38709. throw TypeError("str");
  38710. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38711. if (i = e.charCodeAt(n),
  38712. i > 255)
  38713. throw RangeError("illegal char code: " + i);
  38714. a.view[n++] = i
  38715. }
  38716. return a.limit = r,
  38717. a
  38718. }
  38719. ,
  38720. a.toDebug = function(e) {
  38721. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38722. if (i !== -1 && (t = this.view[i],
  38723. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38724. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38725. ++i,
  38726. e && i > 0 && i % 16 === 0 && i !== n) {
  38727. for (; r.length < 51; )
  38728. r += " ";
  38729. a += r + o + "\n",
  38730. r = o = ""
  38731. }
  38732. 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 ? " " : ""
  38733. }
  38734. if (e && " " !== r) {
  38735. for (; r.length < 51; )
  38736. r += " ";
  38737. a += r + o + "\n"
  38738. }
  38739. return e ? a : r
  38740. }
  38741. ,
  38742. o.fromDebug = function(e, t, i) {
  38743. 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; ) {
  38744. switch (n = e.charAt(l++)) {
  38745. case "!":
  38746. if (!i) {
  38747. if (u || d || p) {
  38748. f = !0;
  38749. break
  38750. }
  38751. u = d = p = !0
  38752. }
  38753. s.offset = s.markedOffset = s.limit = c,
  38754. h = !1;
  38755. break;
  38756. case "|":
  38757. if (!i) {
  38758. if (u || p) {
  38759. f = !0;
  38760. break
  38761. }
  38762. u = p = !0
  38763. }
  38764. s.offset = s.limit = c,
  38765. h = !1;
  38766. break;
  38767. case "[":
  38768. if (!i) {
  38769. if (u || d) {
  38770. f = !0;
  38771. break
  38772. }
  38773. u = d = !0
  38774. }
  38775. s.offset = s.markedOffset = c,
  38776. h = !1;
  38777. break;
  38778. case "<":
  38779. if (!i) {
  38780. if (u) {
  38781. f = !0;
  38782. break
  38783. }
  38784. u = !0
  38785. }
  38786. s.offset = c,
  38787. h = !1;
  38788. break;
  38789. case "]":
  38790. if (!i) {
  38791. if (p || d) {
  38792. f = !0;
  38793. break
  38794. }
  38795. p = d = !0
  38796. }
  38797. s.limit = s.markedOffset = c,
  38798. h = !1;
  38799. break;
  38800. case ">":
  38801. if (!i) {
  38802. if (p) {
  38803. f = !0;
  38804. break
  38805. }
  38806. p = !0
  38807. }
  38808. s.limit = c,
  38809. h = !1;
  38810. break;
  38811. case "'":
  38812. if (!i) {
  38813. if (d) {
  38814. f = !0;
  38815. break
  38816. }
  38817. d = !0
  38818. }
  38819. s.markedOffset = c,
  38820. h = !1;
  38821. break;
  38822. case " ":
  38823. h = !1;
  38824. break;
  38825. default:
  38826. if (!i && h) {
  38827. f = !0;
  38828. break
  38829. }
  38830. if (r = parseInt(n + e.charAt(l++), 16),
  38831. !i && (isNaN(r) || r < 0 || r > 255))
  38832. throw TypeError("Illegal str: Not a debug encoded string");
  38833. s.view[c++] = r,
  38834. h = !0
  38835. }
  38836. if (f)
  38837. throw TypeError("Illegal str: Invalid symbol at " + l)
  38838. }
  38839. if (!i) {
  38840. if (!u || !p)
  38841. throw TypeError("Illegal str: Missing offset or limit");
  38842. if (c < s.buffer.byteLength)
  38843. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38844. }
  38845. return s
  38846. }
  38847. ,
  38848. a.toHex = function(e, t) {
  38849. if (e = "undefined" == typeof e ? this.offset : e,
  38850. t = "undefined" == typeof t ? this.limit : t,
  38851. !this.noAssert) {
  38852. if ("number" != typeof e || e % 1 !== 0)
  38853. throw TypeError("Illegal begin: Not an integer");
  38854. if (e >>>= 0,
  38855. "number" != typeof t || t % 1 !== 0)
  38856. throw TypeError("Illegal end: Not an integer");
  38857. if (t >>>= 0,
  38858. e < 0 || e > t || t > this.buffer.byteLength)
  38859. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38860. }
  38861. for (var i, n = new Array(t - e); e < t; )
  38862. i = this.view[e++],
  38863. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38864. return n.join("")
  38865. }
  38866. ,
  38867. o.fromHex = function(e, t, i) {
  38868. if (!i) {
  38869. if ("string" != typeof e)
  38870. throw TypeError("Illegal str: Not a string");
  38871. if (e.length % 2 !== 0)
  38872. throw TypeError("Illegal str: Length not a multiple of 2")
  38873. }
  38874. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38875. if (n = parseInt(e.substring(s, s + 2), 16),
  38876. !i && (!isFinite(n) || n < 0 || n > 255))
  38877. throw TypeError("Illegal str: Contains non-hex characters");
  38878. a.view[l++] = n
  38879. }
  38880. return a.limit = l,
  38881. a
  38882. }
  38883. ;
  38884. var h = function() {
  38885. var e = {};
  38886. return e.MAX_CODEPOINT = 1114111,
  38887. e.encodeUTF8 = function(e, t) {
  38888. var i = null;
  38889. for ("number" == typeof e && (i = e,
  38890. e = function() {
  38891. return null
  38892. }
  38893. ); null !== i || null !== (i = e()); )
  38894. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38895. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38896. t(i >> 6 & 63 | 128),
  38897. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38898. t(i >> 12 & 63 | 128),
  38899. t(i >> 6 & 63 | 128),
  38900. t(63 & i | 128)),
  38901. i = null
  38902. }
  38903. ,
  38904. e.decodeUTF8 = function(e, t) {
  38905. for (var i, n, r, o, a = function(e) {
  38906. e = e.slice(0, e.indexOf(null));
  38907. var t = Error(e.toString());
  38908. throw t.name = "TruncatedError",
  38909. t.bytes = e,
  38910. t
  38911. }; null !== (i = e()); )
  38912. if (0 === (128 & i))
  38913. t(i);
  38914. else if (192 === (224 & i))
  38915. null === (n = e()) && a([i, n]),
  38916. t((31 & i) << 6 | 63 & n);
  38917. else if (224 === (240 & i))
  38918. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38919. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38920. else {
  38921. if (240 !== (248 & i))
  38922. throw RangeError("Illegal starting byte: " + i);
  38923. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38924. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38925. }
  38926. }
  38927. ,
  38928. e.UTF16toUTF8 = function(e, t) {
  38929. for (var i, n = null; ; ) {
  38930. if (null === (i = null !== n ? n : e()))
  38931. break;
  38932. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38933. n = null) : t(i)
  38934. }
  38935. null !== n && t(n)
  38936. }
  38937. ,
  38938. e.UTF8toUTF16 = function(e, t) {
  38939. var i = null;
  38940. for ("number" == typeof e && (i = e,
  38941. e = function() {
  38942. return null
  38943. }
  38944. ); null !== i || null !== (i = e()); )
  38945. i <= 65535 ? t(i) : (i -= 65536,
  38946. t((i >> 10) + 55296),
  38947. t(i % 1024 + 56320)),
  38948. i = null
  38949. }
  38950. ,
  38951. e.encodeUTF16toUTF8 = function(t, i) {
  38952. e.UTF16toUTF8(t, function(t) {
  38953. e.encodeUTF8(t, i)
  38954. })
  38955. }
  38956. ,
  38957. e.decodeUTF8toUTF16 = function(t, i) {
  38958. e.decodeUTF8(t, function(t) {
  38959. e.UTF8toUTF16(t, i)
  38960. })
  38961. }
  38962. ,
  38963. e.calculateCodePoint = function(e) {
  38964. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38965. }
  38966. ,
  38967. e.calculateUTF8 = function(e) {
  38968. for (var t, i = 0; null !== (t = e()); )
  38969. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38970. return i
  38971. }
  38972. ,
  38973. e.calculateUTF16asUTF8 = function(t) {
  38974. var i = 0
  38975. , n = 0;
  38976. return e.UTF16toUTF8(t, function(e) {
  38977. ++i,
  38978. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38979. }),
  38980. [i, n]
  38981. }
  38982. ,
  38983. e
  38984. }();
  38985. return a.toUTF8 = function(e, t) {
  38986. if ("undefined" == typeof e && (e = this.offset),
  38987. "undefined" == typeof t && (t = this.limit),
  38988. !this.noAssert) {
  38989. if ("number" != typeof e || e % 1 !== 0)
  38990. throw TypeError("Illegal begin: Not an integer");
  38991. if (e >>>= 0,
  38992. "number" != typeof t || t % 1 !== 0)
  38993. throw TypeError("Illegal end: Not an integer");
  38994. if (t >>>= 0,
  38995. e < 0 || e > t || t > this.buffer.byteLength)
  38996. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38997. }
  38998. var n;
  38999. try {
  39000. h.decodeUTF8toUTF16(function() {
  39001. return e < t ? this.view[e++] : null
  39002. }
  39003. .bind(this), n = i())
  39004. } catch (i) {
  39005. if (e !== t)
  39006. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39007. }
  39008. return n()
  39009. }
  39010. ,
  39011. o.fromUTF8 = function(e, i, n) {
  39012. if (!n && "string" != typeof e)
  39013. throw TypeError("Illegal str: Not a string");
  39014. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39015. , a = 0;
  39016. return h.encodeUTF16toUTF8(t(e), function(e) {
  39017. r.view[a++] = e
  39018. }),
  39019. r.limit = a,
  39020. r
  39021. }
  39022. ,
  39023. o
  39024. })
  39025. }
  39026. , {
  39027. long: 216
  39028. }],
  39029. 216: [function(e, t, i) {
  39030. !function(i, n) {
  39031. "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()
  39032. }(this, function() {
  39033. "use strict";
  39034. function e(e, t, i) {
  39035. this.low = 0 | e,
  39036. this.high = 0 | t,
  39037. this.unsigned = !!i
  39038. }
  39039. function t(e) {
  39040. return (e && e.__isLong__) === !0
  39041. }
  39042. function i(e, t) {
  39043. var i, n, o;
  39044. return t ? (e >>>= 0,
  39045. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39046. o && (l[e] = i),
  39047. i)) : (e |= 0,
  39048. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39049. o && (s[e] = i),
  39050. i))
  39051. }
  39052. function n(e, t) {
  39053. if (isNaN(e) || !isFinite(e))
  39054. return t ? m : g;
  39055. if (t) {
  39056. if (e < 0)
  39057. return m;
  39058. if (e >= d)
  39059. return I
  39060. } else {
  39061. if (e <= -p)
  39062. return E;
  39063. if (e + 1 >= p)
  39064. return C
  39065. }
  39066. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39067. }
  39068. function r(t, i, n) {
  39069. return new e(t,i,n)
  39070. }
  39071. function o(e, t, i) {
  39072. if (0 === e.length)
  39073. throw Error("empty string");
  39074. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39075. return g;
  39076. if ("number" == typeof t ? (i = t,
  39077. t = !1) : t = !!t,
  39078. i = i || 10,
  39079. i < 2 || 36 < i)
  39080. throw RangeError("radix");
  39081. var r;
  39082. if ((r = e.indexOf("-")) > 0)
  39083. throw Error("interior hyphen");
  39084. if (0 === r)
  39085. return o(e.substring(1), t, i).neg();
  39086. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39087. var h = Math.min(8, e.length - l)
  39088. , u = parseInt(e.substring(l, l + h), i);
  39089. if (h < 8) {
  39090. var d = n(c(i, h));
  39091. s = s.mul(d).add(n(u))
  39092. } else
  39093. s = s.mul(a),
  39094. s = s.add(n(u))
  39095. }
  39096. return s.unsigned = t,
  39097. s
  39098. }
  39099. function a(t) {
  39100. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39101. }
  39102. e.prototype.__isLong__,
  39103. Object.defineProperty(e.prototype, "__isLong__", {
  39104. value: !0,
  39105. enumerable: !1,
  39106. configurable: !1
  39107. }),
  39108. e.isLong = t;
  39109. var s = {}
  39110. , l = {};
  39111. e.fromInt = i,
  39112. e.fromNumber = n,
  39113. e.fromBits = r;
  39114. var c = Math.pow;
  39115. e.fromString = o,
  39116. e.fromValue = a;
  39117. var h = 1 << 24
  39118. , u = 4294967296
  39119. , d = 0x10000000000000000
  39120. , p = d / 2
  39121. , f = i(h)
  39122. , g = i(0);
  39123. e.ZERO = g;
  39124. var m = i(0, !0);
  39125. e.UZERO = m;
  39126. var v = i(1);
  39127. e.ONE = v;
  39128. var A = i(1, !0);
  39129. e.UONE = A;
  39130. var y = i(-1);
  39131. e.NEG_ONE = y;
  39132. var C = r(-1, 2147483647, !1);
  39133. e.MAX_VALUE = C;
  39134. var I = r(-1, -1, !0);
  39135. e.MAX_UNSIGNED_VALUE = I;
  39136. var E = r(0, -2147483648, !1);
  39137. e.MIN_VALUE = E;
  39138. var b = e.prototype;
  39139. return b.toInt = function() {
  39140. return this.unsigned ? this.low >>> 0 : this.low
  39141. }
  39142. ,
  39143. b.toNumber = function() {
  39144. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39145. }
  39146. ,
  39147. b.toString = function(e) {
  39148. if (e = e || 10,
  39149. e < 2 || 36 < e)
  39150. throw RangeError("radix");
  39151. if (this.isZero())
  39152. return "0";
  39153. if (this.isNegative()) {
  39154. if (this.eq(E)) {
  39155. var t = n(e)
  39156. , i = this.div(t)
  39157. , r = i.mul(t).sub(this);
  39158. return i.toString(e) + r.toInt().toString(e)
  39159. }
  39160. return "-" + this.neg().toString(e)
  39161. }
  39162. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39163. var l = a.div(o)
  39164. , h = a.sub(l.mul(o)).toInt() >>> 0
  39165. , u = h.toString(e);
  39166. if (a = l,
  39167. a.isZero())
  39168. return u + s;
  39169. for (; u.length < 6; )
  39170. u = "0" + u;
  39171. s = "" + u + s
  39172. }
  39173. }
  39174. ,
  39175. b.getHighBits = function() {
  39176. return this.high
  39177. }
  39178. ,
  39179. b.getHighBitsUnsigned = function() {
  39180. return this.high >>> 0
  39181. }
  39182. ,
  39183. b.getLowBits = function() {
  39184. return this.low
  39185. }
  39186. ,
  39187. b.getLowBitsUnsigned = function() {
  39188. return this.low >>> 0
  39189. }
  39190. ,
  39191. b.getNumBitsAbs = function() {
  39192. if (this.isNegative())
  39193. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39194. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39195. ;
  39196. return 0 != this.high ? t + 33 : t + 1
  39197. }
  39198. ,
  39199. b.isZero = function() {
  39200. return 0 === this.high && 0 === this.low
  39201. }
  39202. ,
  39203. b.isNegative = function() {
  39204. return !this.unsigned && this.high < 0
  39205. }
  39206. ,
  39207. b.isPositive = function() {
  39208. return this.unsigned || this.high >= 0
  39209. }
  39210. ,
  39211. b.isOdd = function() {
  39212. return 1 === (1 & this.low)
  39213. }
  39214. ,
  39215. b.isEven = function() {
  39216. return 0 === (1 & this.low)
  39217. }
  39218. ,
  39219. b.equals = function(e) {
  39220. return t(e) || (e = a(e)),
  39221. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39222. }
  39223. ,
  39224. b.eq = b.equals,
  39225. b.notEquals = function(e) {
  39226. return !this.eq(e)
  39227. }
  39228. ,
  39229. b.neq = b.notEquals,
  39230. b.lessThan = function(e) {
  39231. return this.comp(e) < 0
  39232. }
  39233. ,
  39234. b.lt = b.lessThan,
  39235. b.lessThanOrEqual = function(e) {
  39236. return this.comp(e) <= 0
  39237. }
  39238. ,
  39239. b.lte = b.lessThanOrEqual,
  39240. b.greaterThan = function(e) {
  39241. return this.comp(e) > 0
  39242. }
  39243. ,
  39244. b.gt = b.greaterThan,
  39245. b.greaterThanOrEqual = function(e) {
  39246. return this.comp(e) >= 0
  39247. }
  39248. ,
  39249. b.gte = b.greaterThanOrEqual,
  39250. b.compare = function(e) {
  39251. if (t(e) || (e = a(e)),
  39252. this.eq(e))
  39253. return 0;
  39254. var i = this.isNegative()
  39255. , n = e.isNegative();
  39256. 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
  39257. }
  39258. ,
  39259. b.comp = b.compare,
  39260. b.negate = function() {
  39261. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39262. }
  39263. ,
  39264. b.neg = b.negate,
  39265. b.add = function(e) {
  39266. t(e) || (e = a(e));
  39267. var i = this.high >>> 16
  39268. , n = 65535 & this.high
  39269. , o = this.low >>> 16
  39270. , s = 65535 & this.low
  39271. , l = e.high >>> 16
  39272. , c = 65535 & e.high
  39273. , h = e.low >>> 16
  39274. , u = 65535 & e.low
  39275. , d = 0
  39276. , p = 0
  39277. , f = 0
  39278. , g = 0;
  39279. return g += s + u,
  39280. f += g >>> 16,
  39281. g &= 65535,
  39282. f += o + h,
  39283. p += f >>> 16,
  39284. f &= 65535,
  39285. p += n + c,
  39286. d += p >>> 16,
  39287. p &= 65535,
  39288. d += i + l,
  39289. d &= 65535,
  39290. r(f << 16 | g, d << 16 | p, this.unsigned)
  39291. }
  39292. ,
  39293. b.subtract = function(e) {
  39294. return t(e) || (e = a(e)),
  39295. this.add(e.neg())
  39296. }
  39297. ,
  39298. b.sub = b.subtract,
  39299. b.multiply = function(e) {
  39300. if (this.isZero())
  39301. return g;
  39302. if (t(e) || (e = a(e)),
  39303. e.isZero())
  39304. return g;
  39305. if (this.eq(E))
  39306. return e.isOdd() ? E : g;
  39307. if (e.eq(E))
  39308. return this.isOdd() ? E : g;
  39309. if (this.isNegative())
  39310. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39311. if (e.isNegative())
  39312. return this.mul(e.neg()).neg();
  39313. if (this.lt(f) && e.lt(f))
  39314. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39315. var i = this.high >>> 16
  39316. , o = 65535 & this.high
  39317. , s = this.low >>> 16
  39318. , l = 65535 & this.low
  39319. , c = e.high >>> 16
  39320. , h = 65535 & e.high
  39321. , u = e.low >>> 16
  39322. , d = 65535 & e.low
  39323. , p = 0
  39324. , m = 0
  39325. , v = 0
  39326. , A = 0;
  39327. return A += l * d,
  39328. v += A >>> 16,
  39329. A &= 65535,
  39330. v += s * d,
  39331. m += v >>> 16,
  39332. v &= 65535,
  39333. v += l * u,
  39334. m += v >>> 16,
  39335. v &= 65535,
  39336. m += o * d,
  39337. p += m >>> 16,
  39338. m &= 65535,
  39339. m += s * u,
  39340. p += m >>> 16,
  39341. m &= 65535,
  39342. m += l * h,
  39343. p += m >>> 16,
  39344. m &= 65535,
  39345. p += i * d + o * u + s * h + l * c,
  39346. p &= 65535,
  39347. r(v << 16 | A, p << 16 | m, this.unsigned)
  39348. }
  39349. ,
  39350. b.mul = b.multiply,
  39351. b.divide = function(e) {
  39352. if (t(e) || (e = a(e)),
  39353. e.isZero())
  39354. throw Error("division by zero");
  39355. if (this.isZero())
  39356. return this.unsigned ? m : g;
  39357. var i, r, o;
  39358. if (this.unsigned) {
  39359. if (e.unsigned || (e = e.toUnsigned()),
  39360. e.gt(this))
  39361. return m;
  39362. if (e.gt(this.shru(1)))
  39363. return A;
  39364. o = m
  39365. } else {
  39366. if (this.eq(E)) {
  39367. if (e.eq(v) || e.eq(y))
  39368. return E;
  39369. if (e.eq(E))
  39370. return v;
  39371. var s = this.shr(1);
  39372. return i = s.div(e).shl(1),
  39373. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39374. o = i.add(r.div(e)))
  39375. }
  39376. if (e.eq(E))
  39377. return this.unsigned ? m : g;
  39378. if (this.isNegative())
  39379. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39380. if (e.isNegative())
  39381. return this.div(e.neg()).neg();
  39382. o = g
  39383. }
  39384. for (r = this; r.gte(e); ) {
  39385. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39386. 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); )
  39387. i -= h,
  39388. u = n(i, this.unsigned),
  39389. d = u.mul(e);
  39390. u.isZero() && (u = v),
  39391. o = o.add(u),
  39392. r = r.sub(d)
  39393. }
  39394. return o
  39395. }
  39396. ,
  39397. b.div = b.divide,
  39398. b.modulo = function(e) {
  39399. return t(e) || (e = a(e)),
  39400. this.sub(this.div(e).mul(e))
  39401. }
  39402. ,
  39403. b.mod = b.modulo,
  39404. b.not = function() {
  39405. return r(~this.low, ~this.high, this.unsigned)
  39406. }
  39407. ,
  39408. b.and = function(e) {
  39409. return t(e) || (e = a(e)),
  39410. r(this.low & e.low, this.high & e.high, this.unsigned)
  39411. }
  39412. ,
  39413. b.or = function(e) {
  39414. return t(e) || (e = a(e)),
  39415. r(this.low | e.low, this.high | e.high, this.unsigned)
  39416. }
  39417. ,
  39418. b.xor = function(e) {
  39419. return t(e) || (e = a(e)),
  39420. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39421. }
  39422. ,
  39423. b.shiftLeft = function(e) {
  39424. return t(e) && (e = e.toInt()),
  39425. 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)
  39426. }
  39427. ,
  39428. b.shl = b.shiftLeft,
  39429. b.shiftRight = function(e) {
  39430. return t(e) && (e = e.toInt()),
  39431. 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)
  39432. }
  39433. ,
  39434. b.shr = b.shiftRight,
  39435. b.shiftRightUnsigned = function(e) {
  39436. if (t(e) && (e = e.toInt()),
  39437. e &= 63,
  39438. 0 === e)
  39439. return this;
  39440. var i = this.high;
  39441. if (e < 32) {
  39442. var n = this.low;
  39443. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39444. }
  39445. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39446. }
  39447. ,
  39448. b.shru = b.shiftRightUnsigned,
  39449. b.toSigned = function() {
  39450. return this.unsigned ? r(this.low, this.high, !1) : this
  39451. }
  39452. ,
  39453. b.toUnsigned = function() {
  39454. return this.unsigned ? this : r(this.low, this.high, !0)
  39455. }
  39456. ,
  39457. b.toBytes = function(e) {
  39458. return e ? this.toBytesLE() : this.toBytesBE()
  39459. }
  39460. ,
  39461. b.toBytesLE = function() {
  39462. var e = this.high
  39463. , t = this.low;
  39464. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39465. }
  39466. ,
  39467. b.toBytesBE = function() {
  39468. var e = this.high
  39469. , t = this.low;
  39470. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39471. }
  39472. ,
  39473. e
  39474. })
  39475. }
  39476. , {}],
  39477. 217: [function(e, t, i) {
  39478. var n = {
  39479. REVISION: "75"
  39480. };
  39481. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39482. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39483. void 0 === Math.sign && (Math.sign = function(e) {
  39484. return e < 0 ? -1 : e > 0 ? 1 : +e
  39485. }
  39486. ),
  39487. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39488. get: function() {
  39489. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39490. }
  39491. }),
  39492. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39493. writable: !0,
  39494. configurable: !0,
  39495. value: function(e) {
  39496. "use strict";
  39497. if (void 0 === e || null === e)
  39498. throw new TypeError("Cannot convert first argument to object");
  39499. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39500. var r = arguments[i];
  39501. if (void 0 !== r && null !== r) {
  39502. r = Object(r);
  39503. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39504. var l = o[a]
  39505. , c = Object.getOwnPropertyDescriptor(r, l);
  39506. void 0 !== c && c.enumerable && (t[l] = r[l])
  39507. }
  39508. }
  39509. }
  39510. return t
  39511. }
  39512. }),
  39513. n.MOUSE = {
  39514. LEFT: 0,
  39515. MIDDLE: 1,
  39516. RIGHT: 2
  39517. },
  39518. n.CullFaceNone = 0,
  39519. n.CullFaceBack = 1,
  39520. n.CullFaceFront = 2,
  39521. n.CullFaceFrontBack = 3,
  39522. n.FrontFaceDirectionCW = 0,
  39523. n.FrontFaceDirectionCCW = 1,
  39524. n.BasicShadowMap = 0,
  39525. n.PCFShadowMap = 1,
  39526. n.PCFSoftShadowMap = 2,
  39527. n.FrontSide = 0,
  39528. n.BackSide = 1,
  39529. n.DoubleSide = 2,
  39530. n.FlatShading = 1,
  39531. n.SmoothShading = 2,
  39532. n.NoColors = 0,
  39533. n.FaceColors = 1,
  39534. n.VertexColors = 2,
  39535. n.NoBlending = 0,
  39536. n.NormalBlending = 1,
  39537. n.AdditiveBlending = 2,
  39538. n.SubtractiveBlending = 3,
  39539. n.MultiplyBlending = 4,
  39540. n.CustomBlending = 5,
  39541. n.AddEquation = 100,
  39542. n.SubtractEquation = 101,
  39543. n.ReverseSubtractEquation = 102,
  39544. n.MinEquation = 103,
  39545. n.MaxEquation = 104,
  39546. n.ZeroFactor = 200,
  39547. n.OneFactor = 201,
  39548. n.SrcColorFactor = 202,
  39549. n.OneMinusSrcColorFactor = 203,
  39550. n.SrcAlphaFactor = 204,
  39551. n.OneMinusSrcAlphaFactor = 205,
  39552. n.DstAlphaFactor = 206,
  39553. n.OneMinusDstAlphaFactor = 207,
  39554. n.DstColorFactor = 208,
  39555. n.OneMinusDstColorFactor = 209,
  39556. n.SrcAlphaSaturateFactor = 210,
  39557. n.NeverDepth = 0,
  39558. n.AlwaysDepth = 1,
  39559. n.LessDepth = 2,
  39560. n.LessEqualDepth = 3,
  39561. n.EqualDepth = 4,
  39562. n.GreaterEqualDepth = 5,
  39563. n.GreaterDepth = 6,
  39564. n.NotEqualDepth = 7,
  39565. n.MultiplyOperation = 0,
  39566. n.MixOperation = 1,
  39567. n.AddOperation = 2,
  39568. n.NoToneMapping = 0,
  39569. n.LinearToneMapping = 1,
  39570. n.ReinhardToneMapping = 2,
  39571. n.Uncharted2ToneMapping = 3,
  39572. n.CineonToneMapping = 4,
  39573. n.UVMapping = 300,
  39574. n.CubeReflectionMapping = 301,
  39575. n.CubeRefractionMapping = 302,
  39576. n.EquirectangularReflectionMapping = 303,
  39577. n.EquirectangularRefractionMapping = 304,
  39578. n.SphericalReflectionMapping = 305,
  39579. n.CubeUVReflectionMapping = 306,
  39580. n.CubeUVRefractionMapping = 307,
  39581. n.RepeatWrapping = 1e3,
  39582. n.ClampToEdgeWrapping = 1001,
  39583. n.MirroredRepeatWrapping = 1002,
  39584. n.NearestFilter = 1003,
  39585. n.NearestMipMapNearestFilter = 1004,
  39586. n.NearestMipMapLinearFilter = 1005,
  39587. n.LinearFilter = 1006,
  39588. n.LinearMipMapNearestFilter = 1007,
  39589. n.LinearMipMapLinearFilter = 1008,
  39590. n.UnsignedByteType = 1009,
  39591. n.ByteType = 1010,
  39592. n.ShortType = 1011,
  39593. n.UnsignedShortType = 1012,
  39594. n.IntType = 1013,
  39595. n.UnsignedIntType = 1014,
  39596. n.FloatType = 1015,
  39597. n.HalfFloatType = 1025,
  39598. n.UnsignedShort4444Type = 1016,
  39599. n.UnsignedShort5551Type = 1017,
  39600. n.UnsignedShort565Type = 1018,
  39601. n.AlphaFormat = 1019,
  39602. n.RGBFormat = 1020,
  39603. n.RGBAFormat = 1021,
  39604. n.LuminanceFormat = 1022,
  39605. n.LuminanceAlphaFormat = 1023,
  39606. n.RGBEFormat = n.RGBAFormat,
  39607. n.RGB_S3TC_DXT1_Format = 2001,
  39608. n.RGBA_S3TC_DXT1_Format = 2002,
  39609. n.RGBA_S3TC_DXT3_Format = 2003,
  39610. n.RGBA_S3TC_DXT5_Format = 2004,
  39611. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39612. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39613. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39614. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39615. n.RGB_ETC1_Format = 2151,
  39616. n.LoopOnce = 2200,
  39617. n.LoopRepeat = 2201,
  39618. n.LoopPingPong = 2202,
  39619. n.InterpolateDiscrete = 2300,
  39620. n.InterpolateLinear = 2301,
  39621. n.InterpolateSmooth = 2302,
  39622. n.ZeroCurvatureEnding = 2400,
  39623. n.ZeroSlopeEnding = 2401,
  39624. n.WrapAroundEnding = 2402,
  39625. n.TrianglesDrawMode = 0,
  39626. n.TriangleStripDrawMode = 1,
  39627. n.TriangleFanDrawMode = 2,
  39628. n.LinearEncoding = 3e3,
  39629. n.sRGBEncoding = 3001,
  39630. n.GammaEncoding = 3007,
  39631. n.RGBEEncoding = 3002,
  39632. n.LogLuvEncoding = 3003,
  39633. n.RGBM7Encoding = 3004,
  39634. n.RGBM16Encoding = 3005,
  39635. n.RGBDEncoding = 3006,
  39636. n.Color = function(e) {
  39637. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39638. }
  39639. ,
  39640. n.Color.prototype = {
  39641. constructor: n.Color,
  39642. r: 1,
  39643. g: 1,
  39644. b: 1,
  39645. set: function(e) {
  39646. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39647. this
  39648. },
  39649. setScalar: function(e) {
  39650. this.r = e,
  39651. this.g = e,
  39652. this.b = e
  39653. },
  39654. setHex: function(e) {
  39655. return e = Math.floor(e),
  39656. this.r = (e >> 16 & 255) / 255,
  39657. this.g = (e >> 8 & 255) / 255,
  39658. this.b = (255 & e) / 255,
  39659. this
  39660. },
  39661. setRGB: function(e, t, i) {
  39662. return this.r = e,
  39663. this.g = t,
  39664. this.b = i,
  39665. this
  39666. },
  39667. setHSL: function() {
  39668. function e(e, t, i) {
  39669. return i < 0 && (i += 1),
  39670. i > 1 && (i -= 1),
  39671. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39672. }
  39673. return function(t, i, r) {
  39674. if (t = n.Math.euclideanModulo(t, 1),
  39675. i = n.Math.clamp(i, 0, 1),
  39676. r = n.Math.clamp(r, 0, 1),
  39677. 0 === i)
  39678. this.r = this.g = this.b = r;
  39679. else {
  39680. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39681. , a = 2 * r - o;
  39682. this.r = e(a, o, t + 1 / 3),
  39683. this.g = e(a, o, t),
  39684. this.b = e(a, o, t - 1 / 3)
  39685. }
  39686. return this
  39687. }
  39688. }(),
  39689. setStyle: function(e) {
  39690. function t(t) {
  39691. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39692. }
  39693. var i;
  39694. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39695. var r, o = i[1], a = i[2];
  39696. switch (o) {
  39697. case "rgb":
  39698. case "rgba":
  39699. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39700. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39701. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39702. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39703. t(r[5]),
  39704. this;
  39705. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39706. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39707. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39708. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39709. t(r[5]),
  39710. this;
  39711. break;
  39712. case "hsl":
  39713. case "hsla":
  39714. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39715. var s = parseFloat(r[1]) / 360
  39716. , l = parseInt(r[2], 10) / 100
  39717. , c = parseInt(r[3], 10) / 100;
  39718. return t(r[5]),
  39719. this.setHSL(s, l, c)
  39720. }
  39721. }
  39722. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39723. var h = i[1]
  39724. , u = h.length;
  39725. if (3 === u)
  39726. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39727. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39728. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39729. this;
  39730. if (6 === u)
  39731. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39732. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39733. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39734. this
  39735. }
  39736. if (e && e.length > 0) {
  39737. var h = n.ColorKeywords[e];
  39738. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39739. }
  39740. return this
  39741. },
  39742. clone: function() {
  39743. return new this.constructor(this.r,this.g,this.b)
  39744. },
  39745. copy: function(e) {
  39746. return this.r = e.r,
  39747. this.g = e.g,
  39748. this.b = e.b,
  39749. this
  39750. },
  39751. copyGammaToLinear: function(e, t) {
  39752. return void 0 === t && (t = 2),
  39753. this.r = Math.pow(e.r, t),
  39754. this.g = Math.pow(e.g, t),
  39755. this.b = Math.pow(e.b, t),
  39756. this
  39757. },
  39758. copyLinearToGamma: function(e, t) {
  39759. void 0 === t && (t = 2);
  39760. var i = t > 0 ? 1 / t : 1;
  39761. return this.r = Math.pow(e.r, i),
  39762. this.g = Math.pow(e.g, i),
  39763. this.b = Math.pow(e.b, i),
  39764. this
  39765. },
  39766. convertGammaToLinear: function() {
  39767. var e = this.r
  39768. , t = this.g
  39769. , i = this.b;
  39770. return this.r = e * e,
  39771. this.g = t * t,
  39772. this.b = i * i,
  39773. this
  39774. },
  39775. convertLinearToGamma: function() {
  39776. return this.r = Math.sqrt(this.r),
  39777. this.g = Math.sqrt(this.g),
  39778. this.b = Math.sqrt(this.b),
  39779. this
  39780. },
  39781. getHex: function() {
  39782. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39783. },
  39784. getHexString: function() {
  39785. return ("000000" + this.getHex().toString(16)).slice(-6)
  39786. },
  39787. getHSL: function(e) {
  39788. var t, i, n = e || {
  39789. h: 0,
  39790. s: 0,
  39791. l: 0
  39792. }, 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;
  39793. if (l === s)
  39794. t = 0,
  39795. i = 0;
  39796. else {
  39797. var h = s - l;
  39798. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39799. s) {
  39800. case r:
  39801. t = (o - a) / h + (o < a ? 6 : 0);
  39802. break;
  39803. case o:
  39804. t = (a - r) / h + 2;
  39805. break;
  39806. case a:
  39807. t = (r - o) / h + 4
  39808. }
  39809. t /= 6
  39810. }
  39811. return n.h = t,
  39812. n.s = i,
  39813. n.l = c,
  39814. n
  39815. },
  39816. getStyle: function() {
  39817. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39818. },
  39819. offsetHSL: function(e, t, i) {
  39820. var n = this.getHSL();
  39821. return n.h += e,
  39822. n.s += t,
  39823. n.l += i,
  39824. this.setHSL(n.h, n.s, n.l),
  39825. this
  39826. },
  39827. add: function(e) {
  39828. return this.r += e.r,
  39829. this.g += e.g,
  39830. this.b += e.b,
  39831. this
  39832. },
  39833. addColors: function(e, t) {
  39834. return this.r = e.r + t.r,
  39835. this.g = e.g + t.g,
  39836. this.b = e.b + t.b,
  39837. this
  39838. },
  39839. addScalar: function(e) {
  39840. return this.r += e,
  39841. this.g += e,
  39842. this.b += e,
  39843. this
  39844. },
  39845. multiply: function(e) {
  39846. return this.r *= e.r,
  39847. this.g *= e.g,
  39848. this.b *= e.b,
  39849. this
  39850. },
  39851. multiplyScalar: function(e) {
  39852. return this.r *= e,
  39853. this.g *= e,
  39854. this.b *= e,
  39855. this
  39856. },
  39857. lerp: function(e, t) {
  39858. return this.r += (e.r - this.r) * t,
  39859. this.g += (e.g - this.g) * t,
  39860. this.b += (e.b - this.b) * t,
  39861. this
  39862. },
  39863. equals: function(e) {
  39864. return e.r === this.r && e.g === this.g && e.b === this.b
  39865. },
  39866. fromArray: function(e, t) {
  39867. return void 0 === t && (t = 0),
  39868. this.r = e[t],
  39869. this.g = e[t + 1],
  39870. this.b = e[t + 2],
  39871. this
  39872. },
  39873. toArray: function(e, t) {
  39874. return void 0 === e && (e = []),
  39875. void 0 === t && (t = 0),
  39876. e[t] = this.r,
  39877. e[t + 1] = this.g,
  39878. e[t + 2] = this.b,
  39879. e
  39880. }
  39881. },
  39882. n.ColorKeywords = {
  39883. aliceblue: 15792383,
  39884. antiquewhite: 16444375,
  39885. aqua: 65535,
  39886. aquamarine: 8388564,
  39887. azure: 15794175,
  39888. beige: 16119260,
  39889. bisque: 16770244,
  39890. black: 0,
  39891. blanchedalmond: 16772045,
  39892. blue: 255,
  39893. blueviolet: 9055202,
  39894. brown: 10824234,
  39895. burlywood: 14596231,
  39896. cadetblue: 6266528,
  39897. chartreuse: 8388352,
  39898. chocolate: 13789470,
  39899. coral: 16744272,
  39900. cornflowerblue: 6591981,
  39901. cornsilk: 16775388,
  39902. crimson: 14423100,
  39903. cyan: 65535,
  39904. darkblue: 139,
  39905. darkcyan: 35723,
  39906. darkgoldenrod: 12092939,
  39907. darkgray: 11119017,
  39908. darkgreen: 25600,
  39909. darkgrey: 11119017,
  39910. darkkhaki: 12433259,
  39911. darkmagenta: 9109643,
  39912. darkolivegreen: 5597999,
  39913. darkorange: 16747520,
  39914. darkorchid: 10040012,
  39915. darkred: 9109504,
  39916. darksalmon: 15308410,
  39917. darkseagreen: 9419919,
  39918. darkslateblue: 4734347,
  39919. darkslategray: 3100495,
  39920. darkslategrey: 3100495,
  39921. darkturquoise: 52945,
  39922. darkviolet: 9699539,
  39923. deeppink: 16716947,
  39924. deepskyblue: 49151,
  39925. dimgray: 6908265,
  39926. dimgrey: 6908265,
  39927. dodgerblue: 2003199,
  39928. firebrick: 11674146,
  39929. floralwhite: 16775920,
  39930. forestgreen: 2263842,
  39931. fuchsia: 16711935,
  39932. gainsboro: 14474460,
  39933. ghostwhite: 16316671,
  39934. gold: 16766720,
  39935. goldenrod: 14329120,
  39936. gray: 8421504,
  39937. green: 32768,
  39938. greenyellow: 11403055,
  39939. grey: 8421504,
  39940. honeydew: 15794160,
  39941. hotpink: 16738740,
  39942. indianred: 13458524,
  39943. indigo: 4915330,
  39944. ivory: 16777200,
  39945. khaki: 15787660,
  39946. lavender: 15132410,
  39947. lavenderblush: 16773365,
  39948. lawngreen: 8190976,
  39949. lemonchiffon: 16775885,
  39950. lightblue: 11393254,
  39951. lightcoral: 15761536,
  39952. lightcyan: 14745599,
  39953. lightgoldenrodyellow: 16448210,
  39954. lightgray: 13882323,
  39955. lightgreen: 9498256,
  39956. lightgrey: 13882323,
  39957. lightpink: 16758465,
  39958. lightsalmon: 16752762,
  39959. lightseagreen: 2142890,
  39960. lightskyblue: 8900346,
  39961. lightslategray: 7833753,
  39962. lightslategrey: 7833753,
  39963. lightsteelblue: 11584734,
  39964. lightyellow: 16777184,
  39965. lime: 65280,
  39966. limegreen: 3329330,
  39967. linen: 16445670,
  39968. magenta: 16711935,
  39969. maroon: 8388608,
  39970. mediumaquamarine: 6737322,
  39971. mediumblue: 205,
  39972. mediumorchid: 12211667,
  39973. mediumpurple: 9662683,
  39974. mediumseagreen: 3978097,
  39975. mediumslateblue: 8087790,
  39976. mediumspringgreen: 64154,
  39977. mediumturquoise: 4772300,
  39978. mediumvioletred: 13047173,
  39979. midnightblue: 1644912,
  39980. mintcream: 16121850,
  39981. mistyrose: 16770273,
  39982. moccasin: 16770229,
  39983. navajowhite: 16768685,
  39984. navy: 128,
  39985. oldlace: 16643558,
  39986. olive: 8421376,
  39987. olivedrab: 7048739,
  39988. orange: 16753920,
  39989. orangered: 16729344,
  39990. orchid: 14315734,
  39991. palegoldenrod: 15657130,
  39992. palegreen: 10025880,
  39993. paleturquoise: 11529966,
  39994. palevioletred: 14381203,
  39995. papayawhip: 16773077,
  39996. peachpuff: 16767673,
  39997. peru: 13468991,
  39998. pink: 16761035,
  39999. plum: 14524637,
  40000. powderblue: 11591910,
  40001. purple: 8388736,
  40002. red: 16711680,
  40003. rosybrown: 12357519,
  40004. royalblue: 4286945,
  40005. saddlebrown: 9127187,
  40006. salmon: 16416882,
  40007. sandybrown: 16032864,
  40008. seagreen: 3050327,
  40009. seashell: 16774638,
  40010. sienna: 10506797,
  40011. silver: 12632256,
  40012. skyblue: 8900331,
  40013. slateblue: 6970061,
  40014. slategray: 7372944,
  40015. slategrey: 7372944,
  40016. snow: 16775930,
  40017. springgreen: 65407,
  40018. steelblue: 4620980,
  40019. tan: 13808780,
  40020. teal: 32896,
  40021. thistle: 14204888,
  40022. tomato: 16737095,
  40023. turquoise: 4251856,
  40024. violet: 15631086,
  40025. wheat: 16113331,
  40026. white: 16777215,
  40027. whitesmoke: 16119285,
  40028. yellow: 16776960,
  40029. yellowgreen: 10145074
  40030. },
  40031. n.Quaternion = function(e, t, i, n) {
  40032. this._x = e || 0,
  40033. this._y = t || 0,
  40034. this._z = i || 0,
  40035. this._w = void 0 !== n ? n : 1
  40036. }
  40037. ,
  40038. n.Quaternion.prototype = {
  40039. constructor: n.Quaternion,
  40040. get x() {
  40041. return this._x
  40042. },
  40043. set x(e) {
  40044. this._x = e,
  40045. this.onChangeCallback()
  40046. },
  40047. get y() {
  40048. return this._y
  40049. },
  40050. set y(e) {
  40051. this._y = e,
  40052. this.onChangeCallback()
  40053. },
  40054. get z() {
  40055. return this._z
  40056. },
  40057. set z(e) {
  40058. this._z = e,
  40059. this.onChangeCallback()
  40060. },
  40061. get w() {
  40062. return this._w
  40063. },
  40064. set w(e) {
  40065. this._w = e,
  40066. this.onChangeCallback()
  40067. },
  40068. set: function(e, t, i, n) {
  40069. return this._x = e,
  40070. this._y = t,
  40071. this._z = i,
  40072. this._w = n,
  40073. this.onChangeCallback(),
  40074. this
  40075. },
  40076. clone: function() {
  40077. return new this.constructor(this._x,this._y,this._z,this._w)
  40078. },
  40079. copy: function(e) {
  40080. return this._x = e.x,
  40081. this._y = e.y,
  40082. this._z = e.z,
  40083. this._w = e.w,
  40084. this.onChangeCallback(),
  40085. this
  40086. },
  40087. setFromEuler: function(e, t) {
  40088. if (e instanceof n.Euler == !1)
  40089. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40090. var i = Math.cos(e._x / 2)
  40091. , r = Math.cos(e._y / 2)
  40092. , o = Math.cos(e._z / 2)
  40093. , a = Math.sin(e._x / 2)
  40094. , s = Math.sin(e._y / 2)
  40095. , l = Math.sin(e._z / 2)
  40096. , c = e.order;
  40097. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40098. this._y = i * s * o - a * r * l,
  40099. this._z = i * r * l + a * s * o,
  40100. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40101. this._y = i * s * o - a * r * l,
  40102. this._z = i * r * l - a * s * o,
  40103. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40104. this._y = i * s * o + a * r * l,
  40105. this._z = i * r * l + a * s * o,
  40106. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40107. this._y = i * s * o + a * r * l,
  40108. this._z = i * r * l - a * s * o,
  40109. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40110. this._y = i * s * o + a * r * l,
  40111. this._z = i * r * l - a * s * o,
  40112. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40113. this._y = i * s * o - a * r * l,
  40114. this._z = i * r * l + a * s * o,
  40115. this._w = i * r * o + a * s * l),
  40116. t !== !1 && this.onChangeCallback(),
  40117. this
  40118. },
  40119. setFromAxisAngle: function(e, t) {
  40120. var i = t / 2
  40121. , n = Math.sin(i);
  40122. return this._x = e.x * n,
  40123. this._y = e.y * n,
  40124. this._z = e.z * n,
  40125. this._w = Math.cos(i),
  40126. this.onChangeCallback(),
  40127. this
  40128. },
  40129. setFromRotationMatrix: function(e) {
  40130. 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;
  40131. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40132. this._w = .25 / t,
  40133. this._x = (h - l) * t,
  40134. this._y = (o - c) * t,
  40135. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40136. this._w = (h - l) / t,
  40137. this._x = .25 * t,
  40138. this._y = (r + a) / t,
  40139. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40140. this._w = (o - c) / t,
  40141. this._x = (r + a) / t,
  40142. this._y = .25 * t,
  40143. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40144. this._w = (a - r) / t,
  40145. this._x = (o + c) / t,
  40146. this._y = (l + h) / t,
  40147. this._z = .25 * t),
  40148. this.onChangeCallback(),
  40149. this
  40150. },
  40151. setFromUnitVectors: function() {
  40152. var e, t, i = 1e-6;
  40153. return function(r, o) {
  40154. return void 0 === e && (e = new n.Vector3),
  40155. t = r.dot(o) + 1,
  40156. t < i ? (t = 0,
  40157. 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),
  40158. this._x = e.x,
  40159. this._y = e.y,
  40160. this._z = e.z,
  40161. this._w = t,
  40162. this.normalize(),
  40163. this
  40164. }
  40165. }(),
  40166. inverse: function() {
  40167. return this.conjugate().normalize(),
  40168. this
  40169. },
  40170. conjugate: function() {
  40171. return this._x *= -1,
  40172. this._y *= -1,
  40173. this._z *= -1,
  40174. this.onChangeCallback(),
  40175. this
  40176. },
  40177. dot: function(e) {
  40178. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40179. },
  40180. lengthSq: function() {
  40181. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40182. },
  40183. length: function() {
  40184. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40185. },
  40186. normalize: function() {
  40187. var e = this.length();
  40188. return 0 === e ? (this._x = 0,
  40189. this._y = 0,
  40190. this._z = 0,
  40191. this._w = 1) : (e = 1 / e,
  40192. this._x = this._x * e,
  40193. this._y = this._y * e,
  40194. this._z = this._z * e,
  40195. this._w = this._w * e),
  40196. this.onChangeCallback(),
  40197. this
  40198. },
  40199. multiply: function(e, t) {
  40200. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40201. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40202. },
  40203. multiplyQuaternions: function(e, t) {
  40204. var i = e._x
  40205. , n = e._y
  40206. , r = e._z
  40207. , o = e._w
  40208. , a = t._x
  40209. , s = t._y
  40210. , l = t._z
  40211. , c = t._w;
  40212. return this._x = i * c + o * a + n * l - r * s,
  40213. this._y = n * c + o * s + r * a - i * l,
  40214. this._z = r * c + o * l + i * s - n * a,
  40215. this._w = o * c - i * a - n * s - r * l,
  40216. this.onChangeCallback(),
  40217. this
  40218. },
  40219. slerp: function(e, t) {
  40220. if (0 === t)
  40221. return this;
  40222. if (1 === t)
  40223. return this.copy(e);
  40224. var i = this._x
  40225. , n = this._y
  40226. , r = this._z
  40227. , o = this._w
  40228. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40229. if (a < 0 ? (this._w = -e._w,
  40230. this._x = -e._x,
  40231. this._y = -e._y,
  40232. this._z = -e._z,
  40233. a = -a) : this.copy(e),
  40234. a >= 1)
  40235. return this._w = o,
  40236. this._x = i,
  40237. this._y = n,
  40238. this._z = r,
  40239. this;
  40240. var s = Math.sqrt(1 - a * a);
  40241. if (Math.abs(s) < .001)
  40242. return this._w = .5 * (o + this._w),
  40243. this._x = .5 * (i + this._x),
  40244. this._y = .5 * (n + this._y),
  40245. this._z = .5 * (r + this._z),
  40246. this;
  40247. var l = Math.atan2(s, a)
  40248. , c = Math.sin((1 - t) * l) / s
  40249. , h = Math.sin(t * l) / s;
  40250. return this._w = o * c + this._w * h,
  40251. this._x = i * c + this._x * h,
  40252. this._y = n * c + this._y * h,
  40253. this._z = r * c + this._z * h,
  40254. this.onChangeCallback(),
  40255. this
  40256. },
  40257. equals: function(e) {
  40258. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40259. },
  40260. fromArray: function(e, t) {
  40261. return void 0 === t && (t = 0),
  40262. this._x = e[t],
  40263. this._y = e[t + 1],
  40264. this._z = e[t + 2],
  40265. this._w = e[t + 3],
  40266. this.onChangeCallback(),
  40267. this
  40268. },
  40269. toArray: function(e, t) {
  40270. return void 0 === e && (e = []),
  40271. void 0 === t && (t = 0),
  40272. e[t] = this._x,
  40273. e[t + 1] = this._y,
  40274. e[t + 2] = this._z,
  40275. e[t + 3] = this._w,
  40276. e
  40277. },
  40278. onChange: function(e) {
  40279. return this.onChangeCallback = e,
  40280. this
  40281. },
  40282. onChangeCallback: function() {}
  40283. },
  40284. Object.assign(n.Quaternion, {
  40285. slerp: function(e, t, i, n) {
  40286. return i.copy(e).slerp(t, n)
  40287. },
  40288. slerpFlat: function(e, t, i, n, r, o, a) {
  40289. var s = i[n + 0]
  40290. , l = i[n + 1]
  40291. , c = i[n + 2]
  40292. , h = i[n + 3]
  40293. , u = r[o + 0]
  40294. , d = r[o + 1]
  40295. , p = r[o + 2]
  40296. , f = r[o + 3];
  40297. if (h !== f || s !== u || l !== d || c !== p) {
  40298. var g = 1 - a
  40299. , m = s * u + l * d + c * p + h * f
  40300. , v = m >= 0 ? 1 : -1
  40301. , A = 1 - m * m;
  40302. if (A > Number.EPSILON) {
  40303. var y = Math.sqrt(A)
  40304. , C = Math.atan2(y, m * v);
  40305. g = Math.sin(g * C) / y,
  40306. a = Math.sin(a * C) / y
  40307. }
  40308. var I = a * v;
  40309. if (s = s * g + u * I,
  40310. l = l * g + d * I,
  40311. c = c * g + p * I,
  40312. h = h * g + f * I,
  40313. g === 1 - a) {
  40314. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40315. s *= E,
  40316. l *= E,
  40317. c *= E,
  40318. h *= E
  40319. }
  40320. }
  40321. e[t] = s,
  40322. e[t + 1] = l,
  40323. e[t + 2] = c,
  40324. e[t + 3] = h
  40325. }
  40326. }),
  40327. n.Vector2 = function(e, t) {
  40328. this.x = e || 0,
  40329. this.y = t || 0
  40330. }
  40331. ,
  40332. n.Vector2.prototype = {
  40333. constructor: n.Vector2,
  40334. get width() {
  40335. return this.x
  40336. },
  40337. set width(e) {
  40338. this.x = e
  40339. },
  40340. get height() {
  40341. return this.y
  40342. },
  40343. set height(e) {
  40344. this.y = e
  40345. },
  40346. set: function(e, t) {
  40347. return this.x = e,
  40348. this.y = t,
  40349. this
  40350. },
  40351. setScalar: function(e) {
  40352. return this.x = e,
  40353. this.y = e,
  40354. this
  40355. },
  40356. setX: function(e) {
  40357. return this.x = e,
  40358. this
  40359. },
  40360. setY: function(e) {
  40361. return this.y = e,
  40362. this
  40363. },
  40364. setComponent: function(e, t) {
  40365. switch (e) {
  40366. case 0:
  40367. this.x = t;
  40368. break;
  40369. case 1:
  40370. this.y = t;
  40371. break;
  40372. default:
  40373. throw new Error("index is out of range: " + e)
  40374. }
  40375. },
  40376. getComponent: function(e) {
  40377. switch (e) {
  40378. case 0:
  40379. return this.x;
  40380. case 1:
  40381. return this.y;
  40382. default:
  40383. throw new Error("index is out of range: " + e)
  40384. }
  40385. },
  40386. clone: function() {
  40387. return new this.constructor(this.x,this.y)
  40388. },
  40389. copy: function(e) {
  40390. return this.x = e.x,
  40391. this.y = e.y,
  40392. this
  40393. },
  40394. add: function(e, t) {
  40395. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40396. this.addVectors(e, t)) : (this.x += e.x,
  40397. this.y += e.y,
  40398. this)
  40399. },
  40400. addScalar: function(e) {
  40401. return this.x += e,
  40402. this.y += e,
  40403. this
  40404. },
  40405. addVectors: function(e, t) {
  40406. return this.x = e.x + t.x,
  40407. this.y = e.y + t.y,
  40408. this
  40409. },
  40410. addScaledVector: function(e, t) {
  40411. return this.x += e.x * t,
  40412. this.y += e.y * t,
  40413. this
  40414. },
  40415. sub: function(e, t) {
  40416. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40417. this.subVectors(e, t)) : (this.x -= e.x,
  40418. this.y -= e.y,
  40419. this)
  40420. },
  40421. subScalar: function(e) {
  40422. return this.x -= e,
  40423. this.y -= e,
  40424. this
  40425. },
  40426. subVectors: function(e, t) {
  40427. return this.x = e.x - t.x,
  40428. this.y = e.y - t.y,
  40429. this
  40430. },
  40431. multiply: function(e) {
  40432. return this.x *= e.x,
  40433. this.y *= e.y,
  40434. this
  40435. },
  40436. multiplyScalar: function(e) {
  40437. return isFinite(e) ? (this.x *= e,
  40438. this.y *= e) : (this.x = 0,
  40439. this.y = 0),
  40440. this
  40441. },
  40442. divide: function(e) {
  40443. return this.x /= e.x,
  40444. this.y /= e.y,
  40445. this
  40446. },
  40447. divideScalar: function(e) {
  40448. return this.multiplyScalar(1 / e)
  40449. },
  40450. min: function(e) {
  40451. return this.x = Math.min(this.x, e.x),
  40452. this.y = Math.min(this.y, e.y),
  40453. this
  40454. },
  40455. max: function(e) {
  40456. return this.x = Math.max(this.x, e.x),
  40457. this.y = Math.max(this.y, e.y),
  40458. this
  40459. },
  40460. clamp: function(e, t) {
  40461. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40462. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40463. this
  40464. },
  40465. clampScalar: function() {
  40466. var e, t;
  40467. return function(i, r) {
  40468. return void 0 === e && (e = new n.Vector2,
  40469. t = new n.Vector2),
  40470. e.set(i, i),
  40471. t.set(r, r),
  40472. this.clamp(e, t)
  40473. }
  40474. }(),
  40475. clampLength: function(e, t) {
  40476. var i = this.length();
  40477. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40478. this
  40479. },
  40480. floor: function() {
  40481. return this.x = Math.floor(this.x),
  40482. this.y = Math.floor(this.y),
  40483. this
  40484. },
  40485. ceil: function() {
  40486. return this.x = Math.ceil(this.x),
  40487. this.y = Math.ceil(this.y),
  40488. this
  40489. },
  40490. round: function() {
  40491. return this.x = Math.round(this.x),
  40492. this.y = Math.round(this.y),
  40493. this
  40494. },
  40495. roundToZero: function() {
  40496. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40497. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40498. this
  40499. },
  40500. negate: function() {
  40501. return this.x = -this.x,
  40502. this.y = -this.y,
  40503. this
  40504. },
  40505. dot: function(e) {
  40506. return this.x * e.x + this.y * e.y
  40507. },
  40508. lengthSq: function() {
  40509. return this.x * this.x + this.y * this.y
  40510. },
  40511. length: function() {
  40512. return Math.sqrt(this.x * this.x + this.y * this.y)
  40513. },
  40514. lengthManhattan: function() {
  40515. return Math.abs(this.x) + Math.abs(this.y)
  40516. },
  40517. normalize: function() {
  40518. return this.divideScalar(this.length())
  40519. },
  40520. angle: function() {
  40521. var e = Math.atan2(this.y, this.x);
  40522. return e < 0 && (e += 2 * Math.PI),
  40523. e
  40524. },
  40525. distanceTo: function(e) {
  40526. return Math.sqrt(this.distanceToSquared(e))
  40527. },
  40528. distanceToSquared: function(e) {
  40529. var t = this.x - e.x
  40530. , i = this.y - e.y;
  40531. return t * t + i * i
  40532. },
  40533. setLength: function(e) {
  40534. return this.multiplyScalar(e / this.length())
  40535. },
  40536. lerp: function(e, t) {
  40537. return this.x += (e.x - this.x) * t,
  40538. this.y += (e.y - this.y) * t,
  40539. this
  40540. },
  40541. lerpVectors: function(e, t, i) {
  40542. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40543. this
  40544. },
  40545. equals: function(e) {
  40546. return e.x === this.x && e.y === this.y
  40547. },
  40548. fromArray: function(e, t) {
  40549. return void 0 === t && (t = 0),
  40550. this.x = e[t],
  40551. this.y = e[t + 1],
  40552. this
  40553. },
  40554. toArray: function(e, t) {
  40555. return void 0 === e && (e = []),
  40556. void 0 === t && (t = 0),
  40557. e[t] = this.x,
  40558. e[t + 1] = this.y,
  40559. e
  40560. },
  40561. fromAttribute: function(e, t, i) {
  40562. return void 0 === i && (i = 0),
  40563. t = t * e.itemSize + i,
  40564. this.x = e.array[t],
  40565. this.y = e.array[t + 1],
  40566. this
  40567. },
  40568. rotateAround: function(e, t) {
  40569. var i = Math.cos(t)
  40570. , n = Math.sin(t)
  40571. , r = this.x - e.x
  40572. , o = this.y - e.y;
  40573. return this.x = r * i - o * n + e.x,
  40574. this.y = r * n + o * i + e.y,
  40575. this
  40576. }
  40577. },
  40578. n.Vector3 = function(e, t, i) {
  40579. this.x = e || 0,
  40580. this.y = t || 0,
  40581. this.z = i || 0
  40582. }
  40583. ,
  40584. n.Vector3.prototype = {
  40585. constructor: n.Vector3,
  40586. set: function(e, t, i) {
  40587. return this.x = e,
  40588. this.y = t,
  40589. this.z = i,
  40590. this
  40591. },
  40592. setScalar: function(e) {
  40593. return this.x = e,
  40594. this.y = e,
  40595. this.z = e,
  40596. this
  40597. },
  40598. setX: function(e) {
  40599. return this.x = e,
  40600. this
  40601. },
  40602. setY: function(e) {
  40603. return this.y = e,
  40604. this
  40605. },
  40606. setZ: function(e) {
  40607. return this.z = e,
  40608. this
  40609. },
  40610. setComponent: function(e, t) {
  40611. switch (e) {
  40612. case 0:
  40613. this.x = t;
  40614. break;
  40615. case 1:
  40616. this.y = t;
  40617. break;
  40618. case 2:
  40619. this.z = t;
  40620. break;
  40621. default:
  40622. throw new Error("index is out of range: " + e)
  40623. }
  40624. },
  40625. getComponent: function(e) {
  40626. switch (e) {
  40627. case 0:
  40628. return this.x;
  40629. case 1:
  40630. return this.y;
  40631. case 2:
  40632. return this.z;
  40633. default:
  40634. throw new Error("index is out of range: " + e)
  40635. }
  40636. },
  40637. clone: function() {
  40638. return new this.constructor(this.x,this.y,this.z)
  40639. },
  40640. copy: function(e) {
  40641. return this.x = e.x,
  40642. this.y = e.y,
  40643. this.z = e.z,
  40644. this
  40645. },
  40646. add: function(e, t) {
  40647. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40648. this.addVectors(e, t)) : (this.x += e.x,
  40649. this.y += e.y,
  40650. this.z += e.z,
  40651. this)
  40652. },
  40653. addScalar: function(e) {
  40654. return this.x += e,
  40655. this.y += e,
  40656. this.z += e,
  40657. this
  40658. },
  40659. addVectors: function(e, t) {
  40660. return this.x = e.x + t.x,
  40661. this.y = e.y + t.y,
  40662. this.z = e.z + t.z,
  40663. this
  40664. },
  40665. addScaledVector: function(e, t) {
  40666. return this.x += e.x * t,
  40667. this.y += e.y * t,
  40668. this.z += e.z * t,
  40669. this
  40670. },
  40671. sub: function(e, t) {
  40672. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40673. this.subVectors(e, t)) : (this.x -= e.x,
  40674. this.y -= e.y,
  40675. this.z -= e.z,
  40676. this)
  40677. },
  40678. subScalar: function(e) {
  40679. return this.x -= e,
  40680. this.y -= e,
  40681. this.z -= e,
  40682. this
  40683. },
  40684. subVectors: function(e, t) {
  40685. return this.x = e.x - t.x,
  40686. this.y = e.y - t.y,
  40687. this.z = e.z - t.z,
  40688. this
  40689. },
  40690. multiply: function(e, t) {
  40691. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40692. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40693. this.y *= e.y,
  40694. this.z *= e.z,
  40695. this)
  40696. },
  40697. multiplyScalar: function(e) {
  40698. return isFinite(e) ? (this.x *= e,
  40699. this.y *= e,
  40700. this.z *= e) : (this.x = 0,
  40701. this.y = 0,
  40702. this.z = 0),
  40703. this
  40704. },
  40705. multiplyVectors: function(e, t) {
  40706. return this.x = e.x * t.x,
  40707. this.y = e.y * t.y,
  40708. this.z = e.z * t.z,
  40709. this
  40710. },
  40711. applyEuler: function() {
  40712. var e;
  40713. return function(t) {
  40714. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40715. void 0 === e && (e = new n.Quaternion),
  40716. this.applyQuaternion(e.setFromEuler(t)),
  40717. this
  40718. }
  40719. }(),
  40720. applyAxisAngle: function() {
  40721. var e;
  40722. return function(t, i) {
  40723. return void 0 === e && (e = new n.Quaternion),
  40724. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40725. this
  40726. }
  40727. }(),
  40728. applyMatrix3: function(e) {
  40729. var t = this.x
  40730. , i = this.y
  40731. , n = this.z
  40732. , r = e.elements;
  40733. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40734. this.y = r[1] * t + r[4] * i + r[7] * n,
  40735. this.z = r[2] * t + r[5] * i + r[8] * n,
  40736. this
  40737. },
  40738. applyMatrix4: function(e) {
  40739. var t = this.x
  40740. , i = this.y
  40741. , n = this.z
  40742. , r = e.elements;
  40743. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40744. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40745. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40746. this
  40747. },
  40748. applyProjection: function(e) {
  40749. var t = this.x
  40750. , i = this.y
  40751. , n = this.z
  40752. , r = e.elements
  40753. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40754. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40755. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40756. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40757. this
  40758. },
  40759. applyQuaternion: function(e) {
  40760. var t = this.x
  40761. , i = this.y
  40762. , n = this.z
  40763. , r = e.x
  40764. , o = e.y
  40765. , a = e.z
  40766. , s = e.w
  40767. , l = s * t + o * n - a * i
  40768. , c = s * i + a * t - r * n
  40769. , h = s * n + r * i - o * t
  40770. , u = -r * t - o * i - a * n;
  40771. return this.x = l * s + u * -r + c * -a - h * -o,
  40772. this.y = c * s + u * -o + h * -r - l * -a,
  40773. this.z = h * s + u * -a + l * -o - c * -r,
  40774. this
  40775. },
  40776. project: function() {
  40777. var e;
  40778. return function(t) {
  40779. return void 0 === e && (e = new n.Matrix4),
  40780. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40781. this.applyProjection(e)
  40782. }
  40783. }(),
  40784. unproject: function() {
  40785. var e;
  40786. return function(t) {
  40787. return void 0 === e && (e = new n.Matrix4),
  40788. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40789. this.applyProjection(e)
  40790. }
  40791. }(),
  40792. transformDirection: function(e) {
  40793. var t = this.x
  40794. , i = this.y
  40795. , n = this.z
  40796. , r = e.elements;
  40797. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40798. this.y = r[1] * t + r[5] * i + r[9] * n,
  40799. this.z = r[2] * t + r[6] * i + r[10] * n,
  40800. this.normalize(),
  40801. this
  40802. },
  40803. divide: function(e) {
  40804. return this.x /= e.x,
  40805. this.y /= e.y,
  40806. this.z /= e.z,
  40807. this
  40808. },
  40809. divideScalar: function(e) {
  40810. return this.multiplyScalar(1 / e)
  40811. },
  40812. min: function(e) {
  40813. return this.x = Math.min(this.x, e.x),
  40814. this.y = Math.min(this.y, e.y),
  40815. this.z = Math.min(this.z, e.z),
  40816. this
  40817. },
  40818. max: function(e) {
  40819. return this.x = Math.max(this.x, e.x),
  40820. this.y = Math.max(this.y, e.y),
  40821. this.z = Math.max(this.z, e.z),
  40822. this
  40823. },
  40824. clamp: function(e, t) {
  40825. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40826. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40827. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40828. this
  40829. },
  40830. clampScalar: function() {
  40831. var e, t;
  40832. return function(i, r) {
  40833. return void 0 === e && (e = new n.Vector3,
  40834. t = new n.Vector3),
  40835. e.set(i, i, i),
  40836. t.set(r, r, r),
  40837. this.clamp(e, t)
  40838. }
  40839. }(),
  40840. clampLength: function(e, t) {
  40841. var i = this.length();
  40842. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40843. this
  40844. },
  40845. floor: function() {
  40846. return this.x = Math.floor(this.x),
  40847. this.y = Math.floor(this.y),
  40848. this.z = Math.floor(this.z),
  40849. this
  40850. },
  40851. ceil: function() {
  40852. return this.x = Math.ceil(this.x),
  40853. this.y = Math.ceil(this.y),
  40854. this.z = Math.ceil(this.z),
  40855. this
  40856. },
  40857. round: function() {
  40858. return this.x = Math.round(this.x),
  40859. this.y = Math.round(this.y),
  40860. this.z = Math.round(this.z),
  40861. this
  40862. },
  40863. roundToZero: function() {
  40864. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40865. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40866. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40867. this
  40868. },
  40869. negate: function() {
  40870. return this.x = -this.x,
  40871. this.y = -this.y,
  40872. this.z = -this.z,
  40873. this
  40874. },
  40875. dot: function(e) {
  40876. return this.x * e.x + this.y * e.y + this.z * e.z
  40877. },
  40878. lengthSq: function() {
  40879. return this.x * this.x + this.y * this.y + this.z * this.z
  40880. },
  40881. length: function() {
  40882. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40883. },
  40884. lengthManhattan: function() {
  40885. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40886. },
  40887. normalize: function() {
  40888. return this.divideScalar(this.length())
  40889. },
  40890. setLength: function(e) {
  40891. return this.multiplyScalar(e / this.length())
  40892. },
  40893. lerp: function(e, t) {
  40894. return this.x += (e.x - this.x) * t,
  40895. this.y += (e.y - this.y) * t,
  40896. this.z += (e.z - this.z) * t,
  40897. this
  40898. },
  40899. lerpVectors: function(e, t, i) {
  40900. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40901. this
  40902. },
  40903. cross: function(e, t) {
  40904. if (void 0 !== t)
  40905. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40906. this.crossVectors(e, t);
  40907. var i = this.x
  40908. , n = this.y
  40909. , r = this.z;
  40910. return this.x = n * e.z - r * e.y,
  40911. this.y = r * e.x - i * e.z,
  40912. this.z = i * e.y - n * e.x,
  40913. this
  40914. },
  40915. crossVectors: function(e, t) {
  40916. var i = e.x
  40917. , n = e.y
  40918. , r = e.z
  40919. , o = t.x
  40920. , a = t.y
  40921. , s = t.z;
  40922. return this.x = n * s - r * a,
  40923. this.y = r * o - i * s,
  40924. this.z = i * a - n * o,
  40925. this
  40926. },
  40927. projectOnVector: function() {
  40928. var e, t;
  40929. return function(i) {
  40930. return void 0 === e && (e = new n.Vector3),
  40931. e.copy(i).normalize(),
  40932. t = this.dot(e),
  40933. this.copy(e).multiplyScalar(t)
  40934. }
  40935. }(),
  40936. projectOnPlane: function() {
  40937. var e;
  40938. return function(t) {
  40939. return void 0 === e && (e = new n.Vector3),
  40940. e.copy(this).projectOnVector(t),
  40941. this.sub(e)
  40942. }
  40943. }(),
  40944. reflect: function() {
  40945. var e;
  40946. return function(t) {
  40947. return void 0 === e && (e = new n.Vector3),
  40948. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40949. }
  40950. }(),
  40951. angleTo: function(e) {
  40952. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40953. return Math.acos(n.Math.clamp(t, -1, 1))
  40954. },
  40955. distanceTo: function(e) {
  40956. return Math.sqrt(this.distanceToSquared(e))
  40957. },
  40958. distanceToSquared: function(e) {
  40959. var t = this.x - e.x
  40960. , i = this.y - e.y
  40961. , n = this.z - e.z;
  40962. return t * t + i * i + n * n
  40963. },
  40964. setFromSpherical: function(e) {
  40965. var t = Math.sin(e.phi) * e.radius;
  40966. return this.x = t * Math.sin(e.theta),
  40967. this.y = Math.cos(e.phi) * e.radius,
  40968. this.z = t * Math.cos(e.theta),
  40969. this
  40970. },
  40971. setFromMatrixPosition: function(e) {
  40972. return this.setFromMatrixColumn(e, 3)
  40973. },
  40974. setFromMatrixScale: function(e) {
  40975. var t = this.setFromMatrixColumn(e, 0).length()
  40976. , i = this.setFromMatrixColumn(e, 1).length()
  40977. , n = this.setFromMatrixColumn(e, 2).length();
  40978. return this.x = t,
  40979. this.y = i,
  40980. this.z = n,
  40981. this
  40982. },
  40983. setFromMatrixColumn: function(e, t) {
  40984. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40985. e = arguments[1],
  40986. t = arguments[0]),
  40987. this.fromArray(e.elements, 4 * t)
  40988. },
  40989. equals: function(e) {
  40990. return e.x === this.x && e.y === this.y && e.z === this.z
  40991. },
  40992. fromArray: function(e, t) {
  40993. return void 0 === t && (t = 0),
  40994. this.x = e[t],
  40995. this.y = e[t + 1],
  40996. this.z = e[t + 2],
  40997. this
  40998. },
  40999. toArray: function(e, t) {
  41000. return void 0 === e && (e = []),
  41001. void 0 === t && (t = 0),
  41002. e[t] = this.x,
  41003. e[t + 1] = this.y,
  41004. e[t + 2] = this.z,
  41005. e
  41006. },
  41007. fromAttribute: function(e, t, i) {
  41008. return void 0 === i && (i = 0),
  41009. t = t * e.itemSize + i,
  41010. this.x = e.array[t],
  41011. this.y = e.array[t + 1],
  41012. this.z = e.array[t + 2],
  41013. this
  41014. }
  41015. },
  41016. n.Vector4 = function(e, t, i, n) {
  41017. this.x = e || 0,
  41018. this.y = t || 0,
  41019. this.z = i || 0,
  41020. this.w = void 0 !== n ? n : 1
  41021. }
  41022. ,
  41023. n.Vector4.prototype = {
  41024. constructor: n.Vector4,
  41025. set: function(e, t, i, n) {
  41026. return this.x = e,
  41027. this.y = t,
  41028. this.z = i,
  41029. this.w = n,
  41030. this
  41031. },
  41032. setScalar: function(e) {
  41033. return this.x = e,
  41034. this.y = e,
  41035. this.z = e,
  41036. this.w = e,
  41037. this
  41038. },
  41039. setX: function(e) {
  41040. return this.x = e,
  41041. this
  41042. },
  41043. setY: function(e) {
  41044. return this.y = e,
  41045. this
  41046. },
  41047. setZ: function(e) {
  41048. return this.z = e,
  41049. this
  41050. },
  41051. setW: function(e) {
  41052. return this.w = e,
  41053. this
  41054. },
  41055. setComponent: function(e, t) {
  41056. switch (e) {
  41057. case 0:
  41058. this.x = t;
  41059. break;
  41060. case 1:
  41061. this.y = t;
  41062. break;
  41063. case 2:
  41064. this.z = t;
  41065. break;
  41066. case 3:
  41067. this.w = t;
  41068. break;
  41069. default:
  41070. throw new Error("index is out of range: " + e)
  41071. }
  41072. },
  41073. getComponent: function(e) {
  41074. switch (e) {
  41075. case 0:
  41076. return this.x;
  41077. case 1:
  41078. return this.y;
  41079. case 2:
  41080. return this.z;
  41081. case 3:
  41082. return this.w;
  41083. default:
  41084. throw new Error("index is out of range: " + e)
  41085. }
  41086. },
  41087. clone: function() {
  41088. return new this.constructor(this.x,this.y,this.z,this.w)
  41089. },
  41090. copy: function(e) {
  41091. return this.x = e.x,
  41092. this.y = e.y,
  41093. this.z = e.z,
  41094. this.w = void 0 !== e.w ? e.w : 1,
  41095. this
  41096. },
  41097. add: function(e, t) {
  41098. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41099. this.addVectors(e, t)) : (this.x += e.x,
  41100. this.y += e.y,
  41101. this.z += e.z,
  41102. this.w += e.w,
  41103. this)
  41104. },
  41105. addScalar: function(e) {
  41106. return this.x += e,
  41107. this.y += e,
  41108. this.z += e,
  41109. this.w += e,
  41110. this
  41111. },
  41112. addVectors: function(e, t) {
  41113. return this.x = e.x + t.x,
  41114. this.y = e.y + t.y,
  41115. this.z = e.z + t.z,
  41116. this.w = e.w + t.w,
  41117. this
  41118. },
  41119. addScaledVector: function(e, t) {
  41120. return this.x += e.x * t,
  41121. this.y += e.y * t,
  41122. this.z += e.z * t,
  41123. this.w += e.w * t,
  41124. this
  41125. },
  41126. sub: function(e, t) {
  41127. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41128. this.subVectors(e, t)) : (this.x -= e.x,
  41129. this.y -= e.y,
  41130. this.z -= e.z,
  41131. this.w -= e.w,
  41132. this)
  41133. },
  41134. subScalar: function(e) {
  41135. return this.x -= e,
  41136. this.y -= e,
  41137. this.z -= e,
  41138. this.w -= e,
  41139. this
  41140. },
  41141. subVectors: function(e, t) {
  41142. return this.x = e.x - t.x,
  41143. this.y = e.y - t.y,
  41144. this.z = e.z - t.z,
  41145. this.w = e.w - t.w,
  41146. this
  41147. },
  41148. multiplyScalar: function(e) {
  41149. return isFinite(e) ? (this.x *= e,
  41150. this.y *= e,
  41151. this.z *= e,
  41152. this.w *= e) : (this.x = 0,
  41153. this.y = 0,
  41154. this.z = 0,
  41155. this.w = 0),
  41156. this
  41157. },
  41158. applyMatrix4: function(e) {
  41159. var t = this.x
  41160. , i = this.y
  41161. , n = this.z
  41162. , r = this.w
  41163. , o = e.elements;
  41164. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41165. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41166. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41167. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41168. this
  41169. },
  41170. divideScalar: function(e) {
  41171. return this.multiplyScalar(1 / e)
  41172. },
  41173. setAxisAngleFromQuaternion: function(e) {
  41174. this.w = 2 * Math.acos(e.w);
  41175. var t = Math.sqrt(1 - e.w * e.w);
  41176. return t < 1e-4 ? (this.x = 1,
  41177. this.y = 0,
  41178. this.z = 0) : (this.x = e.x / t,
  41179. this.y = e.y / t,
  41180. this.z = e.z / t),
  41181. this
  41182. },
  41183. setAxisAngleFromRotationMatrix: function(e) {
  41184. 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];
  41185. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41186. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41187. return this.set(1, 0, 0, 0),
  41188. this;
  41189. t = Math.PI;
  41190. var v = (l + 1) / 2
  41191. , A = (d + 1) / 2
  41192. , y = (m + 1) / 2
  41193. , C = (c + u) / 4
  41194. , I = (h + f) / 4
  41195. , E = (p + g) / 4;
  41196. return v > A && v > y ? v < o ? (i = 0,
  41197. n = .707106781,
  41198. r = .707106781) : (i = Math.sqrt(v),
  41199. n = C / i,
  41200. r = I / i) : A > y ? A < o ? (i = .707106781,
  41201. n = 0,
  41202. r = .707106781) : (n = Math.sqrt(A),
  41203. i = C / n,
  41204. r = E / n) : y < o ? (i = .707106781,
  41205. n = .707106781,
  41206. r = 0) : (r = Math.sqrt(y),
  41207. i = I / r,
  41208. n = E / r),
  41209. this.set(i, n, r, t),
  41210. this
  41211. }
  41212. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41213. return Math.abs(b) < .001 && (b = 1),
  41214. this.x = (g - p) / b,
  41215. this.y = (h - f) / b,
  41216. this.z = (u - c) / b,
  41217. this.w = Math.acos((l + d + m - 1) / 2),
  41218. this
  41219. },
  41220. min: function(e) {
  41221. return this.x = Math.min(this.x, e.x),
  41222. this.y = Math.min(this.y, e.y),
  41223. this.z = Math.min(this.z, e.z),
  41224. this.w = Math.min(this.w, e.w),
  41225. this
  41226. },
  41227. max: function(e) {
  41228. return this.x = Math.max(this.x, e.x),
  41229. this.y = Math.max(this.y, e.y),
  41230. this.z = Math.max(this.z, e.z),
  41231. this.w = Math.max(this.w, e.w),
  41232. this
  41233. },
  41234. clamp: function(e, t) {
  41235. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41236. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41237. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41238. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41239. this
  41240. },
  41241. clampScalar: function() {
  41242. var e, t;
  41243. return function(i, r) {
  41244. return void 0 === e && (e = new n.Vector4,
  41245. t = new n.Vector4),
  41246. e.set(i, i, i, i),
  41247. t.set(r, r, r, r),
  41248. this.clamp(e, t)
  41249. }
  41250. }(),
  41251. floor: function() {
  41252. return this.x = Math.floor(this.x),
  41253. this.y = Math.floor(this.y),
  41254. this.z = Math.floor(this.z),
  41255. this.w = Math.floor(this.w),
  41256. this
  41257. },
  41258. ceil: function() {
  41259. return this.x = Math.ceil(this.x),
  41260. this.y = Math.ceil(this.y),
  41261. this.z = Math.ceil(this.z),
  41262. this.w = Math.ceil(this.w),
  41263. this
  41264. },
  41265. round: function() {
  41266. return this.x = Math.round(this.x),
  41267. this.y = Math.round(this.y),
  41268. this.z = Math.round(this.z),
  41269. this.w = Math.round(this.w),
  41270. this
  41271. },
  41272. roundToZero: function() {
  41273. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41274. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41275. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41276. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41277. this
  41278. },
  41279. negate: function() {
  41280. return this.x = -this.x,
  41281. this.y = -this.y,
  41282. this.z = -this.z,
  41283. this.w = -this.w,
  41284. this
  41285. },
  41286. dot: function(e) {
  41287. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41288. },
  41289. lengthSq: function() {
  41290. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41291. },
  41292. length: function() {
  41293. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41294. },
  41295. lengthManhattan: function() {
  41296. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41297. },
  41298. normalize: function() {
  41299. return this.divideScalar(this.length())
  41300. },
  41301. setLength: function(e) {
  41302. return this.multiplyScalar(e / this.length())
  41303. },
  41304. lerp: function(e, t) {
  41305. return this.x += (e.x - this.x) * t,
  41306. this.y += (e.y - this.y) * t,
  41307. this.z += (e.z - this.z) * t,
  41308. this.w += (e.w - this.w) * t,
  41309. this
  41310. },
  41311. lerpVectors: function(e, t, i) {
  41312. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41313. this
  41314. },
  41315. equals: function(e) {
  41316. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41317. },
  41318. fromArray: function(e, t) {
  41319. return void 0 === t && (t = 0),
  41320. this.x = e[t],
  41321. this.y = e[t + 1],
  41322. this.z = e[t + 2],
  41323. this.w = e[t + 3],
  41324. this
  41325. },
  41326. toArray: function(e, t) {
  41327. return void 0 === e && (e = []),
  41328. void 0 === t && (t = 0),
  41329. e[t] = this.x,
  41330. e[t + 1] = this.y,
  41331. e[t + 2] = this.z,
  41332. e[t + 3] = this.w,
  41333. e
  41334. },
  41335. fromAttribute: function(e, t, i) {
  41336. return void 0 === i && (i = 0),
  41337. t = t * e.itemSize + i,
  41338. this.x = e.array[t],
  41339. this.y = e.array[t + 1],
  41340. this.z = e.array[t + 2],
  41341. this.w = e.array[t + 3],
  41342. this
  41343. }
  41344. },
  41345. n.Euler = function(e, t, i, r) {
  41346. this._x = e || 0,
  41347. this._y = t || 0,
  41348. this._z = i || 0,
  41349. this._order = r || n.Euler.DefaultOrder
  41350. }
  41351. ,
  41352. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41353. n.Euler.DefaultOrder = "XYZ",
  41354. n.Euler.prototype = {
  41355. constructor: n.Euler,
  41356. get x() {
  41357. return this._x
  41358. },
  41359. set x(e) {
  41360. this._x = e,
  41361. this.onChangeCallback()
  41362. },
  41363. get y() {
  41364. return this._y
  41365. },
  41366. set y(e) {
  41367. this._y = e,
  41368. this.onChangeCallback()
  41369. },
  41370. get z() {
  41371. return this._z
  41372. },
  41373. set z(e) {
  41374. this._z = e,
  41375. this.onChangeCallback()
  41376. },
  41377. get order() {
  41378. return this._order
  41379. },
  41380. set order(e) {
  41381. this._order = e,
  41382. this.onChangeCallback()
  41383. },
  41384. set: function(e, t, i, n) {
  41385. return this._x = e,
  41386. this._y = t,
  41387. this._z = i,
  41388. this._order = n || this._order,
  41389. this.onChangeCallback(),
  41390. this
  41391. },
  41392. clone: function() {
  41393. return new this.constructor(this._x,this._y,this._z,this._order)
  41394. },
  41395. copy: function(e) {
  41396. return this._x = e._x,
  41397. this._y = e._y,
  41398. this._z = e._z,
  41399. this._order = e._order,
  41400. this.onChangeCallback(),
  41401. this
  41402. },
  41403. setFromRotationMatrix: function(e, t, i) {
  41404. var r = n.Math.clamp
  41405. , o = e.elements
  41406. , a = o[0]
  41407. , s = o[4]
  41408. , l = o[8]
  41409. , c = o[1]
  41410. , h = o[5]
  41411. , u = o[9]
  41412. , d = o[2]
  41413. , p = o[6]
  41414. , f = o[10];
  41415. return t = t || this._order,
  41416. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41417. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41418. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41419. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41420. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41421. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41422. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41423. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41424. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41425. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41426. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41427. this._z = Math.atan2(c, a)) : (this._x = 0,
  41428. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41429. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41430. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41431. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41432. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41433. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41434. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41435. this._order = t,
  41436. i !== !1 && this.onChangeCallback(),
  41437. this
  41438. },
  41439. setFromQuaternion: function() {
  41440. var e;
  41441. return function(t, i, r) {
  41442. return void 0 === e && (e = new n.Matrix4),
  41443. e.makeRotationFromQuaternion(t),
  41444. this.setFromRotationMatrix(e, i, r),
  41445. this
  41446. }
  41447. }(),
  41448. setFromVector3: function(e, t) {
  41449. return this.set(e.x, e.y, e.z, t || this._order)
  41450. },
  41451. reorder: function() {
  41452. var e = new n.Quaternion;
  41453. return function(t) {
  41454. e.setFromEuler(this),
  41455. this.setFromQuaternion(e, t)
  41456. }
  41457. }(),
  41458. equals: function(e) {
  41459. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41460. },
  41461. fromArray: function(e) {
  41462. return this._x = e[0],
  41463. this._y = e[1],
  41464. this._z = e[2],
  41465. void 0 !== e[3] && (this._order = e[3]),
  41466. this.onChangeCallback(),
  41467. this
  41468. },
  41469. toArray: function(e, t) {
  41470. return void 0 === e && (e = []),
  41471. void 0 === t && (t = 0),
  41472. e[t] = this._x,
  41473. e[t + 1] = this._y,
  41474. e[t + 2] = this._z,
  41475. e[t + 3] = this._order,
  41476. e
  41477. },
  41478. toVector3: function(e) {
  41479. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41480. },
  41481. onChange: function(e) {
  41482. return this.onChangeCallback = e,
  41483. this
  41484. },
  41485. onChangeCallback: function() {}
  41486. },
  41487. n.Line3 = function(e, t) {
  41488. this.start = void 0 !== e ? e : new n.Vector3,
  41489. this.end = void 0 !== t ? t : new n.Vector3
  41490. }
  41491. ,
  41492. n.Line3.prototype = {
  41493. constructor: n.Line3,
  41494. set: function(e, t) {
  41495. return this.start.copy(e),
  41496. this.end.copy(t),
  41497. this
  41498. },
  41499. clone: function() {
  41500. return (new this.constructor).copy(this)
  41501. },
  41502. copy: function(e) {
  41503. return this.start.copy(e.start),
  41504. this.end.copy(e.end),
  41505. this
  41506. },
  41507. center: function(e) {
  41508. var t = e || new n.Vector3;
  41509. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41510. },
  41511. delta: function(e) {
  41512. var t = e || new n.Vector3;
  41513. return t.subVectors(this.end, this.start)
  41514. },
  41515. distanceSq: function() {
  41516. return this.start.distanceToSquared(this.end)
  41517. },
  41518. distance: function() {
  41519. return this.start.distanceTo(this.end)
  41520. },
  41521. at: function(e, t) {
  41522. var i = t || new n.Vector3;
  41523. return this.delta(i).multiplyScalar(e).add(this.start)
  41524. },
  41525. closestPointToPointParameter: function() {
  41526. var e = new n.Vector3
  41527. , t = new n.Vector3;
  41528. return function(i, r) {
  41529. e.subVectors(i, this.start),
  41530. t.subVectors(this.end, this.start);
  41531. var o = t.dot(t)
  41532. , a = t.dot(e)
  41533. , s = a / o;
  41534. return r && (s = n.Math.clamp(s, 0, 1)),
  41535. s
  41536. }
  41537. }(),
  41538. closestPointToPoint: function(e, t, i) {
  41539. var r = this.closestPointToPointParameter(e, t)
  41540. , o = i || new n.Vector3;
  41541. return this.delta(o).multiplyScalar(r).add(this.start)
  41542. },
  41543. applyMatrix4: function(e) {
  41544. return this.start.applyMatrix4(e),
  41545. this.end.applyMatrix4(e),
  41546. this
  41547. },
  41548. equals: function(e) {
  41549. return e.start.equals(this.start) && e.end.equals(this.end)
  41550. }
  41551. },
  41552. n.Box2 = function(e, t) {
  41553. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41554. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41555. }
  41556. ,
  41557. n.Box2.prototype = {
  41558. constructor: n.Box2,
  41559. set: function(e, t) {
  41560. return this.min.copy(e),
  41561. this.max.copy(t),
  41562. this
  41563. },
  41564. setFromPoints: function(e) {
  41565. this.makeEmpty();
  41566. for (var t = 0, i = e.length; t < i; t++)
  41567. this.expandByPoint(e[t]);
  41568. return this
  41569. },
  41570. setFromCenterAndSize: function() {
  41571. var e = new n.Vector2;
  41572. return function(t, i) {
  41573. var n = e.copy(i).multiplyScalar(.5);
  41574. return this.min.copy(t).sub(n),
  41575. this.max.copy(t).add(n),
  41576. this
  41577. }
  41578. }(),
  41579. clone: function() {
  41580. return (new this.constructor).copy(this)
  41581. },
  41582. copy: function(e) {
  41583. return this.min.copy(e.min),
  41584. this.max.copy(e.max),
  41585. this
  41586. },
  41587. makeEmpty: function() {
  41588. return this.min.x = this.min.y = +(1 / 0),
  41589. this.max.x = this.max.y = -(1 / 0),
  41590. this
  41591. },
  41592. isEmpty: function() {
  41593. return this.max.x < this.min.x || this.max.y < this.min.y
  41594. },
  41595. center: function(e) {
  41596. var t = e || new n.Vector2;
  41597. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41598. },
  41599. size: function(e) {
  41600. var t = e || new n.Vector2;
  41601. return t.subVectors(this.max, this.min)
  41602. },
  41603. expandByPoint: function(e) {
  41604. return this.min.min(e),
  41605. this.max.max(e),
  41606. this
  41607. },
  41608. expandByVector: function(e) {
  41609. return this.min.sub(e),
  41610. this.max.add(e),
  41611. this
  41612. },
  41613. expandByScalar: function(e) {
  41614. return this.min.addScalar(-e),
  41615. this.max.addScalar(e),
  41616. this
  41617. },
  41618. containsPoint: function(e) {
  41619. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41620. },
  41621. containsBox: function(e) {
  41622. 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
  41623. },
  41624. getParameter: function(e, t) {
  41625. var i = t || new n.Vector2;
  41626. 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))
  41627. },
  41628. intersectsBox: function(e) {
  41629. 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)
  41630. },
  41631. clampPoint: function(e, t) {
  41632. var i = t || new n.Vector2;
  41633. return i.copy(e).clamp(this.min, this.max)
  41634. },
  41635. distanceToPoint: function() {
  41636. var e = new n.Vector2;
  41637. return function(t) {
  41638. var i = e.copy(t).clamp(this.min, this.max);
  41639. return i.sub(t).length()
  41640. }
  41641. }(),
  41642. intersect: function(e) {
  41643. return this.min.max(e.min),
  41644. this.max.min(e.max),
  41645. this
  41646. },
  41647. union: function(e) {
  41648. return this.min.min(e.min),
  41649. this.max.max(e.max),
  41650. this
  41651. },
  41652. translate: function(e) {
  41653. return this.min.add(e),
  41654. this.max.add(e),
  41655. this
  41656. },
  41657. equals: function(e) {
  41658. return e.min.equals(this.min) && e.max.equals(this.max)
  41659. }
  41660. },
  41661. n.Box3 = function(e, t) {
  41662. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41663. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41664. }
  41665. ,
  41666. n.Box3.prototype = {
  41667. constructor: n.Box3,
  41668. set: function(e, t) {
  41669. return this.min.copy(e),
  41670. this.max.copy(t),
  41671. this
  41672. },
  41673. setFromArray: function(e) {
  41674. this.makeEmpty();
  41675. 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) {
  41676. var c = e[s]
  41677. , h = e[s + 1]
  41678. , u = e[s + 2];
  41679. c < t && (t = c),
  41680. h < i && (i = h),
  41681. u < n && (n = u),
  41682. c > r && (r = c),
  41683. h > o && (o = h),
  41684. u > a && (a = u)
  41685. }
  41686. this.min.set(t, i, n),
  41687. this.max.set(r, o, a)
  41688. },
  41689. setFromPoints: function(e) {
  41690. this.makeEmpty();
  41691. for (var t = 0, i = e.length; t < i; t++)
  41692. this.expandByPoint(e[t]);
  41693. return this
  41694. },
  41695. setFromCenterAndSize: function() {
  41696. var e = new n.Vector3;
  41697. return function(t, i) {
  41698. var n = e.copy(i).multiplyScalar(.5);
  41699. return this.min.copy(t).sub(n),
  41700. this.max.copy(t).add(n),
  41701. this
  41702. }
  41703. }(),
  41704. setFromObject: function() {
  41705. var e;
  41706. return function(t) {
  41707. void 0 === e && (e = new n.Box3);
  41708. var i = this;
  41709. return this.makeEmpty(),
  41710. t.updateMatrixWorld(!0),
  41711. t.traverse(function(t) {
  41712. var n = t.geometry;
  41713. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41714. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41715. e.applyMatrix4(t.matrixWorld),
  41716. i.union(e)))
  41717. }),
  41718. this
  41719. }
  41720. }(),
  41721. clone: function() {
  41722. return (new this.constructor).copy(this)
  41723. },
  41724. copy: function(e) {
  41725. return this.min.copy(e.min),
  41726. this.max.copy(e.max),
  41727. this
  41728. },
  41729. makeEmpty: function() {
  41730. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41731. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41732. this
  41733. },
  41734. isEmpty: function() {
  41735. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41736. },
  41737. center: function(e) {
  41738. var t = e || new n.Vector3;
  41739. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41740. },
  41741. size: function(e) {
  41742. var t = e || new n.Vector3;
  41743. return t.subVectors(this.max, this.min)
  41744. },
  41745. expandByPoint: function(e) {
  41746. return this.min.min(e),
  41747. this.max.max(e),
  41748. this
  41749. },
  41750. expandByVector: function(e) {
  41751. return this.min.sub(e),
  41752. this.max.add(e),
  41753. this
  41754. },
  41755. expandByScalar: function(e) {
  41756. return this.min.addScalar(-e),
  41757. this.max.addScalar(e),
  41758. this
  41759. },
  41760. containsPoint: function(e) {
  41761. 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)
  41762. },
  41763. containsBox: function(e) {
  41764. 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
  41765. },
  41766. getParameter: function(e, t) {
  41767. var i = t || new n.Vector3;
  41768. 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))
  41769. },
  41770. intersectsBox: function(e) {
  41771. 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)
  41772. },
  41773. intersectsSphere: function() {
  41774. var e;
  41775. return function(t) {
  41776. return void 0 === e && (e = new n.Vector3),
  41777. this.clampPoint(t.center, e),
  41778. e.distanceToSquared(t.center) <= t.radius * t.radius
  41779. }
  41780. }(),
  41781. intersectsPlane: function(e) {
  41782. var t, i;
  41783. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41784. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41785. i = e.normal.x * this.min.x),
  41786. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41787. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41788. i += e.normal.y * this.min.y),
  41789. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41790. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41791. i += e.normal.z * this.min.z),
  41792. t <= e.constant && i >= e.constant
  41793. },
  41794. clampPoint: function(e, t) {
  41795. var i = t || new n.Vector3;
  41796. return i.copy(e).clamp(this.min, this.max)
  41797. },
  41798. distanceToPoint: function() {
  41799. var e = new n.Vector3;
  41800. return function(t) {
  41801. var i = e.copy(t).clamp(this.min, this.max);
  41802. return i.sub(t).length()
  41803. }
  41804. }(),
  41805. getBoundingSphere: function() {
  41806. var e = new n.Vector3;
  41807. return function(t) {
  41808. var i = t || new n.Sphere;
  41809. return i.center = this.center(),
  41810. i.radius = .5 * this.size(e).length(),
  41811. i
  41812. }
  41813. }(),
  41814. intersect: function(e) {
  41815. return this.min.max(e.min),
  41816. this.max.min(e.max),
  41817. this
  41818. },
  41819. union: function(e) {
  41820. return this.min.min(e.min),
  41821. this.max.max(e.max),
  41822. this
  41823. },
  41824. applyMatrix4: function() {
  41825. 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];
  41826. return function(t) {
  41827. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41828. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41829. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41830. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41831. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41832. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41833. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41834. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41835. this.makeEmpty(),
  41836. this.setFromPoints(e),
  41837. this
  41838. }
  41839. }(),
  41840. translate: function(e) {
  41841. return this.min.add(e),
  41842. this.max.add(e),
  41843. this
  41844. },
  41845. equals: function(e) {
  41846. return e.min.equals(this.min) && e.max.equals(this.max)
  41847. }
  41848. },
  41849. n.Matrix3 = function() {
  41850. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41851. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41852. }
  41853. ,
  41854. n.Matrix3.prototype = {
  41855. constructor: n.Matrix3,
  41856. set: function(e, t, i, n, r, o, a, s, l) {
  41857. var c = this.elements;
  41858. return c[0] = e,
  41859. c[1] = n,
  41860. c[2] = a,
  41861. c[3] = t,
  41862. c[4] = r,
  41863. c[5] = s,
  41864. c[6] = i,
  41865. c[7] = o,
  41866. c[8] = l,
  41867. this
  41868. },
  41869. identity: function() {
  41870. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41871. this
  41872. },
  41873. clone: function() {
  41874. return (new this.constructor).fromArray(this.elements)
  41875. },
  41876. copy: function(e) {
  41877. var t = e.elements;
  41878. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41879. this
  41880. },
  41881. setFromMatrix4: function(e) {
  41882. var t = e.elements;
  41883. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41884. this
  41885. },
  41886. applyToVector3Array: function() {
  41887. var e;
  41888. return function(t, i, r) {
  41889. void 0 === e && (e = new n.Vector3),
  41890. void 0 === i && (i = 0),
  41891. void 0 === r && (r = t.length);
  41892. for (var o = 0, a = i; o < r; o += 3,
  41893. a += 3)
  41894. e.fromArray(t, a),
  41895. e.applyMatrix3(this),
  41896. e.toArray(t, a);
  41897. return t
  41898. }
  41899. }(),
  41900. applyToBuffer: function() {
  41901. var e;
  41902. return function(t, i, r) {
  41903. void 0 === e && (e = new n.Vector3),
  41904. void 0 === i && (i = 0),
  41905. void 0 === r && (r = t.length / t.itemSize);
  41906. for (var o = 0, a = i; o < r; o++,
  41907. a++)
  41908. e.x = t.getX(a),
  41909. e.y = t.getY(a),
  41910. e.z = t.getZ(a),
  41911. e.applyMatrix3(this),
  41912. t.setXYZ(e.x, e.y, e.z);
  41913. return t
  41914. }
  41915. }(),
  41916. multiplyScalar: function(e) {
  41917. var t = this.elements;
  41918. return t[0] *= e,
  41919. t[3] *= e,
  41920. t[6] *= e,
  41921. t[1] *= e,
  41922. t[4] *= e,
  41923. t[7] *= e,
  41924. t[2] *= e,
  41925. t[5] *= e,
  41926. t[8] *= e,
  41927. this
  41928. },
  41929. determinant: function() {
  41930. var e = this.elements
  41931. , t = e[0]
  41932. , i = e[1]
  41933. , n = e[2]
  41934. , r = e[3]
  41935. , o = e[4]
  41936. , a = e[5]
  41937. , s = e[6]
  41938. , l = e[7]
  41939. , c = e[8];
  41940. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41941. },
  41942. getInverse: function(e, t) {
  41943. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41944. var i = e.elements
  41945. , r = this.elements
  41946. , o = i[0]
  41947. , a = i[1]
  41948. , s = i[2]
  41949. , l = i[3]
  41950. , c = i[4]
  41951. , h = i[5]
  41952. , u = i[6]
  41953. , d = i[7]
  41954. , p = i[8]
  41955. , f = p * c - h * d
  41956. , g = h * u - p * l
  41957. , m = d * l - c * u
  41958. , v = o * f + a * g + s * m;
  41959. if (0 === v) {
  41960. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41961. if (t)
  41962. throw new Error(A);
  41963. return console.warn(A),
  41964. this.identity()
  41965. }
  41966. return r[0] = f,
  41967. r[1] = s * d - p * a,
  41968. r[2] = h * a - s * c,
  41969. r[3] = g,
  41970. r[4] = p * o - s * u,
  41971. r[5] = s * l - h * o,
  41972. r[6] = m,
  41973. r[7] = a * u - d * o,
  41974. r[8] = c * o - a * l,
  41975. this.multiplyScalar(1 / v)
  41976. },
  41977. transpose: function() {
  41978. var e, t = this.elements;
  41979. return e = t[1],
  41980. t[1] = t[3],
  41981. t[3] = e,
  41982. e = t[2],
  41983. t[2] = t[6],
  41984. t[6] = e,
  41985. e = t[5],
  41986. t[5] = t[7],
  41987. t[7] = e,
  41988. this
  41989. },
  41990. flattenToArrayOffset: function(e, t) {
  41991. var i = this.elements;
  41992. return e[t] = i[0],
  41993. e[t + 1] = i[1],
  41994. e[t + 2] = i[2],
  41995. e[t + 3] = i[3],
  41996. e[t + 4] = i[4],
  41997. e[t + 5] = i[5],
  41998. e[t + 6] = i[6],
  41999. e[t + 7] = i[7],
  42000. e[t + 8] = i[8],
  42001. e
  42002. },
  42003. getNormalMatrix: function(e) {
  42004. return this.setFromMatrix4(e).getInverse(this).transpose()
  42005. },
  42006. transposeIntoArray: function(e) {
  42007. var t = this.elements;
  42008. return e[0] = t[0],
  42009. e[1] = t[3],
  42010. e[2] = t[6],
  42011. e[3] = t[1],
  42012. e[4] = t[4],
  42013. e[5] = t[7],
  42014. e[6] = t[2],
  42015. e[7] = t[5],
  42016. e[8] = t[8],
  42017. this
  42018. },
  42019. fromArray: function(e) {
  42020. return this.elements.set(e),
  42021. this
  42022. },
  42023. toArray: function() {
  42024. var e = this.elements;
  42025. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42026. }
  42027. },
  42028. n.Matrix4 = function() {
  42029. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42030. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42031. }
  42032. ,
  42033. n.Matrix4.prototype = {
  42034. constructor: n.Matrix4,
  42035. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42036. var m = this.elements;
  42037. return m[0] = e,
  42038. m[4] = t,
  42039. m[8] = i,
  42040. m[12] = n,
  42041. m[1] = r,
  42042. m[5] = o,
  42043. m[9] = a,
  42044. m[13] = s,
  42045. m[2] = l,
  42046. m[6] = c,
  42047. m[10] = h,
  42048. m[14] = u,
  42049. m[3] = d,
  42050. m[7] = p,
  42051. m[11] = f,
  42052. m[15] = g,
  42053. this
  42054. },
  42055. identity: function() {
  42056. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42057. this
  42058. },
  42059. clone: function() {
  42060. return (new n.Matrix4).fromArray(this.elements)
  42061. },
  42062. copy: function(e) {
  42063. return this.elements.set(e.elements),
  42064. this
  42065. },
  42066. copyPosition: function(e) {
  42067. var t = this.elements
  42068. , i = e.elements;
  42069. return t[12] = i[12],
  42070. t[13] = i[13],
  42071. t[14] = i[14],
  42072. this
  42073. },
  42074. extractBasis: function(e, t, i) {
  42075. return e.setFromMatrixColumn(this, 0),
  42076. t.setFromMatrixColumn(this, 1),
  42077. i.setFromMatrixColumn(this, 2),
  42078. this
  42079. },
  42080. makeBasis: function(e, t, i) {
  42081. 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),
  42082. this
  42083. },
  42084. extractRotation: function() {
  42085. var e;
  42086. return function(t) {
  42087. void 0 === e && (e = new n.Vector3);
  42088. var i = this.elements
  42089. , r = t.elements
  42090. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42091. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42092. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42093. return i[0] = r[0] * o,
  42094. i[1] = r[1] * o,
  42095. i[2] = r[2] * o,
  42096. i[4] = r[4] * a,
  42097. i[5] = r[5] * a,
  42098. i[6] = r[6] * a,
  42099. i[8] = r[8] * s,
  42100. i[9] = r[9] * s,
  42101. i[10] = r[10] * s,
  42102. this
  42103. }
  42104. }(),
  42105. makeRotationFromEuler: function(e) {
  42106. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42107. var t = this.elements
  42108. , i = e.x
  42109. , r = e.y
  42110. , o = e.z
  42111. , a = Math.cos(i)
  42112. , s = Math.sin(i)
  42113. , l = Math.cos(r)
  42114. , c = Math.sin(r)
  42115. , h = Math.cos(o)
  42116. , u = Math.sin(o);
  42117. if ("XYZ" === e.order) {
  42118. var d = a * h
  42119. , p = a * u
  42120. , f = s * h
  42121. , g = s * u;
  42122. t[0] = l * h,
  42123. t[4] = -l * u,
  42124. t[8] = c,
  42125. t[1] = p + f * c,
  42126. t[5] = d - g * c,
  42127. t[9] = -s * l,
  42128. t[2] = g - d * c,
  42129. t[6] = f + p * c,
  42130. t[10] = a * l
  42131. } else if ("YXZ" === e.order) {
  42132. var m = l * h
  42133. , v = l * u
  42134. , A = c * h
  42135. , y = c * u;
  42136. t[0] = m + y * s,
  42137. t[4] = A * s - v,
  42138. t[8] = a * c,
  42139. t[1] = a * u,
  42140. t[5] = a * h,
  42141. t[9] = -s,
  42142. t[2] = v * s - A,
  42143. t[6] = y + m * s,
  42144. t[10] = a * l
  42145. } else if ("ZXY" === e.order) {
  42146. var m = l * h
  42147. , v = l * u
  42148. , A = c * h
  42149. , y = c * u;
  42150. t[0] = m - y * s,
  42151. t[4] = -a * u,
  42152. t[8] = A + v * s,
  42153. t[1] = v + A * s,
  42154. t[5] = a * h,
  42155. t[9] = y - m * s,
  42156. t[2] = -a * c,
  42157. t[6] = s,
  42158. t[10] = a * l
  42159. } else if ("ZYX" === e.order) {
  42160. var d = a * h
  42161. , p = a * u
  42162. , f = s * h
  42163. , g = s * u;
  42164. t[0] = l * h,
  42165. t[4] = f * c - p,
  42166. t[8] = d * c + g,
  42167. t[1] = l * u,
  42168. t[5] = g * c + d,
  42169. t[9] = p * c - f,
  42170. t[2] = -c,
  42171. t[6] = s * l,
  42172. t[10] = a * l
  42173. } else if ("YZX" === e.order) {
  42174. var C = a * l
  42175. , I = a * c
  42176. , E = s * l
  42177. , b = s * c;
  42178. t[0] = l * h,
  42179. t[4] = b - C * u,
  42180. t[8] = E * u + I,
  42181. t[1] = u,
  42182. t[5] = a * h,
  42183. t[9] = -s * h,
  42184. t[2] = -c * h,
  42185. t[6] = I * u + E,
  42186. t[10] = C - b * u
  42187. } else if ("XZY" === e.order) {
  42188. var C = a * l
  42189. , I = a * c
  42190. , E = s * l
  42191. , b = s * c;
  42192. t[0] = l * h,
  42193. t[4] = -u,
  42194. t[8] = c * h,
  42195. t[1] = C * u + b,
  42196. t[5] = a * h,
  42197. t[9] = I * u - E,
  42198. t[2] = E * u - I,
  42199. t[6] = s * h,
  42200. t[10] = b * u + C
  42201. }
  42202. return t[3] = 0,
  42203. t[7] = 0,
  42204. t[11] = 0,
  42205. t[12] = 0,
  42206. t[13] = 0,
  42207. t[14] = 0,
  42208. t[15] = 1,
  42209. this
  42210. },
  42211. makeRotationFromQuaternion: function(e) {
  42212. var t = this.elements
  42213. , i = e.x
  42214. , n = e.y
  42215. , r = e.z
  42216. , o = e.w
  42217. , a = i + i
  42218. , s = n + n
  42219. , l = r + r
  42220. , c = i * a
  42221. , h = i * s
  42222. , u = i * l
  42223. , d = n * s
  42224. , p = n * l
  42225. , f = r * l
  42226. , g = o * a
  42227. , m = o * s
  42228. , v = o * l;
  42229. return t[0] = 1 - (d + f),
  42230. t[4] = h - v,
  42231. t[8] = u + m,
  42232. t[1] = h + v,
  42233. t[5] = 1 - (c + f),
  42234. t[9] = p - g,
  42235. t[2] = u - m,
  42236. t[6] = p + g,
  42237. t[10] = 1 - (c + d),
  42238. t[3] = 0,
  42239. t[7] = 0,
  42240. t[11] = 0,
  42241. t[12] = 0,
  42242. t[13] = 0,
  42243. t[14] = 0,
  42244. t[15] = 1,
  42245. this
  42246. },
  42247. lookAt: function() {
  42248. var e, t, i;
  42249. return function(r, o, a) {
  42250. void 0 === e && (e = new n.Vector3),
  42251. void 0 === t && (t = new n.Vector3),
  42252. void 0 === i && (i = new n.Vector3);
  42253. var s = this.elements;
  42254. return i.subVectors(r, o).normalize(),
  42255. 0 === i.lengthSq() && (i.z = 1),
  42256. e.crossVectors(a, i).normalize(),
  42257. 0 === e.lengthSq() && (i.x += 1e-4,
  42258. e.crossVectors(a, i).normalize()),
  42259. t.crossVectors(i, e),
  42260. s[0] = e.x,
  42261. s[4] = t.x,
  42262. s[8] = i.x,
  42263. s[1] = e.y,
  42264. s[5] = t.y,
  42265. s[9] = i.y,
  42266. s[2] = e.z,
  42267. s[6] = t.z,
  42268. s[10] = i.z,
  42269. this
  42270. }
  42271. }(),
  42272. multiply: function(e, t) {
  42273. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42274. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42275. },
  42276. multiplyMatrices: function(e, t) {
  42277. var i = e.elements
  42278. , n = t.elements
  42279. , r = this.elements
  42280. , o = i[0]
  42281. , a = i[4]
  42282. , s = i[8]
  42283. , l = i[12]
  42284. , c = i[1]
  42285. , h = i[5]
  42286. , u = i[9]
  42287. , d = i[13]
  42288. , p = i[2]
  42289. , f = i[6]
  42290. , g = i[10]
  42291. , m = i[14]
  42292. , v = i[3]
  42293. , A = i[7]
  42294. , y = i[11]
  42295. , C = i[15]
  42296. , I = n[0]
  42297. , E = n[4]
  42298. , b = n[8]
  42299. , w = n[12]
  42300. , _ = n[1]
  42301. , T = n[5]
  42302. , x = n[9]
  42303. , S = n[13]
  42304. , M = n[2]
  42305. , R = n[6]
  42306. , P = n[10]
  42307. , O = n[14]
  42308. , L = n[3]
  42309. , D = n[7]
  42310. , N = n[11]
  42311. , B = n[15];
  42312. return r[0] = o * I + a * _ + s * M + l * L,
  42313. r[4] = o * E + a * T + s * R + l * D,
  42314. r[8] = o * b + a * x + s * P + l * N,
  42315. r[12] = o * w + a * S + s * O + l * B,
  42316. r[1] = c * I + h * _ + u * M + d * L,
  42317. r[5] = c * E + h * T + u * R + d * D,
  42318. r[9] = c * b + h * x + u * P + d * N,
  42319. r[13] = c * w + h * S + u * O + d * B,
  42320. r[2] = p * I + f * _ + g * M + m * L,
  42321. r[6] = p * E + f * T + g * R + m * D,
  42322. r[10] = p * b + f * x + g * P + m * N,
  42323. r[14] = p * w + f * S + g * O + m * B,
  42324. r[3] = v * I + A * _ + y * M + C * L,
  42325. r[7] = v * E + A * T + y * R + C * D,
  42326. r[11] = v * b + A * x + y * P + C * N,
  42327. r[15] = v * w + A * S + y * O + C * B,
  42328. this
  42329. },
  42330. multiplyToArray: function(e, t, i) {
  42331. var n = this.elements;
  42332. return this.multiplyMatrices(e, t),
  42333. i[0] = n[0],
  42334. i[1] = n[1],
  42335. i[2] = n[2],
  42336. i[3] = n[3],
  42337. i[4] = n[4],
  42338. i[5] = n[5],
  42339. i[6] = n[6],
  42340. i[7] = n[7],
  42341. i[8] = n[8],
  42342. i[9] = n[9],
  42343. i[10] = n[10],
  42344. i[11] = n[11],
  42345. i[12] = n[12],
  42346. i[13] = n[13],
  42347. i[14] = n[14],
  42348. i[15] = n[15],
  42349. this
  42350. },
  42351. multiplyScalar: function(e) {
  42352. var t = this.elements;
  42353. return t[0] *= e,
  42354. t[4] *= e,
  42355. t[8] *= e,
  42356. t[12] *= e,
  42357. t[1] *= e,
  42358. t[5] *= e,
  42359. t[9] *= e,
  42360. t[13] *= e,
  42361. t[2] *= e,
  42362. t[6] *= e,
  42363. t[10] *= e,
  42364. t[14] *= e,
  42365. t[3] *= e,
  42366. t[7] *= e,
  42367. t[11] *= e,
  42368. t[15] *= e,
  42369. this
  42370. },
  42371. applyToVector3Array: function() {
  42372. var e;
  42373. return function(t, i, r) {
  42374. void 0 === e && (e = new n.Vector3),
  42375. void 0 === i && (i = 0),
  42376. void 0 === r && (r = t.length);
  42377. for (var o = 0, a = i; o < r; o += 3,
  42378. a += 3)
  42379. e.fromArray(t, a),
  42380. e.applyMatrix4(this),
  42381. e.toArray(t, a);
  42382. return t
  42383. }
  42384. }(),
  42385. applyToBuffer: function() {
  42386. var e;
  42387. return function(t, i, r) {
  42388. void 0 === e && (e = new n.Vector3),
  42389. void 0 === i && (i = 0),
  42390. void 0 === r && (r = t.length / t.itemSize);
  42391. for (var o = 0, a = i; o < r; o++,
  42392. a++)
  42393. e.x = t.getX(a),
  42394. e.y = t.getY(a),
  42395. e.z = t.getZ(a),
  42396. e.applyMatrix4(this),
  42397. t.setXYZ(e.x, e.y, e.z);
  42398. return t
  42399. }
  42400. }(),
  42401. determinant: function() {
  42402. var e = this.elements
  42403. , t = e[0]
  42404. , i = e[4]
  42405. , n = e[8]
  42406. , r = e[12]
  42407. , o = e[1]
  42408. , a = e[5]
  42409. , s = e[9]
  42410. , l = e[13]
  42411. , c = e[2]
  42412. , h = e[6]
  42413. , u = e[10]
  42414. , d = e[14]
  42415. , p = e[3]
  42416. , f = e[7]
  42417. , g = e[11]
  42418. , m = e[15];
  42419. 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)
  42420. },
  42421. transpose: function() {
  42422. var e, t = this.elements;
  42423. return e = t[1],
  42424. t[1] = t[4],
  42425. t[4] = e,
  42426. e = t[2],
  42427. t[2] = t[8],
  42428. t[8] = e,
  42429. e = t[6],
  42430. t[6] = t[9],
  42431. t[9] = e,
  42432. e = t[3],
  42433. t[3] = t[12],
  42434. t[12] = e,
  42435. e = t[7],
  42436. t[7] = t[13],
  42437. t[13] = e,
  42438. e = t[11],
  42439. t[11] = t[14],
  42440. t[14] = e,
  42441. this
  42442. },
  42443. flattenToArrayOffset: function(e, t) {
  42444. var i = this.elements;
  42445. return e[t] = i[0],
  42446. e[t + 1] = i[1],
  42447. e[t + 2] = i[2],
  42448. e[t + 3] = i[3],
  42449. e[t + 4] = i[4],
  42450. e[t + 5] = i[5],
  42451. e[t + 6] = i[6],
  42452. e[t + 7] = i[7],
  42453. e[t + 8] = i[8],
  42454. e[t + 9] = i[9],
  42455. e[t + 10] = i[10],
  42456. e[t + 11] = i[11],
  42457. e[t + 12] = i[12],
  42458. e[t + 13] = i[13],
  42459. e[t + 14] = i[14],
  42460. e[t + 15] = i[15],
  42461. e
  42462. },
  42463. getPosition: function() {
  42464. var e;
  42465. return function() {
  42466. return void 0 === e && (e = new n.Vector3),
  42467. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42468. e.setFromMatrixColumn(this, 3)
  42469. }
  42470. }(),
  42471. setPosition: function(e) {
  42472. var t = this.elements;
  42473. return t[12] = e.x,
  42474. t[13] = e.y,
  42475. t[14] = e.z,
  42476. this
  42477. },
  42478. getInverse: function(e, t) {
  42479. var i = this.elements
  42480. , n = e.elements
  42481. , r = n[0]
  42482. , o = n[1]
  42483. , a = n[2]
  42484. , s = n[3]
  42485. , l = n[4]
  42486. , c = n[5]
  42487. , h = n[6]
  42488. , u = n[7]
  42489. , d = n[8]
  42490. , p = n[9]
  42491. , f = n[10]
  42492. , g = n[11]
  42493. , m = n[12]
  42494. , v = n[13]
  42495. , A = n[14]
  42496. , y = n[15]
  42497. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42498. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42499. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42500. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42501. , w = r * C + o * I + a * E + s * b;
  42502. if (0 === w) {
  42503. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42504. if (t)
  42505. throw new Error(_);
  42506. return console.warn(_),
  42507. this.identity()
  42508. }
  42509. return i[0] = C,
  42510. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42511. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42512. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42513. i[4] = I,
  42514. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42515. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42516. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42517. i[8] = E,
  42518. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42519. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42520. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42521. i[12] = b,
  42522. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42523. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42524. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42525. this.multiplyScalar(1 / w)
  42526. },
  42527. scale: function(e) {
  42528. var t = this.elements
  42529. , i = e.x
  42530. , n = e.y
  42531. , r = e.z;
  42532. return t[0] *= i,
  42533. t[4] *= n,
  42534. t[8] *= r,
  42535. t[1] *= i,
  42536. t[5] *= n,
  42537. t[9] *= r,
  42538. t[2] *= i,
  42539. t[6] *= n,
  42540. t[10] *= r,
  42541. t[3] *= i,
  42542. t[7] *= n,
  42543. t[11] *= r,
  42544. this
  42545. },
  42546. getMaxScaleOnAxis: function() {
  42547. var e = this.elements
  42548. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42549. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42550. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42551. return Math.sqrt(Math.max(t, i, n))
  42552. },
  42553. makeTranslation: function(e, t, i) {
  42554. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42555. this
  42556. },
  42557. makeRotationX: function(e) {
  42558. var t = Math.cos(e)
  42559. , i = Math.sin(e);
  42560. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42561. this
  42562. },
  42563. makeRotationY: function(e) {
  42564. var t = Math.cos(e)
  42565. , i = Math.sin(e);
  42566. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42567. this
  42568. },
  42569. makeRotationZ: function(e) {
  42570. var t = Math.cos(e)
  42571. , i = Math.sin(e);
  42572. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42573. this
  42574. },
  42575. makeRotationAxis: function(e, t) {
  42576. var i = Math.cos(t)
  42577. , n = Math.sin(t)
  42578. , r = 1 - i
  42579. , o = e.x
  42580. , a = e.y
  42581. , s = e.z
  42582. , l = r * o
  42583. , c = r * a;
  42584. 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),
  42585. this
  42586. },
  42587. makeScale: function(e, t, i) {
  42588. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42589. this
  42590. },
  42591. compose: function(e, t, i) {
  42592. return this.makeRotationFromQuaternion(t),
  42593. this.scale(i),
  42594. this.setPosition(e),
  42595. this
  42596. },
  42597. decompose: function() {
  42598. var e, t;
  42599. return function(i, r, o) {
  42600. void 0 === e && (e = new n.Vector3),
  42601. void 0 === t && (t = new n.Matrix4);
  42602. var a = this.elements
  42603. , s = e.set(a[0], a[1], a[2]).length()
  42604. , l = e.set(a[4], a[5], a[6]).length()
  42605. , c = e.set(a[8], a[9], a[10]).length()
  42606. , h = this.determinant();
  42607. h < 0 && (s = -s),
  42608. i.x = a[12],
  42609. i.y = a[13],
  42610. i.z = a[14],
  42611. t.elements.set(this.elements);
  42612. var u = 1 / s
  42613. , d = 1 / l
  42614. , p = 1 / c;
  42615. return t.elements[0] *= u,
  42616. t.elements[1] *= u,
  42617. t.elements[2] *= u,
  42618. t.elements[4] *= d,
  42619. t.elements[5] *= d,
  42620. t.elements[6] *= d,
  42621. t.elements[8] *= p,
  42622. t.elements[9] *= p,
  42623. t.elements[10] *= p,
  42624. r.setFromRotationMatrix(t),
  42625. o.x = s,
  42626. o.y = l,
  42627. o.z = c,
  42628. this
  42629. }
  42630. }(),
  42631. makeFrustum: function(e, t, i, n, r, o) {
  42632. var a = this.elements
  42633. , s = 2 * r / (t - e)
  42634. , l = 2 * r / (n - i)
  42635. , c = (t + e) / (t - e)
  42636. , h = (n + i) / (n - i)
  42637. , u = -(o + r) / (o - r)
  42638. , d = -2 * o * r / (o - r);
  42639. return a[0] = s,
  42640. a[4] = 0,
  42641. a[8] = c,
  42642. a[12] = 0,
  42643. a[1] = 0,
  42644. a[5] = l,
  42645. a[9] = h,
  42646. a[13] = 0,
  42647. a[2] = 0,
  42648. a[6] = 0,
  42649. a[10] = u,
  42650. a[14] = d,
  42651. a[3] = 0,
  42652. a[7] = 0,
  42653. a[11] = -1,
  42654. a[15] = 0,
  42655. this
  42656. },
  42657. makePerspective: function(e, t, i, r) {
  42658. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42659. , a = -o
  42660. , s = a * t
  42661. , l = o * t;
  42662. return this.makeFrustum(s, l, a, o, i, r)
  42663. },
  42664. makeOrthographic: function(e, t, i, n, r, o) {
  42665. var a = this.elements
  42666. , s = 1 / (t - e)
  42667. , l = 1 / (i - n)
  42668. , c = 1 / (o - r)
  42669. , h = (t + e) * s
  42670. , u = (i + n) * l
  42671. , d = (o + r) * c;
  42672. return a[0] = 2 * s,
  42673. a[4] = 0,
  42674. a[8] = 0,
  42675. a[12] = -h,
  42676. a[1] = 0,
  42677. a[5] = 2 * l,
  42678. a[9] = 0,
  42679. a[13] = -u,
  42680. a[2] = 0,
  42681. a[6] = 0,
  42682. a[10] = -2 * c,
  42683. a[14] = -d,
  42684. a[3] = 0,
  42685. a[7] = 0,
  42686. a[11] = 0,
  42687. a[15] = 1,
  42688. this
  42689. },
  42690. equals: function(e) {
  42691. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42692. if (t[n] !== i[n])
  42693. return !1;
  42694. return !0
  42695. },
  42696. fromArray: function(e) {
  42697. return this.elements.set(e),
  42698. this
  42699. },
  42700. toArray: function() {
  42701. var e = this.elements;
  42702. 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]]
  42703. }
  42704. },
  42705. n.Ray = function(e, t) {
  42706. this.origin = void 0 !== e ? e : new n.Vector3,
  42707. this.direction = void 0 !== t ? t : new n.Vector3
  42708. }
  42709. ,
  42710. n.Ray.prototype = {
  42711. constructor: n.Ray,
  42712. set: function(e, t) {
  42713. return this.origin.copy(e),
  42714. this.direction.copy(t),
  42715. this
  42716. },
  42717. clone: function() {
  42718. return (new this.constructor).copy(this)
  42719. },
  42720. copy: function(e) {
  42721. return this.origin.copy(e.origin),
  42722. this.direction.copy(e.direction),
  42723. this
  42724. },
  42725. at: function(e, t) {
  42726. var i = t || new n.Vector3;
  42727. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42728. },
  42729. lookAt: function(e) {
  42730. this.direction.copy(e).sub(this.origin).normalize()
  42731. },
  42732. recast: function() {
  42733. var e = new n.Vector3;
  42734. return function(t) {
  42735. return this.origin.copy(this.at(t, e)),
  42736. this
  42737. }
  42738. }(),
  42739. closestPointToPoint: function(e, t) {
  42740. var i = t || new n.Vector3;
  42741. i.subVectors(e, this.origin);
  42742. var r = i.dot(this.direction);
  42743. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42744. },
  42745. distanceToPoint: function(e) {
  42746. return Math.sqrt(this.distanceSqToPoint(e))
  42747. },
  42748. distanceSqToPoint: function() {
  42749. var e = new n.Vector3;
  42750. return function(t) {
  42751. var i = e.subVectors(t, this.origin).dot(this.direction);
  42752. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42753. e.distanceToSquared(t))
  42754. }
  42755. }(),
  42756. distanceSqToSegment: function() {
  42757. var e = new n.Vector3
  42758. , t = new n.Vector3
  42759. , i = new n.Vector3;
  42760. return function(n, r, o, a) {
  42761. e.copy(n).add(r).multiplyScalar(.5),
  42762. t.copy(r).sub(n).normalize(),
  42763. i.copy(this.origin).sub(e);
  42764. 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);
  42765. if (m > 0)
  42766. if (s = d * f - p,
  42767. l = d * p - f,
  42768. h = u * m,
  42769. s >= 0)
  42770. if (l >= -h)
  42771. if (l <= h) {
  42772. var v = 1 / m;
  42773. s *= v,
  42774. l *= v,
  42775. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42776. } else
  42777. l = u,
  42778. s = Math.max(0, -(d * l + p)),
  42779. c = -s * s + l * (l + 2 * f) + g;
  42780. else
  42781. l = -u,
  42782. s = Math.max(0, -(d * l + p)),
  42783. c = -s * s + l * (l + 2 * f) + g;
  42784. else
  42785. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42786. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42787. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42788. l = Math.min(Math.max(-u, -f), u),
  42789. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42790. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42791. c = -s * s + l * (l + 2 * f) + g);
  42792. else
  42793. l = d > 0 ? -u : u,
  42794. s = Math.max(0, -(d * l + p)),
  42795. c = -s * s + l * (l + 2 * f) + g;
  42796. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42797. a && a.copy(t).multiplyScalar(l).add(e),
  42798. c
  42799. }
  42800. }(),
  42801. intersectSphere: function() {
  42802. var e = new n.Vector3;
  42803. return function(t, i) {
  42804. e.subVectors(t.center, this.origin);
  42805. var n = e.dot(this.direction)
  42806. , r = e.dot(e) - n * n
  42807. , o = t.radius * t.radius;
  42808. if (r > o)
  42809. return null;
  42810. var a = Math.sqrt(o - r)
  42811. , s = n - a
  42812. , l = n + a;
  42813. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42814. }
  42815. }(),
  42816. intersectsSphere: function(e) {
  42817. return this.distanceToPoint(e.center) <= e.radius
  42818. },
  42819. distanceToPlane: function(e) {
  42820. var t = e.normal.dot(this.direction);
  42821. if (0 === t)
  42822. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42823. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42824. return i >= 0 ? i : null
  42825. },
  42826. intersectPlane: function(e, t) {
  42827. var i = this.distanceToPlane(e);
  42828. return null === i ? null : this.at(i, t)
  42829. },
  42830. intersectsPlane: function(e) {
  42831. var t = e.distanceToPoint(this.origin);
  42832. if (0 === t)
  42833. return !0;
  42834. var i = e.normal.dot(this.direction);
  42835. return i * t < 0
  42836. },
  42837. intersectBox: function(e, t) {
  42838. 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;
  42839. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42840. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42841. n = (e.min.x - u.x) * l),
  42842. c >= 0 ? (r = (e.min.y - u.y) * c,
  42843. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42844. o = (e.min.y - u.y) * c),
  42845. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42846. (o < n || n !== n) && (n = o),
  42847. h >= 0 ? (a = (e.min.z - u.z) * h,
  42848. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42849. s = (e.min.z - u.z) * h),
  42850. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42851. (s < n || n !== n) && (n = s),
  42852. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42853. },
  42854. intersectsBox: function() {
  42855. var e = new n.Vector3;
  42856. return function(t) {
  42857. return null !== this.intersectBox(t, e)
  42858. }
  42859. }(),
  42860. intersectTriangle: function() {
  42861. var e = new n.Vector3
  42862. , t = new n.Vector3
  42863. , i = new n.Vector3
  42864. , r = new n.Vector3;
  42865. return function(n, o, a, s, l) {
  42866. t.subVectors(o, n),
  42867. i.subVectors(a, n),
  42868. r.crossVectors(t, i);
  42869. var c, h = this.direction.dot(r);
  42870. if (h > 0) {
  42871. if (s)
  42872. return null;
  42873. c = 1
  42874. } else {
  42875. if (!(h < 0))
  42876. return null;
  42877. c = -1,
  42878. h = -h
  42879. }
  42880. e.subVectors(this.origin, n);
  42881. var u = c * this.direction.dot(i.crossVectors(e, i));
  42882. if (u < 0)
  42883. return null;
  42884. var d = c * this.direction.dot(t.cross(e));
  42885. if (d < 0)
  42886. return null;
  42887. if (u + d > h)
  42888. return null;
  42889. var p = -c * e.dot(r);
  42890. return p < 0 ? null : this.at(p / h, l)
  42891. }
  42892. }(),
  42893. applyMatrix4: function(e) {
  42894. return this.direction.add(this.origin).applyMatrix4(e),
  42895. this.origin.applyMatrix4(e),
  42896. this.direction.sub(this.origin),
  42897. this.direction.normalize(),
  42898. this
  42899. },
  42900. equals: function(e) {
  42901. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42902. }
  42903. },
  42904. n.Sphere = function(e, t) {
  42905. this.center = void 0 !== e ? e : new n.Vector3,
  42906. this.radius = void 0 !== t ? t : 0
  42907. }
  42908. ,
  42909. n.Sphere.prototype = {
  42910. constructor: n.Sphere,
  42911. set: function(e, t) {
  42912. return this.center.copy(e),
  42913. this.radius = t,
  42914. this
  42915. },
  42916. setFromPoints: function() {
  42917. var e = new n.Box3;
  42918. return function(t, i) {
  42919. var n = this.center;
  42920. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42921. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42922. r = Math.max(r, n.distanceToSquared(t[o]));
  42923. return this.radius = Math.sqrt(r),
  42924. this
  42925. }
  42926. }(),
  42927. clone: function() {
  42928. return (new this.constructor).copy(this)
  42929. },
  42930. copy: function(e) {
  42931. return this.center.copy(e.center),
  42932. this.radius = e.radius,
  42933. this
  42934. },
  42935. empty: function() {
  42936. return this.radius <= 0
  42937. },
  42938. containsPoint: function(e) {
  42939. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42940. },
  42941. distanceToPoint: function(e) {
  42942. return e.distanceTo(this.center) - this.radius
  42943. },
  42944. intersectsSphere: function(e) {
  42945. var t = this.radius + e.radius;
  42946. return e.center.distanceToSquared(this.center) <= t * t
  42947. },
  42948. intersectsBox: function(e) {
  42949. return e.intersectsSphere(this)
  42950. },
  42951. intersectsPlane: function(e) {
  42952. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42953. },
  42954. clampPoint: function(e, t) {
  42955. var i = this.center.distanceToSquared(e)
  42956. , r = t || new n.Vector3;
  42957. return r.copy(e),
  42958. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42959. r.multiplyScalar(this.radius).add(this.center)),
  42960. r
  42961. },
  42962. getBoundingBox: function(e) {
  42963. var t = e || new n.Box3;
  42964. return t.set(this.center, this.center),
  42965. t.expandByScalar(this.radius),
  42966. t
  42967. },
  42968. applyMatrix4: function(e) {
  42969. return this.center.applyMatrix4(e),
  42970. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42971. this
  42972. },
  42973. translate: function(e) {
  42974. return this.center.add(e),
  42975. this
  42976. },
  42977. equals: function(e) {
  42978. return e.center.equals(this.center) && e.radius === this.radius
  42979. }
  42980. },
  42981. n.Frustum = function(e, t, i, r, o, a) {
  42982. 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]
  42983. }
  42984. ,
  42985. n.Frustum.prototype = {
  42986. constructor: n.Frustum,
  42987. set: function(e, t, i, n, r, o) {
  42988. var a = this.planes;
  42989. return a[0].copy(e),
  42990. a[1].copy(t),
  42991. a[2].copy(i),
  42992. a[3].copy(n),
  42993. a[4].copy(r),
  42994. a[5].copy(o),
  42995. this
  42996. },
  42997. clone: function() {
  42998. return (new this.constructor).copy(this)
  42999. },
  43000. copy: function(e) {
  43001. for (var t = this.planes, i = 0; i < 6; i++)
  43002. t[i].copy(e.planes[i]);
  43003. return this
  43004. },
  43005. setFromMatrix: function(e) {
  43006. var t = this.planes
  43007. , i = e.elements
  43008. , n = i[0]
  43009. , r = i[1]
  43010. , o = i[2]
  43011. , a = i[3]
  43012. , s = i[4]
  43013. , l = i[5]
  43014. , c = i[6]
  43015. , h = i[7]
  43016. , u = i[8]
  43017. , d = i[9]
  43018. , p = i[10]
  43019. , f = i[11]
  43020. , g = i[12]
  43021. , m = i[13]
  43022. , v = i[14]
  43023. , A = i[15];
  43024. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43025. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43026. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43027. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43028. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43029. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43030. this
  43031. },
  43032. intersectsObject: function() {
  43033. var e = new n.Sphere;
  43034. return function(t) {
  43035. var i = t.geometry;
  43036. return null === i.boundingSphere && i.computeBoundingSphere(),
  43037. e.copy(i.boundingSphere),
  43038. e.applyMatrix4(t.matrixWorld),
  43039. this.intersectsSphere(e)
  43040. }
  43041. }(),
  43042. intersectsSphere: function(e) {
  43043. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43044. var o = t[r].distanceToPoint(i);
  43045. if (o < n)
  43046. return !1
  43047. }
  43048. return !0
  43049. },
  43050. intersectsBox: function() {
  43051. var e = new n.Vector3
  43052. , t = new n.Vector3;
  43053. return function(i) {
  43054. for (var n = this.planes, r = 0; r < 6; r++) {
  43055. var o = n[r];
  43056. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43057. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43058. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43059. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43060. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43061. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43062. var a = o.distanceToPoint(e)
  43063. , s = o.distanceToPoint(t);
  43064. if (a < 0 && s < 0)
  43065. return !1
  43066. }
  43067. return !0
  43068. }
  43069. }(),
  43070. containsPoint: function(e) {
  43071. for (var t = this.planes, i = 0; i < 6; i++)
  43072. if (t[i].distanceToPoint(e) < 0)
  43073. return !1;
  43074. return !0
  43075. }
  43076. },
  43077. n.Plane = function(e, t) {
  43078. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43079. this.constant = void 0 !== t ? t : 0
  43080. }
  43081. ,
  43082. n.Plane.prototype = {
  43083. constructor: n.Plane,
  43084. set: function(e, t) {
  43085. return this.normal.copy(e),
  43086. this.constant = t,
  43087. this
  43088. },
  43089. setComponents: function(e, t, i, n) {
  43090. return this.normal.set(e, t, i),
  43091. this.constant = n,
  43092. this
  43093. },
  43094. setFromNormalAndCoplanarPoint: function(e, t) {
  43095. return this.normal.copy(e),
  43096. this.constant = -t.dot(this.normal),
  43097. this
  43098. },
  43099. setFromCoplanarPoints: function() {
  43100. var e = new n.Vector3
  43101. , t = new n.Vector3;
  43102. return function(i, n, r) {
  43103. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43104. return this.setFromNormalAndCoplanarPoint(o, i),
  43105. this
  43106. }
  43107. }(),
  43108. clone: function() {
  43109. return (new this.constructor).copy(this)
  43110. },
  43111. copy: function(e) {
  43112. return this.normal.copy(e.normal),
  43113. this.constant = e.constant,
  43114. this
  43115. },
  43116. normalize: function() {
  43117. var e = 1 / this.normal.length();
  43118. return this.normal.multiplyScalar(e),
  43119. this.constant *= e,
  43120. this
  43121. },
  43122. negate: function() {
  43123. return this.constant *= -1,
  43124. this.normal.negate(),
  43125. this
  43126. },
  43127. distanceToPoint: function(e) {
  43128. return this.normal.dot(e) + this.constant
  43129. },
  43130. distanceToSphere: function(e) {
  43131. return this.distanceToPoint(e.center) - e.radius
  43132. },
  43133. projectPoint: function(e, t) {
  43134. return this.orthoPoint(e, t).sub(e).negate()
  43135. },
  43136. orthoPoint: function(e, t) {
  43137. var i = this.distanceToPoint(e)
  43138. , r = t || new n.Vector3;
  43139. return r.copy(this.normal).multiplyScalar(i)
  43140. },
  43141. intersectLine: function() {
  43142. var e = new n.Vector3;
  43143. return function(t, i) {
  43144. var r = i || new n.Vector3
  43145. , o = t.delta(e)
  43146. , a = this.normal.dot(o);
  43147. if (0 !== a) {
  43148. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43149. if (!(s < 0 || s > 1))
  43150. return r.copy(o).multiplyScalar(s).add(t.start)
  43151. } else if (0 === this.distanceToPoint(t.start))
  43152. return r.copy(t.start)
  43153. }
  43154. }(),
  43155. intersectsLine: function(e) {
  43156. var t = this.distanceToPoint(e.start)
  43157. , i = this.distanceToPoint(e.end);
  43158. return t < 0 && i > 0 || i < 0 && t > 0
  43159. },
  43160. intersectsBox: function(e) {
  43161. return e.intersectsPlane(this)
  43162. },
  43163. intersectsSphere: function(e) {
  43164. return e.intersectsPlane(this)
  43165. },
  43166. coplanarPoint: function(e) {
  43167. var t = e || new n.Vector3;
  43168. return t.copy(this.normal).multiplyScalar(-this.constant)
  43169. },
  43170. applyMatrix4: function() {
  43171. var e = new n.Vector3
  43172. , t = new n.Vector3
  43173. , i = new n.Matrix3;
  43174. return function(n, r) {
  43175. var o = r || i.getNormalMatrix(n)
  43176. , a = e.copy(this.normal).applyMatrix3(o)
  43177. , s = this.coplanarPoint(t);
  43178. return s.applyMatrix4(n),
  43179. this.setFromNormalAndCoplanarPoint(a, s),
  43180. this
  43181. }
  43182. }(),
  43183. translate: function(e) {
  43184. return this.constant = this.constant - e.dot(this.normal),
  43185. this
  43186. },
  43187. equals: function(e) {
  43188. return e.normal.equals(this.normal) && e.constant === this.constant
  43189. }
  43190. },
  43191. n.Spherical = function(e, t, i) {
  43192. return this.radius = void 0 !== e ? e : 1,
  43193. this.phi = void 0 !== t ? t : 0,
  43194. this.theta = void 0 !== i ? i : 0,
  43195. this
  43196. }
  43197. ,
  43198. n.Spherical.prototype = {
  43199. constructor: n.Spherical,
  43200. set: function(e, t, i) {
  43201. this.radius = e,
  43202. this.phi = t,
  43203. this.theta = i
  43204. },
  43205. clone: function() {
  43206. return (new this.constructor).copy(this)
  43207. },
  43208. copy: function(e) {
  43209. return this.radius.copy(e.radius),
  43210. this.phi.copy(e.phi),
  43211. this.theta.copy(e.theta),
  43212. this
  43213. },
  43214. makeSafe: function() {
  43215. var e = 1e-6;
  43216. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43217. },
  43218. setFromVector3: function(e) {
  43219. return this.radius = e.length(),
  43220. 0 === this.radius ? (this.theta = 0,
  43221. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43222. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43223. this
  43224. }
  43225. },
  43226. n.Math = {
  43227. generateUUID: function() {
  43228. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43229. return function() {
  43230. for (var r = 0; r < 36; r++)
  43231. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43232. e = 15 & n,
  43233. n >>= 4,
  43234. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43235. return i.join("")
  43236. }
  43237. }(),
  43238. clamp: function(e, t, i) {
  43239. return Math.max(t, Math.min(i, e))
  43240. },
  43241. euclideanModulo: function(e, t) {
  43242. return (e % t + t) % t
  43243. },
  43244. mapLinear: function(e, t, i, n, r) {
  43245. return n + (e - t) * (r - n) / (i - t)
  43246. },
  43247. smoothstep: function(e, t, i) {
  43248. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43249. e * e * (3 - 2 * e))
  43250. },
  43251. smootherstep: function(e, t, i) {
  43252. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43253. e * e * e * (e * (6 * e - 15) + 10))
  43254. },
  43255. random16: function() {
  43256. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43257. Math.random()
  43258. },
  43259. randInt: function(e, t) {
  43260. return e + Math.floor(Math.random() * (t - e + 1))
  43261. },
  43262. randFloat: function(e, t) {
  43263. return e + Math.random() * (t - e)
  43264. },
  43265. randFloatSpread: function(e) {
  43266. return e * (.5 - Math.random())
  43267. },
  43268. degToRad: function() {
  43269. var e = Math.PI / 180;
  43270. return function(t) {
  43271. return t * e
  43272. }
  43273. }(),
  43274. radToDeg: function() {
  43275. var e = 180 / Math.PI;
  43276. return function(t) {
  43277. return t * e
  43278. }
  43279. }(),
  43280. isPowerOfTwo: function(e) {
  43281. return 0 === (e & e - 1) && 0 !== e
  43282. },
  43283. nearestPowerOfTwo: function(e) {
  43284. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43285. },
  43286. nextPowerOfTwo: function(e) {
  43287. return e--,
  43288. e |= e >> 1,
  43289. e |= e >> 2,
  43290. e |= e >> 4,
  43291. e |= e >> 8,
  43292. e |= e >> 16,
  43293. e++,
  43294. e
  43295. }
  43296. },
  43297. n.Spline = function(e) {
  43298. function t(e, t, i, n, r, o, a) {
  43299. var s = .5 * (i - e)
  43300. , l = .5 * (n - t);
  43301. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43302. }
  43303. this.points = e;
  43304. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43305. x: 0,
  43306. y: 0,
  43307. z: 0
  43308. };
  43309. this.initFromArray = function(e) {
  43310. this.points = [];
  43311. for (var t = 0; t < e.length; t++)
  43312. this.points[t] = {
  43313. x: e[t][0],
  43314. y: e[t][1],
  43315. z: e[t][2]
  43316. }
  43317. }
  43318. ,
  43319. this.getPoint = function(e) {
  43320. return i = (this.points.length - 1) * e,
  43321. r = Math.floor(i),
  43322. o = i - r,
  43323. d[0] = 0 === r ? r : r - 1,
  43324. d[1] = r,
  43325. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43326. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43327. l = this.points[d[0]],
  43328. c = this.points[d[1]],
  43329. h = this.points[d[2]],
  43330. u = this.points[d[3]],
  43331. a = o * o,
  43332. s = o * a,
  43333. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43334. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43335. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43336. p
  43337. }
  43338. ,
  43339. this.getControlPointsArray = function() {
  43340. var e, t, i = this.points.length, n = [];
  43341. for (e = 0; e < i; e++)
  43342. t = this.points[e],
  43343. n[e] = [t.x, t.y, t.z];
  43344. return n
  43345. }
  43346. ,
  43347. this.getLength = function(e) {
  43348. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43349. for (u[0] = 0,
  43350. e || (e = 100),
  43351. r = this.points.length * e,
  43352. c.copy(this.points[0]),
  43353. t = 1; t < r; t++)
  43354. i = t / r,
  43355. o = this.getPoint(i),
  43356. h.copy(o),
  43357. d += h.distanceTo(c),
  43358. c.copy(o),
  43359. a = (this.points.length - 1) * i,
  43360. s = Math.floor(a),
  43361. s !== l && (u[s] = d,
  43362. l = s);
  43363. return u[u.length] = d,
  43364. {
  43365. chunks: u,
  43366. total: d
  43367. }
  43368. }
  43369. ,
  43370. this.reparametrizeByArcLength = function(e) {
  43371. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43372. for (h.push(u.copy(this.points[0]).clone()),
  43373. t = 1; t < this.points.length; t++) {
  43374. for (s = d.chunks[t] - d.chunks[t - 1],
  43375. l = Math.ceil(e * s / d.total),
  43376. o = (t - 1) / (this.points.length - 1),
  43377. a = t / (this.points.length - 1),
  43378. i = 1; i < l - 1; i++)
  43379. r = o + i * (1 / l) * (a - o),
  43380. c = this.getPoint(r),
  43381. h.push(u.copy(c).clone());
  43382. h.push(u.copy(this.points[t]).clone())
  43383. }
  43384. this.points = h
  43385. }
  43386. }
  43387. ,
  43388. n.Triangle = function(e, t, i) {
  43389. this.a = void 0 !== e ? e : new n.Vector3,
  43390. this.b = void 0 !== t ? t : new n.Vector3,
  43391. this.c = void 0 !== i ? i : new n.Vector3
  43392. }
  43393. ,
  43394. n.Triangle.normal = function() {
  43395. var e = new n.Vector3;
  43396. return function(t, i, r, o) {
  43397. var a = o || new n.Vector3;
  43398. a.subVectors(r, i),
  43399. e.subVectors(t, i),
  43400. a.cross(e);
  43401. var s = a.lengthSq();
  43402. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43403. }
  43404. }(),
  43405. n.Triangle.barycoordFromPoint = function() {
  43406. var e = new n.Vector3
  43407. , t = new n.Vector3
  43408. , i = new n.Vector3;
  43409. return function(r, o, a, s, l) {
  43410. e.subVectors(s, o),
  43411. t.subVectors(a, o),
  43412. i.subVectors(r, o);
  43413. var c = e.dot(e)
  43414. , h = e.dot(t)
  43415. , u = e.dot(i)
  43416. , d = t.dot(t)
  43417. , p = t.dot(i)
  43418. , f = c * d - h * h
  43419. , g = l || new n.Vector3;
  43420. if (0 === f)
  43421. return g.set(-2, -1, -1);
  43422. var m = 1 / f
  43423. , v = (d * u - h * p) * m
  43424. , A = (c * p - h * u) * m;
  43425. return g.set(1 - v - A, A, v)
  43426. }
  43427. }(),
  43428. n.Triangle.containsPoint = function() {
  43429. var e = new n.Vector3;
  43430. return function(t, i, r, o) {
  43431. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43432. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43433. }
  43434. }(),
  43435. n.Triangle.prototype = {
  43436. constructor: n.Triangle,
  43437. set: function(e, t, i) {
  43438. return this.a.copy(e),
  43439. this.b.copy(t),
  43440. this.c.copy(i),
  43441. this
  43442. },
  43443. setFromPointsAndIndices: function(e, t, i, n) {
  43444. return this.a.copy(e[t]),
  43445. this.b.copy(e[i]),
  43446. this.c.copy(e[n]),
  43447. this
  43448. },
  43449. clone: function() {
  43450. return (new this.constructor).copy(this)
  43451. },
  43452. copy: function(e) {
  43453. return this.a.copy(e.a),
  43454. this.b.copy(e.b),
  43455. this.c.copy(e.c),
  43456. this
  43457. },
  43458. area: function() {
  43459. var e = new n.Vector3
  43460. , t = new n.Vector3;
  43461. return function() {
  43462. return e.subVectors(this.c, this.b),
  43463. t.subVectors(this.a, this.b),
  43464. .5 * e.cross(t).length()
  43465. }
  43466. }(),
  43467. midpoint: function(e) {
  43468. var t = e || new n.Vector3;
  43469. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43470. },
  43471. normal: function(e) {
  43472. return n.Triangle.normal(this.a, this.b, this.c, e)
  43473. },
  43474. plane: function(e) {
  43475. var t = e || new n.Plane;
  43476. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43477. },
  43478. barycoordFromPoint: function(e, t) {
  43479. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43480. },
  43481. containsPoint: function(e) {
  43482. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43483. },
  43484. equals: function(e) {
  43485. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43486. }
  43487. },
  43488. n.Interpolant = function(e, t, i, n) {
  43489. this.parameterPositions = e,
  43490. this._cachedIndex = 0,
  43491. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43492. this.sampleValues = t,
  43493. this.valueSize = i
  43494. }
  43495. ,
  43496. n.Interpolant.prototype = {
  43497. constructor: n.Interpolant,
  43498. evaluate: function(e) {
  43499. var t = this.parameterPositions
  43500. , i = this._cachedIndex
  43501. , n = t[i]
  43502. , r = t[i - 1];
  43503. e: {
  43504. t: {
  43505. var o;
  43506. i: {
  43507. n: if (!(e < n)) {
  43508. for (var a = i + 2; ; ) {
  43509. if (void 0 === n) {
  43510. if (e < r)
  43511. break n;
  43512. return i = t.length,
  43513. this._cachedIndex = i,
  43514. this.afterEnd_(i - 1, e, r)
  43515. }
  43516. if (i === a)
  43517. break;
  43518. if (r = n,
  43519. n = t[++i],
  43520. e < n)
  43521. break t
  43522. }
  43523. o = t.length;
  43524. break i
  43525. }
  43526. {
  43527. if (e >= r)
  43528. break e;
  43529. var s = t[1];
  43530. e < s && (i = 2,
  43531. r = s);
  43532. for (var a = i - 2; ; ) {
  43533. if (void 0 === r)
  43534. return this._cachedIndex = 0,
  43535. this.beforeStart_(0, e, n);
  43536. if (i === a)
  43537. break;
  43538. if (n = r,
  43539. r = t[--i - 1],
  43540. e >= r)
  43541. break t
  43542. }
  43543. o = i,
  43544. i = 0
  43545. }
  43546. }
  43547. for (; i < o; ) {
  43548. var l = i + o >>> 1;
  43549. e < t[l] ? o = l : i = l + 1
  43550. }
  43551. if (n = t[i],
  43552. r = t[i - 1],
  43553. void 0 === r)
  43554. return this._cachedIndex = 0,
  43555. this.beforeStart_(0, e, n);
  43556. if (void 0 === n)
  43557. return i = t.length,
  43558. this._cachedIndex = i,
  43559. this.afterEnd_(i - 1, r, e)
  43560. }
  43561. this._cachedIndex = i,
  43562. this.intervalChanged_(i, r, n)
  43563. }
  43564. return this.interpolate_(i, r, e, n)
  43565. },
  43566. settings: null,
  43567. DefaultSettings_: {},
  43568. getSettings_: function() {
  43569. return this.settings || this.DefaultSettings_
  43570. },
  43571. copySampleValue_: function(e) {
  43572. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43573. t[o] = i[r + o];
  43574. return t
  43575. },
  43576. interpolate_: function(e, t, i, n) {
  43577. throw new Error("call to abstract method")
  43578. },
  43579. intervalChanged_: function(e, t, i) {}
  43580. },
  43581. Object.assign(n.Interpolant.prototype, {
  43582. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43583. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43584. }),
  43585. n.CubicInterpolant = function(e, t, i, r) {
  43586. n.Interpolant.call(this, e, t, i, r),
  43587. this._weightPrev = -0,
  43588. this._offsetPrev = -0,
  43589. this._weightNext = -0,
  43590. this._offsetNext = -0
  43591. }
  43592. ,
  43593. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43594. constructor: n.CubicInterpolant,
  43595. DefaultSettings_: {
  43596. endingStart: n.ZeroCurvatureEnding,
  43597. endingEnd: n.ZeroCurvatureEnding
  43598. },
  43599. intervalChanged_: function(e, t, i) {
  43600. var r = this.parameterPositions
  43601. , o = e - 2
  43602. , a = e + 1
  43603. , s = r[o]
  43604. , l = r[a];
  43605. if (void 0 === s)
  43606. switch (this.getSettings_().endingStart) {
  43607. case n.ZeroSlopeEnding:
  43608. o = e,
  43609. s = 2 * t - i;
  43610. break;
  43611. case n.WrapAroundEnding:
  43612. o = r.length - 2,
  43613. s = t + r[o] - r[o + 1];
  43614. break;
  43615. default:
  43616. o = e,
  43617. s = i
  43618. }
  43619. if (void 0 === l)
  43620. switch (this.getSettings_().endingEnd) {
  43621. case n.ZeroSlopeEnding:
  43622. a = e,
  43623. l = 2 * i - t;
  43624. break;
  43625. case n.WrapAroundEnding:
  43626. a = 1,
  43627. l = i + r[1] - r[0];
  43628. break;
  43629. default:
  43630. a = e - 1,
  43631. l = t
  43632. }
  43633. var c = .5 * (i - t)
  43634. , h = this.valueSize;
  43635. this._weightPrev = c / (t - s),
  43636. this._weightNext = c / (l - i),
  43637. this._offsetPrev = o * h,
  43638. this._offsetNext = a * h
  43639. },
  43640. interpolate_: function(e, t, i, n) {
  43641. 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)
  43642. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43643. return r
  43644. }
  43645. }),
  43646. n.DiscreteInterpolant = function(e, t, i, r) {
  43647. n.Interpolant.call(this, e, t, i, r)
  43648. }
  43649. ,
  43650. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43651. constructor: n.DiscreteInterpolant,
  43652. interpolate_: function(e, t, i, n) {
  43653. return this.copySampleValue_(e - 1)
  43654. }
  43655. }),
  43656. n.LinearInterpolant = function(e, t, i, r) {
  43657. n.Interpolant.call(this, e, t, i, r)
  43658. }
  43659. ,
  43660. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43661. constructor: n.LinearInterpolant,
  43662. interpolate_: function(e, t, i, n) {
  43663. 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)
  43664. r[u] = o[l + u] * h + o[s + u] * c;
  43665. return r
  43666. }
  43667. }),
  43668. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43669. n.Interpolant.call(this, e, t, i, r)
  43670. }
  43671. ,
  43672. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43673. constructor: n.QuaternionLinearInterpolant,
  43674. interpolate_: function(e, t, i, r) {
  43675. 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)
  43676. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43677. return o
  43678. }
  43679. }),
  43680. n.Clock = function(e) {
  43681. this.autoStart = void 0 === e || e,
  43682. this.startTime = 0,
  43683. this.oldTime = 0,
  43684. this.elapsedTime = 0,
  43685. this.running = !1
  43686. }
  43687. ,
  43688. n.Clock.prototype = {
  43689. constructor: n.Clock,
  43690. start: function() {
  43691. this.startTime = performance.now(),
  43692. this.oldTime = this.startTime,
  43693. this.running = !0
  43694. },
  43695. stop: function() {
  43696. this.getElapsedTime(),
  43697. this.running = !1
  43698. },
  43699. getElapsedTime: function() {
  43700. return this.getDelta(),
  43701. this.elapsedTime
  43702. },
  43703. getDelta: function() {
  43704. var e = 0;
  43705. if (this.autoStart && !this.running && this.start(),
  43706. this.running) {
  43707. var t = performance.now();
  43708. e = .001 * (t - this.oldTime),
  43709. this.oldTime = t,
  43710. this.elapsedTime += e
  43711. }
  43712. return e
  43713. }
  43714. },
  43715. n.EventDispatcher = function() {}
  43716. ,
  43717. n.EventDispatcher.prototype = {
  43718. constructor: n.EventDispatcher,
  43719. apply: function(e) {
  43720. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43721. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43722. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43723. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43724. },
  43725. addEventListener: function(e, t) {
  43726. void 0 === this._listeners && (this._listeners = {});
  43727. var i = this._listeners;
  43728. void 0 === i[e] && (i[e] = []),
  43729. i[e].indexOf(t) === -1 && i[e].push(t)
  43730. },
  43731. hasEventListener: function(e, t) {
  43732. if (void 0 === this._listeners)
  43733. return !1;
  43734. var i = this._listeners;
  43735. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43736. },
  43737. removeEventListener: function(e, t) {
  43738. if (void 0 !== this._listeners) {
  43739. var i = this._listeners
  43740. , n = i[e];
  43741. if (void 0 !== n) {
  43742. var r = n.indexOf(t);
  43743. r !== -1 && n.splice(r, 1)
  43744. }
  43745. }
  43746. },
  43747. dispatchEvent: function(e) {
  43748. if (void 0 !== this._listeners) {
  43749. var t = this._listeners
  43750. , i = t[e.type];
  43751. if (void 0 !== i) {
  43752. e.target = this;
  43753. for (var n = [], r = i.length, o = 0; o < r; o++)
  43754. n[o] = i[o];
  43755. for (var o = 0; o < r; o++)
  43756. n[o].call(this, e)
  43757. }
  43758. }
  43759. }
  43760. },
  43761. n.Layers = function() {
  43762. this.mask = 1
  43763. }
  43764. ,
  43765. n.Layers.prototype = {
  43766. constructor: n.Layers,
  43767. set: function(e) {
  43768. this.mask = 1 << e
  43769. },
  43770. enable: function(e) {
  43771. this.mask |= 1 << e
  43772. },
  43773. toggle: function(e) {
  43774. this.mask ^= 1 << e
  43775. },
  43776. disable: function(e) {
  43777. this.mask &= ~(1 << e)
  43778. },
  43779. test: function(e) {
  43780. return 0 !== (this.mask & e.mask)
  43781. }
  43782. },
  43783. function(e) {
  43784. function t(e, t) {
  43785. return e.distance - t.distance
  43786. }
  43787. function i(e, t, n, r) {
  43788. if (e.visible !== !1 && (e.raycast(t, n),
  43789. r === !0))
  43790. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43791. i(o[a], t, n, !0)
  43792. }
  43793. e.Raycaster = function(t, i, n, r) {
  43794. this.ray = new e.Ray(t,i),
  43795. this.near = n || 0,
  43796. this.far = r || 1 / 0,
  43797. this.params = {
  43798. Mesh: {},
  43799. Line: {},
  43800. LOD: {},
  43801. Points: {
  43802. threshold: 1
  43803. },
  43804. Sprite: {}
  43805. },
  43806. Object.defineProperties(this.params, {
  43807. PointCloud: {
  43808. get: function() {
  43809. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43810. this.Points
  43811. }
  43812. }
  43813. })
  43814. }
  43815. ,
  43816. e.Raycaster.prototype = {
  43817. constructor: e.Raycaster,
  43818. linePrecision: 1,
  43819. set: function(e, t) {
  43820. this.ray.set(e, t)
  43821. },
  43822. setFromCamera: function(t, i) {
  43823. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43824. 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),
  43825. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43826. },
  43827. intersectObject: function(e, n) {
  43828. var r = [];
  43829. return i(e, this, r, n),
  43830. r.sort(t),
  43831. r
  43832. },
  43833. intersectObjects: function(e, n) {
  43834. var r = [];
  43835. if (Array.isArray(e) === !1)
  43836. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43837. r;
  43838. for (var o = 0, a = e.length; o < a; o++)
  43839. i(e[o], this, r, n);
  43840. return r.sort(t),
  43841. r
  43842. }
  43843. }
  43844. }(n),
  43845. n.Object3D = function() {
  43846. function e() {
  43847. o.setFromEuler(r, !1)
  43848. }
  43849. function t() {
  43850. r.setFromQuaternion(o, void 0, !1)
  43851. }
  43852. Object.defineProperty(this, "id", {
  43853. value: n.Object3DIdCount++
  43854. }),
  43855. this.uuid = n.Math.generateUUID(),
  43856. this.name = "",
  43857. this.type = "Object3D",
  43858. this.parent = null,
  43859. this.children = [],
  43860. this.up = n.Object3D.DefaultUp.clone();
  43861. var i = new n.Vector3
  43862. , r = new n.Euler
  43863. , o = new n.Quaternion
  43864. , a = new n.Vector3(1,1,1);
  43865. r.onChange(e),
  43866. o.onChange(t),
  43867. Object.defineProperties(this, {
  43868. position: {
  43869. enumerable: !0,
  43870. value: i
  43871. },
  43872. rotation: {
  43873. enumerable: !0,
  43874. value: r
  43875. },
  43876. quaternion: {
  43877. enumerable: !0,
  43878. value: o
  43879. },
  43880. scale: {
  43881. enumerable: !0,
  43882. value: a
  43883. },
  43884. modelViewMatrix: {
  43885. value: new n.Matrix4
  43886. },
  43887. normalMatrix: {
  43888. value: new n.Matrix3
  43889. }
  43890. }),
  43891. this.rotationAutoUpdate = !0,
  43892. this.matrix = new n.Matrix4,
  43893. this.matrixWorld = new n.Matrix4,
  43894. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43895. this.matrixWorldNeedsUpdate = !1,
  43896. this.layers = new n.Layers,
  43897. this.visible = !0,
  43898. this.castShadow = !1,
  43899. this.receiveShadow = !1,
  43900. this.frustumCulled = !0,
  43901. this.renderOrder = 0,
  43902. this.userData = {}
  43903. }
  43904. ,
  43905. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43906. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43907. n.Object3D.prototype = {
  43908. constructor: n.Object3D,
  43909. applyMatrix: function(e) {
  43910. this.matrix.multiplyMatrices(e, this.matrix),
  43911. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43912. },
  43913. setRotationFromAxisAngle: function(e, t) {
  43914. this.quaternion.setFromAxisAngle(e, t)
  43915. },
  43916. setRotationFromEuler: function(e) {
  43917. this.quaternion.setFromEuler(e, !0)
  43918. },
  43919. setRotationFromMatrix: function(e) {
  43920. this.quaternion.setFromRotationMatrix(e)
  43921. },
  43922. setRotationFromQuaternion: function(e) {
  43923. this.quaternion.copy(e)
  43924. },
  43925. rotateOnAxis: function() {
  43926. var e = new n.Quaternion;
  43927. return function(t, i) {
  43928. return e.setFromAxisAngle(t, i),
  43929. this.quaternion.multiply(e),
  43930. this
  43931. }
  43932. }(),
  43933. rotateX: function() {
  43934. var e = new n.Vector3(1,0,0);
  43935. return function(t) {
  43936. return this.rotateOnAxis(e, t)
  43937. }
  43938. }(),
  43939. rotateY: function() {
  43940. var e = new n.Vector3(0,1,0);
  43941. return function(t) {
  43942. return this.rotateOnAxis(e, t)
  43943. }
  43944. }(),
  43945. rotateZ: function() {
  43946. var e = new n.Vector3(0,0,1);
  43947. return function(t) {
  43948. return this.rotateOnAxis(e, t)
  43949. }
  43950. }(),
  43951. translateOnAxis: function() {
  43952. var e = new n.Vector3;
  43953. return function(t, i) {
  43954. return e.copy(t).applyQuaternion(this.quaternion),
  43955. this.position.add(e.multiplyScalar(i)),
  43956. this
  43957. }
  43958. }(),
  43959. translateX: function() {
  43960. var e = new n.Vector3(1,0,0);
  43961. return function(t) {
  43962. return this.translateOnAxis(e, t)
  43963. }
  43964. }(),
  43965. translateY: function() {
  43966. var e = new n.Vector3(0,1,0);
  43967. return function(t) {
  43968. return this.translateOnAxis(e, t)
  43969. }
  43970. }(),
  43971. translateZ: function() {
  43972. var e = new n.Vector3(0,0,1);
  43973. return function(t) {
  43974. return this.translateOnAxis(e, t)
  43975. }
  43976. }(),
  43977. localToWorld: function(e) {
  43978. return e.applyMatrix4(this.matrixWorld)
  43979. },
  43980. worldToLocal: function() {
  43981. var e = new n.Matrix4;
  43982. return function(t) {
  43983. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43984. }
  43985. }(),
  43986. lookAt: function() {
  43987. var e = new n.Matrix4;
  43988. return function(t) {
  43989. e.lookAt(t, this.position, this.up),
  43990. this.quaternion.setFromRotationMatrix(e)
  43991. }
  43992. }(),
  43993. add: function(e) {
  43994. if (arguments.length > 1) {
  43995. for (var t = 0; t < arguments.length; t++)
  43996. this.add(arguments[t]);
  43997. return this
  43998. }
  43999. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44000. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44001. e.parent = this,
  44002. e.dispatchEvent({
  44003. type: "added"
  44004. }),
  44005. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44006. this)
  44007. },
  44008. remove: function(e) {
  44009. if (arguments.length > 1)
  44010. for (var t = 0; t < arguments.length; t++)
  44011. this.remove(arguments[t]);
  44012. var i = this.children.indexOf(e);
  44013. i !== -1 && (e.parent = null,
  44014. e.dispatchEvent({
  44015. type: "removed"
  44016. }),
  44017. this.children.splice(i, 1))
  44018. },
  44019. getObjectById: function(e) {
  44020. return this.getObjectByProperty("id", e)
  44021. },
  44022. getObjectByName: function(e) {
  44023. return this.getObjectByProperty("name", e)
  44024. },
  44025. getObjectByProperty: function(e, t) {
  44026. if (this[e] === t)
  44027. return this;
  44028. for (var i = 0, n = this.children.length; i < n; i++) {
  44029. var r = this.children[i]
  44030. , o = r.getObjectByProperty(e, t);
  44031. if (void 0 !== o)
  44032. return o
  44033. }
  44034. },
  44035. getWorldPosition: function(e) {
  44036. var t = e || new n.Vector3;
  44037. return this.updateMatrixWorld(!0),
  44038. t.setFromMatrixPosition(this.matrixWorld)
  44039. },
  44040. getWorldQuaternion: function() {
  44041. var e = new n.Vector3
  44042. , t = new n.Vector3;
  44043. return function(i) {
  44044. var r = i || new n.Quaternion;
  44045. return this.updateMatrixWorld(!0),
  44046. this.matrixWorld.decompose(e, r, t),
  44047. r
  44048. }
  44049. }(),
  44050. getWorldRotation: function() {
  44051. var e = new n.Quaternion;
  44052. return function(t) {
  44053. var i = t || new n.Euler;
  44054. return this.getWorldQuaternion(e),
  44055. i.setFromQuaternion(e, this.rotation.order, !1)
  44056. }
  44057. }(),
  44058. getWorldScale: function() {
  44059. var e = new n.Vector3
  44060. , t = new n.Quaternion;
  44061. return function(i) {
  44062. var r = i || new n.Vector3;
  44063. return this.updateMatrixWorld(!0),
  44064. this.matrixWorld.decompose(e, t, r),
  44065. r
  44066. }
  44067. }(),
  44068. getWorldDirection: function() {
  44069. var e = new n.Quaternion;
  44070. return function(t) {
  44071. var i = t || new n.Vector3;
  44072. return this.getWorldQuaternion(e),
  44073. i.set(0, 0, 1).applyQuaternion(e)
  44074. }
  44075. }(),
  44076. raycast: function() {},
  44077. traverse: function(e) {
  44078. e(this);
  44079. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44080. t[i].traverse(e)
  44081. },
  44082. traverseVisible: function(e) {
  44083. if (this.visible !== !1) {
  44084. e(this);
  44085. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44086. t[i].traverseVisible(e)
  44087. }
  44088. },
  44089. traverseAncestors: function(e) {
  44090. var t = this.parent;
  44091. null !== t && (e(t),
  44092. t.traverseAncestors(e))
  44093. },
  44094. updateMatrix: function() {
  44095. this.matrix.compose(this.position, this.quaternion, this.scale),
  44096. this.matrixWorldNeedsUpdate = !0
  44097. },
  44098. updateMatrixWorld: function(e) {
  44099. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44100. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44101. this.matrixWorldNeedsUpdate = !1,
  44102. e = !0);
  44103. for (var t = 0, i = this.children.length; t < i; t++)
  44104. this.children[t].updateMatrixWorld(e)
  44105. },
  44106. toJSON: function(e) {
  44107. function t(e) {
  44108. var t = [];
  44109. for (var i in e) {
  44110. var n = e[i];
  44111. delete n.metadata,
  44112. t.push(n)
  44113. }
  44114. return t
  44115. }
  44116. var i = void 0 === e
  44117. , n = {};
  44118. i && (e = {
  44119. geometries: {},
  44120. materials: {},
  44121. textures: {},
  44122. images: {}
  44123. },
  44124. n.metadata = {
  44125. version: 4.4,
  44126. type: "Object",
  44127. generator: "Object3D.toJSON"
  44128. });
  44129. var r = {};
  44130. if (r.uuid = this.uuid,
  44131. r.type = this.type,
  44132. "" !== this.name && (r.name = this.name),
  44133. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44134. this.castShadow === !0 && (r.castShadow = !0),
  44135. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44136. this.visible === !1 && (r.visible = !1),
  44137. r.matrix = this.matrix.toArray(),
  44138. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44139. r.geometry = this.geometry.uuid),
  44140. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44141. r.material = this.material.uuid),
  44142. this.children.length > 0) {
  44143. r.children = [];
  44144. for (var o = 0; o < this.children.length; o++)
  44145. r.children.push(this.children[o].toJSON(e).object)
  44146. }
  44147. if (i) {
  44148. var a = t(e.geometries)
  44149. , s = t(e.materials)
  44150. , l = t(e.textures)
  44151. , c = t(e.images);
  44152. a.length > 0 && (n.geometries = a),
  44153. s.length > 0 && (n.materials = s),
  44154. l.length > 0 && (n.textures = l),
  44155. c.length > 0 && (n.images = c)
  44156. }
  44157. return n.object = r,
  44158. n
  44159. },
  44160. clone: function(e) {
  44161. return (new this.constructor).copy(this, e)
  44162. },
  44163. copy: function(e, t) {
  44164. if (void 0 === t && (t = !0),
  44165. this.name = e.name,
  44166. this.up.copy(e.up),
  44167. this.position.copy(e.position),
  44168. this.quaternion.copy(e.quaternion),
  44169. this.scale.copy(e.scale),
  44170. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44171. this.matrix.copy(e.matrix),
  44172. this.matrixWorld.copy(e.matrixWorld),
  44173. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44174. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44175. this.visible = e.visible,
  44176. this.castShadow = e.castShadow,
  44177. this.receiveShadow = e.receiveShadow,
  44178. this.frustumCulled = e.frustumCulled,
  44179. this.renderOrder = e.renderOrder,
  44180. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44181. t === !0)
  44182. for (var i = 0; i < e.children.length; i++) {
  44183. var n = e.children[i];
  44184. this.add(n.clone())
  44185. }
  44186. return this
  44187. }
  44188. },
  44189. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44190. n.Object3DIdCount = 0,
  44191. n.Face3 = function(e, t, i, r, o, a) {
  44192. this.a = e,
  44193. this.b = t,
  44194. this.c = i,
  44195. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44196. this.vertexNormals = Array.isArray(r) ? r : [],
  44197. this.color = o instanceof n.Color ? o : new n.Color,
  44198. this.vertexColors = Array.isArray(o) ? o : [],
  44199. this.materialIndex = void 0 !== a ? a : 0
  44200. }
  44201. ,
  44202. n.Face3.prototype = {
  44203. constructor: n.Face3,
  44204. clone: function() {
  44205. return (new this.constructor).copy(this)
  44206. },
  44207. copy: function(e) {
  44208. this.a = e.a,
  44209. this.b = e.b,
  44210. this.c = e.c,
  44211. this.normal.copy(e.normal),
  44212. this.color.copy(e.color),
  44213. this.materialIndex = e.materialIndex;
  44214. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44215. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44216. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44217. this.vertexColors[t] = e.vertexColors[t].clone();
  44218. return this
  44219. }
  44220. },
  44221. n.BufferAttribute = function(e, t) {
  44222. this.uuid = n.Math.generateUUID(),
  44223. this.array = e,
  44224. this.itemSize = t,
  44225. this.dynamic = !1,
  44226. this.updateRange = {
  44227. offset: 0,
  44228. count: -1
  44229. },
  44230. this.version = 0
  44231. }
  44232. ,
  44233. n.BufferAttribute.prototype = {
  44234. constructor: n.BufferAttribute,
  44235. get count() {
  44236. return this.array.length / this.itemSize
  44237. },
  44238. set needsUpdate(e) {
  44239. e === !0 && this.version++
  44240. },
  44241. setDynamic: function(e) {
  44242. return this.dynamic = e,
  44243. this
  44244. },
  44245. copy: function(e) {
  44246. return this.array = new e.array.constructor(e.array),
  44247. this.itemSize = e.itemSize,
  44248. this.dynamic = e.dynamic,
  44249. this
  44250. },
  44251. copyAt: function(e, t, i) {
  44252. e *= this.itemSize,
  44253. i *= t.itemSize;
  44254. for (var n = 0, r = this.itemSize; n < r; n++)
  44255. this.array[e + n] = t.array[i + n];
  44256. return this
  44257. },
  44258. copyArray: function(e) {
  44259. return this.array.set(e),
  44260. this
  44261. },
  44262. copyColorsArray: function(e) {
  44263. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44264. var a = e[r];
  44265. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44266. a = new n.Color),
  44267. t[i++] = a.r,
  44268. t[i++] = a.g,
  44269. t[i++] = a.b
  44270. }
  44271. return this
  44272. },
  44273. copyIndicesArray: function(e) {
  44274. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44275. var o = e[n];
  44276. t[i++] = o.a,
  44277. t[i++] = o.b,
  44278. t[i++] = o.c
  44279. }
  44280. return this
  44281. },
  44282. copyVector2sArray: function(e) {
  44283. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44284. var a = e[r];
  44285. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44286. a = new n.Vector2),
  44287. t[i++] = a.x,
  44288. t[i++] = a.y
  44289. }
  44290. return this
  44291. },
  44292. copyVector3sArray: function(e) {
  44293. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44294. var a = e[r];
  44295. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44296. a = new n.Vector3),
  44297. t[i++] = a.x,
  44298. t[i++] = a.y,
  44299. t[i++] = a.z
  44300. }
  44301. return this
  44302. },
  44303. copyVector4sArray: function(e) {
  44304. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44305. var a = e[r];
  44306. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44307. a = new n.Vector4),
  44308. t[i++] = a.x,
  44309. t[i++] = a.y,
  44310. t[i++] = a.z,
  44311. t[i++] = a.w
  44312. }
  44313. return this
  44314. },
  44315. set: function(e, t) {
  44316. return void 0 === t && (t = 0),
  44317. this.array.set(e, t),
  44318. this
  44319. },
  44320. getX: function(e) {
  44321. return this.array[e * this.itemSize]
  44322. },
  44323. setX: function(e, t) {
  44324. return this.array[e * this.itemSize] = t,
  44325. this
  44326. },
  44327. getY: function(e) {
  44328. return this.array[e * this.itemSize + 1]
  44329. },
  44330. setY: function(e, t) {
  44331. return this.array[e * this.itemSize + 1] = t,
  44332. this
  44333. },
  44334. getZ: function(e) {
  44335. return this.array[e * this.itemSize + 2]
  44336. },
  44337. setZ: function(e, t) {
  44338. return this.array[e * this.itemSize + 2] = t,
  44339. this
  44340. },
  44341. getW: function(e) {
  44342. return this.array[e * this.itemSize + 3]
  44343. },
  44344. setW: function(e, t) {
  44345. return this.array[e * this.itemSize + 3] = t,
  44346. this
  44347. },
  44348. setXY: function(e, t, i) {
  44349. return e *= this.itemSize,
  44350. this.array[e + 0] = t,
  44351. this.array[e + 1] = i,
  44352. this
  44353. },
  44354. setXYZ: function(e, t, i, n) {
  44355. return e *= this.itemSize,
  44356. this.array[e + 0] = t,
  44357. this.array[e + 1] = i,
  44358. this.array[e + 2] = n,
  44359. this
  44360. },
  44361. setXYZW: function(e, t, i, n, r) {
  44362. return e *= this.itemSize,
  44363. this.array[e + 0] = t,
  44364. this.array[e + 1] = i,
  44365. this.array[e + 2] = n,
  44366. this.array[e + 3] = r,
  44367. this
  44368. },
  44369. clone: function() {
  44370. return (new this.constructor).copy(this)
  44371. }
  44372. },
  44373. n.Int8Attribute = function(e, t) {
  44374. return new n.BufferAttribute(new Int8Array(e),t)
  44375. }
  44376. ,
  44377. n.Uint8Attribute = function(e, t) {
  44378. return new n.BufferAttribute(new Uint8Array(e),t)
  44379. }
  44380. ,
  44381. n.Uint8ClampedAttribute = function(e, t) {
  44382. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44383. }
  44384. ,
  44385. n.Int16Attribute = function(e, t) {
  44386. return new n.BufferAttribute(new Int16Array(e),t)
  44387. }
  44388. ,
  44389. n.Uint16Attribute = function(e, t) {
  44390. return new n.BufferAttribute(new Uint16Array(e),t)
  44391. }
  44392. ;
  44393. n.Int32Attribute = function(e, t) {
  44394. return new n.BufferAttribute(new Int32Array(e),t)
  44395. }
  44396. ;
  44397. n.Uint32Attribute = function(e, t) {
  44398. return new n.BufferAttribute(new Uint32Array(e),t)
  44399. }
  44400. ,
  44401. n.Float32Attribute = function(e, t) {
  44402. return new n.BufferAttribute(new Float32Array(e),t)
  44403. }
  44404. ,
  44405. n.Float64Attribute = function(e, t) {
  44406. return new n.BufferAttribute(new Float64Array(e),t)
  44407. }
  44408. ,
  44409. n.DynamicBufferAttribute = function(e, t) {
  44410. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44411. new n.BufferAttribute(e,t).setDynamic(!0)
  44412. }
  44413. ,
  44414. n.InstancedBufferAttribute = function(e, t, i) {
  44415. n.BufferAttribute.call(this, e, t),
  44416. this.meshPerAttribute = i || 1
  44417. }
  44418. ,
  44419. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44420. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44421. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44422. return n.BufferAttribute.prototype.copy.call(this, e),
  44423. this.meshPerAttribute = e.meshPerAttribute,
  44424. this
  44425. }
  44426. ,
  44427. n.InterleavedBuffer = function(e, t) {
  44428. this.uuid = n.Math.generateUUID(),
  44429. this.array = e,
  44430. this.stride = t,
  44431. this.dynamic = !1,
  44432. this.updateRange = {
  44433. offset: 0,
  44434. count: -1
  44435. },
  44436. this.version = 0
  44437. }
  44438. ,
  44439. n.InterleavedBuffer.prototype = {
  44440. constructor: n.InterleavedBuffer,
  44441. get length() {
  44442. return this.array.length
  44443. },
  44444. get count() {
  44445. return this.array.length / this.stride
  44446. },
  44447. set needsUpdate(e) {
  44448. e === !0 && this.version++
  44449. },
  44450. setDynamic: function(e) {
  44451. return this.dynamic = e,
  44452. this
  44453. },
  44454. copy: function(e) {
  44455. return this.array = new e.array.constructor(e.array),
  44456. this.stride = e.stride,
  44457. this.dynamic = e.dynamic,
  44458. this
  44459. },
  44460. copyAt: function(e, t, i) {
  44461. e *= this.stride,
  44462. i *= t.stride;
  44463. for (var n = 0, r = this.stride; n < r; n++)
  44464. this.array[e + n] = t.array[i + n];
  44465. return this
  44466. },
  44467. set: function(e, t) {
  44468. return void 0 === t && (t = 0),
  44469. this.array.set(e, t),
  44470. this
  44471. },
  44472. clone: function() {
  44473. return (new this.constructor).copy(this)
  44474. }
  44475. },
  44476. n.InstancedInterleavedBuffer = function(e, t, i) {
  44477. n.InterleavedBuffer.call(this, e, t),
  44478. this.meshPerAttribute = i || 1
  44479. }
  44480. ,
  44481. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44482. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44483. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44484. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44485. this.meshPerAttribute = e.meshPerAttribute,
  44486. this
  44487. }
  44488. ,
  44489. n.InterleavedBufferAttribute = function(e, t, i) {
  44490. this.uuid = n.Math.generateUUID(),
  44491. this.data = e,
  44492. this.itemSize = t,
  44493. this.offset = i
  44494. }
  44495. ,
  44496. n.InterleavedBufferAttribute.prototype = {
  44497. constructor: n.InterleavedBufferAttribute,
  44498. get length() {
  44499. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44500. this.array.length
  44501. },
  44502. get count() {
  44503. return this.data.count
  44504. },
  44505. setX: function(e, t) {
  44506. return this.data.array[e * this.data.stride + this.offset] = t,
  44507. this
  44508. },
  44509. setY: function(e, t) {
  44510. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44511. this
  44512. },
  44513. setZ: function(e, t) {
  44514. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44515. this
  44516. },
  44517. setW: function(e, t) {
  44518. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44519. this
  44520. },
  44521. getX: function(e) {
  44522. return this.data.array[e * this.data.stride + this.offset]
  44523. },
  44524. getY: function(e) {
  44525. return this.data.array[e * this.data.stride + this.offset + 1]
  44526. },
  44527. getZ: function(e) {
  44528. return this.data.array[e * this.data.stride + this.offset + 2]
  44529. },
  44530. getW: function(e) {
  44531. return this.data.array[e * this.data.stride + this.offset + 3]
  44532. },
  44533. setXY: function(e, t, i) {
  44534. return e = e * this.data.stride + this.offset,
  44535. this.data.array[e + 0] = t,
  44536. this.data.array[e + 1] = i,
  44537. this
  44538. },
  44539. setXYZ: function(e, t, i, n) {
  44540. return e = e * this.data.stride + this.offset,
  44541. this.data.array[e + 0] = t,
  44542. this.data.array[e + 1] = i,
  44543. this.data.array[e + 2] = n,
  44544. this
  44545. },
  44546. setXYZW: function(e, t, i, n, r) {
  44547. return e = e * this.data.stride + this.offset,
  44548. this.data.array[e + 0] = t,
  44549. this.data.array[e + 1] = i,
  44550. this.data.array[e + 2] = n,
  44551. this.data.array[e + 3] = r,
  44552. this
  44553. }
  44554. },
  44555. n.Geometry = function() {
  44556. Object.defineProperty(this, "id", {
  44557. value: n.GeometryIdCount++
  44558. }),
  44559. this.uuid = n.Math.generateUUID(),
  44560. this.name = "",
  44561. this.type = "Geometry",
  44562. this.vertices = [],
  44563. this.colors = [],
  44564. this.faces = [],
  44565. this.faceVertexUvs = [[]],
  44566. this.morphTargets = [],
  44567. this.morphNormals = [],
  44568. this.skinWeights = [],
  44569. this.skinIndices = [],
  44570. this.lineDistances = [],
  44571. this.boundingBox = null,
  44572. this.boundingSphere = null,
  44573. this.verticesNeedUpdate = !1,
  44574. this.elementsNeedUpdate = !1,
  44575. this.uvsNeedUpdate = !1,
  44576. this.normalsNeedUpdate = !1,
  44577. this.colorsNeedUpdate = !1,
  44578. this.lineDistancesNeedUpdate = !1,
  44579. this.groupsNeedUpdate = !1
  44580. }
  44581. ,
  44582. n.Geometry.prototype = {
  44583. constructor: n.Geometry,
  44584. applyMatrix: function(e) {
  44585. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44586. var o = this.vertices[i];
  44587. o.applyMatrix4(e)
  44588. }
  44589. for (var i = 0, r = this.faces.length; i < r; i++) {
  44590. var a = this.faces[i];
  44591. a.normal.applyMatrix3(t).normalize();
  44592. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44593. a.vertexNormals[s].applyMatrix3(t).normalize()
  44594. }
  44595. return null !== this.boundingBox && this.computeBoundingBox(),
  44596. null !== this.boundingSphere && this.computeBoundingSphere(),
  44597. this.verticesNeedUpdate = !0,
  44598. this.normalsNeedUpdate = !0,
  44599. this
  44600. },
  44601. rotateX: function() {
  44602. var e;
  44603. return function(t) {
  44604. return void 0 === e && (e = new n.Matrix4),
  44605. e.makeRotationX(t),
  44606. this.applyMatrix(e),
  44607. this
  44608. }
  44609. }(),
  44610. rotateY: function() {
  44611. var e;
  44612. return function(t) {
  44613. return void 0 === e && (e = new n.Matrix4),
  44614. e.makeRotationY(t),
  44615. this.applyMatrix(e),
  44616. this
  44617. }
  44618. }(),
  44619. rotateZ: function() {
  44620. var e;
  44621. return function(t) {
  44622. return void 0 === e && (e = new n.Matrix4),
  44623. e.makeRotationZ(t),
  44624. this.applyMatrix(e),
  44625. this
  44626. }
  44627. }(),
  44628. translate: function() {
  44629. var e;
  44630. return function(t, i, r) {
  44631. return void 0 === e && (e = new n.Matrix4),
  44632. e.makeTranslation(t, i, r),
  44633. this.applyMatrix(e),
  44634. this
  44635. }
  44636. }(),
  44637. scale: function() {
  44638. var e;
  44639. return function(t, i, r) {
  44640. return void 0 === e && (e = new n.Matrix4),
  44641. e.makeScale(t, i, r),
  44642. this.applyMatrix(e),
  44643. this
  44644. }
  44645. }(),
  44646. lookAt: function() {
  44647. var e;
  44648. return function(t) {
  44649. void 0 === e && (e = new n.Object3D),
  44650. e.lookAt(t),
  44651. e.updateMatrix(),
  44652. this.applyMatrix(e.matrix)
  44653. }
  44654. }(),
  44655. fromBufferGeometry: function(e) {
  44656. function t(e, t, r, o) {
  44657. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44658. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44659. , g = new n.Face3(e,t,r,a,f,o);
  44660. i.faces.push(g),
  44661. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44662. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44663. }
  44664. var i = this
  44665. , r = null !== e.index ? e.index.array : void 0
  44666. , o = e.attributes
  44667. , a = o.position.array
  44668. , s = void 0 !== o.normal ? o.normal.array : void 0
  44669. , l = void 0 !== o.color ? o.color.array : void 0
  44670. , c = void 0 !== o.uv ? o.uv.array : void 0
  44671. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44672. void 0 !== h && (this.faceVertexUvs[1] = []);
  44673. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44674. g += 2)
  44675. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44676. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44677. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44678. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44679. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44680. if (void 0 !== r) {
  44681. var m = e.groups;
  44682. if (m.length > 0)
  44683. for (var f = 0; f < m.length; f++)
  44684. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44685. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44686. else
  44687. for (var f = 0; f < r.length; f += 3)
  44688. t(r[f], r[f + 1], r[f + 2])
  44689. } else
  44690. for (var f = 0; f < a.length / 3; f += 3)
  44691. t(f, f + 1, f + 2);
  44692. return this.computeFaceNormals(),
  44693. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44694. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44695. this
  44696. },
  44697. center: function() {
  44698. this.computeBoundingBox();
  44699. var e = this.boundingBox.center().negate();
  44700. return this.translate(e.x, e.y, e.z),
  44701. e
  44702. },
  44703. normalize: function() {
  44704. this.computeBoundingSphere();
  44705. var e = this.boundingSphere.center
  44706. , t = this.boundingSphere.radius
  44707. , i = 0 === t ? 1 : 1 / t
  44708. , r = new n.Matrix4;
  44709. 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),
  44710. this.applyMatrix(r),
  44711. this
  44712. },
  44713. computeFaceNormals: function() {
  44714. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44715. var o = this.faces[i]
  44716. , a = this.vertices[o.a]
  44717. , s = this.vertices[o.b]
  44718. , l = this.vertices[o.c];
  44719. e.subVectors(l, s),
  44720. t.subVectors(a, s),
  44721. e.cross(t),
  44722. e.normalize(),
  44723. o.normal.copy(e)
  44724. }
  44725. },
  44726. computeVertexNormals: function(e) {
  44727. void 0 === e && (e = !0);
  44728. var t, i, r, o, a, s;
  44729. for (s = new Array(this.vertices.length),
  44730. t = 0,
  44731. i = this.vertices.length; t < i; t++)
  44732. s[t] = new n.Vector3;
  44733. if (e) {
  44734. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44735. for (r = 0,
  44736. o = this.faces.length; r < o; r++)
  44737. a = this.faces[r],
  44738. l = this.vertices[a.a],
  44739. c = this.vertices[a.b],
  44740. h = this.vertices[a.c],
  44741. u.subVectors(h, c),
  44742. d.subVectors(l, c),
  44743. u.cross(d),
  44744. s[a.a].add(u),
  44745. s[a.b].add(u),
  44746. s[a.c].add(u)
  44747. } else
  44748. for (r = 0,
  44749. o = this.faces.length; r < o; r++)
  44750. a = this.faces[r],
  44751. s[a.a].add(a.normal),
  44752. s[a.b].add(a.normal),
  44753. s[a.c].add(a.normal);
  44754. for (t = 0,
  44755. i = this.vertices.length; t < i; t++)
  44756. s[t].normalize();
  44757. for (r = 0,
  44758. o = this.faces.length; r < o; r++) {
  44759. a = this.faces[r];
  44760. var p = a.vertexNormals;
  44761. 3 === p.length ? (p[0].copy(s[a.a]),
  44762. p[1].copy(s[a.b]),
  44763. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44764. p[1] = s[a.b].clone(),
  44765. p[2] = s[a.c].clone())
  44766. }
  44767. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44768. },
  44769. computeMorphNormals: function() {
  44770. var e, t, i, r, o;
  44771. for (i = 0,
  44772. r = this.faces.length; i < r; i++)
  44773. for (o = this.faces[i],
  44774. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44775. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44776. e = 0,
  44777. t = o.vertexNormals.length; e < t; e++)
  44778. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44779. var a = new n.Geometry;
  44780. for (a.faces = this.faces,
  44781. e = 0,
  44782. t = this.morphTargets.length; e < t; e++) {
  44783. if (!this.morphNormals[e]) {
  44784. this.morphNormals[e] = {},
  44785. this.morphNormals[e].faceNormals = [],
  44786. this.morphNormals[e].vertexNormals = [];
  44787. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44788. for (i = 0,
  44789. r = this.faces.length; i < r; i++)
  44790. s = new n.Vector3,
  44791. l = {
  44792. a: new n.Vector3,
  44793. b: new n.Vector3,
  44794. c: new n.Vector3
  44795. },
  44796. c.push(s),
  44797. h.push(l)
  44798. }
  44799. var u = this.morphNormals[e];
  44800. a.vertices = this.morphTargets[e].vertices,
  44801. a.computeFaceNormals(),
  44802. a.computeVertexNormals();
  44803. var s, l;
  44804. for (i = 0,
  44805. r = this.faces.length; i < r; i++)
  44806. o = this.faces[i],
  44807. s = u.faceNormals[i],
  44808. l = u.vertexNormals[i],
  44809. s.copy(o.normal),
  44810. l.a.copy(o.vertexNormals[0]),
  44811. l.b.copy(o.vertexNormals[1]),
  44812. l.c.copy(o.vertexNormals[2])
  44813. }
  44814. for (i = 0,
  44815. r = this.faces.length; i < r; i++)
  44816. o = this.faces[i],
  44817. o.normal = o.__originalFaceNormal,
  44818. o.vertexNormals = o.__originalVertexNormals
  44819. },
  44820. computeTangents: function() {
  44821. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44822. },
  44823. computeLineDistances: function() {
  44824. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44825. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44826. this.lineDistances[i] = e
  44827. },
  44828. computeBoundingBox: function() {
  44829. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44830. this.boundingBox.setFromPoints(this.vertices)
  44831. },
  44832. computeBoundingSphere: function() {
  44833. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44834. this.boundingSphere.setFromPoints(this.vertices)
  44835. },
  44836. merge: function(e, t, i) {
  44837. if (e instanceof n.Geometry == !1)
  44838. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44839. 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];
  44840. void 0 === i && (i = 0),
  44841. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44842. for (var d = 0, p = s.length; d < p; d++) {
  44843. var f = s[d]
  44844. , g = f.clone();
  44845. void 0 !== t && g.applyMatrix4(t),
  44846. a.push(g)
  44847. }
  44848. for (d = 0,
  44849. p = c.length; d < p; d++) {
  44850. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44851. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44852. m.normal.copy(y.normal),
  44853. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44854. for (var E = 0, b = C.length; E < b; E++)
  44855. v = C[E].clone(),
  44856. void 0 !== r && v.applyMatrix3(r).normalize(),
  44857. m.vertexNormals.push(v);
  44858. m.color.copy(y.color);
  44859. for (var E = 0, b = I.length; E < b; E++)
  44860. A = I[E],
  44861. m.vertexColors.push(A.clone());
  44862. m.materialIndex = y.materialIndex + i,
  44863. l.push(m)
  44864. }
  44865. for (d = 0,
  44866. p = u.length; d < p; d++) {
  44867. var w = u[d]
  44868. , _ = [];
  44869. if (void 0 !== w) {
  44870. for (var E = 0, b = w.length; E < b; E++)
  44871. _.push(w[E].clone());
  44872. h.push(_)
  44873. }
  44874. }
  44875. },
  44876. mergeMesh: function(e) {
  44877. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44878. void this.merge(e.geometry, e.matrix))
  44879. },
  44880. mergeVertices: function() {
  44881. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44882. for (i = 0,
  44883. n = this.vertices.length; i < n; i++)
  44884. e = this.vertices[i],
  44885. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44886. void 0 === l[t] ? (l[t] = i,
  44887. c.push(this.vertices[i]),
  44888. h[i] = c.length - 1) : h[i] = h[l[t]];
  44889. var p = [];
  44890. for (i = 0,
  44891. n = this.faces.length; i < n; i++) {
  44892. r = this.faces[i],
  44893. r.a = h[r.a],
  44894. r.b = h[r.b],
  44895. r.c = h[r.c],
  44896. o = [r.a, r.b, r.c];
  44897. for (var f = -1, g = 0; g < 3; g++)
  44898. if (o[g] === o[(g + 1) % 3]) {
  44899. f = g,
  44900. p.push(i);
  44901. break
  44902. }
  44903. }
  44904. for (i = p.length - 1; i >= 0; i--) {
  44905. var m = p[i];
  44906. for (this.faces.splice(m, 1),
  44907. a = 0,
  44908. s = this.faceVertexUvs.length; a < s; a++)
  44909. this.faceVertexUvs[a].splice(m, 1)
  44910. }
  44911. var v = this.vertices.length - c.length;
  44912. return this.vertices = c,
  44913. v
  44914. },
  44915. sortFacesByMaterialIndex: function() {
  44916. function e(e, t) {
  44917. return e.materialIndex - t.materialIndex
  44918. }
  44919. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44920. t[n]._id = n;
  44921. t.sort(e);
  44922. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44923. a && a.length === i && (r = []),
  44924. s && s.length === i && (o = []);
  44925. for (var n = 0; n < i; n++) {
  44926. var l = t[n]._id;
  44927. r && r.push(a[l]),
  44928. o && o.push(s[l])
  44929. }
  44930. r && (this.faceVertexUvs[0] = r),
  44931. o && (this.faceVertexUvs[1] = o)
  44932. },
  44933. toJSON: function() {
  44934. function e(e, t, i) {
  44935. return i ? e | 1 << t : e & ~(1 << t)
  44936. }
  44937. function t(e) {
  44938. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44939. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44940. u.push(e.x, e.y, e.z),
  44941. d[t])
  44942. }
  44943. function i(e) {
  44944. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44945. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44946. p.push(e.getHex()),
  44947. f[t])
  44948. }
  44949. function n(e) {
  44950. var t = e.x.toString() + e.y.toString();
  44951. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44952. g.push(e.x, e.y),
  44953. m[t])
  44954. }
  44955. var r = {
  44956. metadata: {
  44957. version: 4.4,
  44958. type: "Geometry",
  44959. generator: "Geometry.toJSON"
  44960. }
  44961. };
  44962. if (r.uuid = this.uuid,
  44963. r.type = this.type,
  44964. "" !== this.name && (r.name = this.name),
  44965. void 0 !== this.parameters) {
  44966. var o = this.parameters;
  44967. for (var a in o)
  44968. void 0 !== o[a] && (r[a] = o[a]);
  44969. return r
  44970. }
  44971. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44972. var c = this.vertices[l];
  44973. s.push(c.x, c.y, c.z)
  44974. }
  44975. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44976. var v = this.faces[l]
  44977. , A = !0
  44978. , y = !1
  44979. , C = void 0 !== this.faceVertexUvs[0][l]
  44980. , I = v.normal.length() > 0
  44981. , E = v.vertexNormals.length > 0
  44982. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44983. , w = v.vertexColors.length > 0
  44984. , _ = 0;
  44985. if (_ = e(_, 0, 0),
  44986. _ = e(_, 1, A),
  44987. _ = e(_, 2, y),
  44988. _ = e(_, 3, C),
  44989. _ = e(_, 4, I),
  44990. _ = e(_, 5, E),
  44991. _ = e(_, 6, b),
  44992. _ = e(_, 7, w),
  44993. h.push(_),
  44994. h.push(v.a, v.b, v.c),
  44995. h.push(v.materialIndex),
  44996. C) {
  44997. var T = this.faceVertexUvs[0][l];
  44998. h.push(n(T[0]), n(T[1]), n(T[2]))
  44999. }
  45000. if (I && h.push(t(v.normal)),
  45001. E) {
  45002. var x = v.vertexNormals;
  45003. h.push(t(x[0]), t(x[1]), t(x[2]))
  45004. }
  45005. if (b && h.push(i(v.color)),
  45006. w) {
  45007. var S = v.vertexColors;
  45008. h.push(i(S[0]), i(S[1]), i(S[2]))
  45009. }
  45010. }
  45011. return r.data = {},
  45012. r.data.vertices = s,
  45013. r.data.normals = u,
  45014. p.length > 0 && (r.data.colors = p),
  45015. g.length > 0 && (r.data.uvs = [g]),
  45016. r.data.faces = h,
  45017. r
  45018. },
  45019. clone: function() {
  45020. return (new n.Geometry).copy(this)
  45021. },
  45022. copy: function(e) {
  45023. this.vertices = [],
  45024. this.faces = [],
  45025. this.faceVertexUvs = [[]];
  45026. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45027. this.vertices.push(t[i].clone());
  45028. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45029. this.faces.push(r[i].clone());
  45030. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45031. var o = e.faceVertexUvs[i];
  45032. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45033. for (var a = 0, s = o.length; a < s; a++) {
  45034. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45035. var d = l[h];
  45036. c.push(d.clone())
  45037. }
  45038. this.faceVertexUvs[i].push(c)
  45039. }
  45040. }
  45041. return this
  45042. },
  45043. dispose: function() {
  45044. this.dispatchEvent({
  45045. type: "dispose"
  45046. })
  45047. }
  45048. },
  45049. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45050. n.GeometryIdCount = 0,
  45051. n.DirectGeometry = function() {
  45052. Object.defineProperty(this, "id", {
  45053. value: n.GeometryIdCount++
  45054. }),
  45055. this.uuid = n.Math.generateUUID(),
  45056. this.name = "",
  45057. this.type = "DirectGeometry",
  45058. this.indices = [],
  45059. this.vertices = [],
  45060. this.normals = [],
  45061. this.colors = [],
  45062. this.uvs = [],
  45063. this.uvs2 = [],
  45064. this.groups = [],
  45065. this.morphTargets = {},
  45066. this.skinWeights = [],
  45067. this.skinIndices = [],
  45068. this.boundingBox = null,
  45069. this.boundingSphere = null,
  45070. this.verticesNeedUpdate = !1,
  45071. this.normalsNeedUpdate = !1,
  45072. this.colorsNeedUpdate = !1,
  45073. this.uvsNeedUpdate = !1,
  45074. this.groupsNeedUpdate = !1
  45075. }
  45076. ,
  45077. n.DirectGeometry.prototype = {
  45078. constructor: n.DirectGeometry,
  45079. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45080. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45081. computeFaceNormals: function() {
  45082. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45083. },
  45084. computeVertexNormals: function() {
  45085. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45086. },
  45087. computeGroups: function(e) {
  45088. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45089. var a = r[o];
  45090. a.materialIndex !== i && (i = a.materialIndex,
  45091. void 0 !== t && (t.count = 3 * o - t.start,
  45092. n.push(t)),
  45093. t = {
  45094. start: 3 * o,
  45095. materialIndex: i
  45096. })
  45097. }
  45098. void 0 !== t && (t.count = 3 * o - t.start,
  45099. n.push(t)),
  45100. this.groups = n
  45101. },
  45102. fromGeometry: function(e) {
  45103. 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;
  45104. if (c > 0) {
  45105. t = [];
  45106. for (var h = 0; h < c; h++)
  45107. t[h] = [];
  45108. this.morphTargets.position = t
  45109. }
  45110. var u, d = e.morphNormals, p = d.length;
  45111. if (p > 0) {
  45112. u = [];
  45113. for (var h = 0; h < p; h++)
  45114. u[h] = [];
  45115. this.morphTargets.normal = u
  45116. }
  45117. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45118. var A = i[h];
  45119. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45120. var y = A.vertexNormals;
  45121. if (3 === y.length)
  45122. this.normals.push(y[0], y[1], y[2]);
  45123. else {
  45124. var C = A.normal;
  45125. this.normals.push(C, C, C)
  45126. }
  45127. var I = A.vertexColors;
  45128. if (3 === I.length)
  45129. this.colors.push(I[0], I[1], I[2]);
  45130. else {
  45131. var E = A.color;
  45132. this.colors.push(E, E, E)
  45133. }
  45134. if (a === !0) {
  45135. var b = o[0][h];
  45136. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45137. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45138. }
  45139. if (s === !0) {
  45140. var b = o[1][h];
  45141. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45142. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45143. }
  45144. for (var w = 0; w < c; w++) {
  45145. var _ = l[w].vertices;
  45146. t[w].push(_[A.a], _[A.b], _[A.c])
  45147. }
  45148. for (var w = 0; w < p; w++) {
  45149. var T = d[w].vertexNormals[h];
  45150. u[w].push(T.a, T.b, T.c)
  45151. }
  45152. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45153. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45154. }
  45155. return this.computeGroups(e),
  45156. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45157. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45158. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45159. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45160. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45161. this
  45162. },
  45163. dispose: function() {
  45164. this.dispatchEvent({
  45165. type: "dispose"
  45166. })
  45167. }
  45168. },
  45169. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45170. n.BufferGeometry = function() {
  45171. Object.defineProperty(this, "id", {
  45172. value: n.GeometryIdCount++
  45173. }),
  45174. this.uuid = n.Math.generateUUID(),
  45175. this.name = "",
  45176. this.type = "BufferGeometry",
  45177. this.index = null,
  45178. this.attributes = {},
  45179. this.morphAttributes = {},
  45180. this.groups = [],
  45181. this.boundingBox = null,
  45182. this.boundingSphere = null,
  45183. this.drawRange = {
  45184. start: 0,
  45185. count: 1 / 0
  45186. }
  45187. }
  45188. ,
  45189. n.BufferGeometry.prototype = {
  45190. constructor: n.BufferGeometry,
  45191. getIndex: function() {
  45192. return this.index
  45193. },
  45194. setIndex: function(e) {
  45195. this.index = e
  45196. },
  45197. addAttribute: function(e, t) {
  45198. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45199. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45200. void this.setIndex(t)) : (this.attributes[e] = t,
  45201. this)
  45202. },
  45203. getAttribute: function(e) {
  45204. return this.attributes[e]
  45205. },
  45206. removeAttribute: function(e) {
  45207. return delete this.attributes[e],
  45208. this
  45209. },
  45210. addGroup: function(e, t, i) {
  45211. this.groups.push({
  45212. start: e,
  45213. count: t,
  45214. materialIndex: void 0 !== i ? i : 0
  45215. })
  45216. },
  45217. clearGroups: function() {
  45218. this.groups = []
  45219. },
  45220. setDrawRange: function(e, t) {
  45221. this.drawRange.start = e,
  45222. this.drawRange.count = t
  45223. },
  45224. applyMatrix: function(e) {
  45225. var t = this.attributes.position;
  45226. void 0 !== t && (e.applyToVector3Array(t.array),
  45227. t.needsUpdate = !0);
  45228. var i = this.attributes.normal;
  45229. if (void 0 !== i) {
  45230. var r = (new n.Matrix3).getNormalMatrix(e);
  45231. r.applyToVector3Array(i.array),
  45232. i.needsUpdate = !0
  45233. }
  45234. return null !== this.boundingBox && this.computeBoundingBox(),
  45235. null !== this.boundingSphere && this.computeBoundingSphere(),
  45236. this
  45237. },
  45238. rotateX: function() {
  45239. var e;
  45240. return function(t) {
  45241. return void 0 === e && (e = new n.Matrix4),
  45242. e.makeRotationX(t),
  45243. this.applyMatrix(e),
  45244. this
  45245. }
  45246. }(),
  45247. rotateY: function() {
  45248. var e;
  45249. return function(t) {
  45250. return void 0 === e && (e = new n.Matrix4),
  45251. e.makeRotationY(t),
  45252. this.applyMatrix(e),
  45253. this
  45254. }
  45255. }(),
  45256. rotateZ: function() {
  45257. var e;
  45258. return function(t) {
  45259. return void 0 === e && (e = new n.Matrix4),
  45260. e.makeRotationZ(t),
  45261. this.applyMatrix(e),
  45262. this
  45263. }
  45264. }(),
  45265. translate: function() {
  45266. var e;
  45267. return function(t, i, r) {
  45268. return void 0 === e && (e = new n.Matrix4),
  45269. e.makeTranslation(t, i, r),
  45270. this.applyMatrix(e),
  45271. this
  45272. }
  45273. }(),
  45274. scale: function() {
  45275. var e;
  45276. return function(t, i, r) {
  45277. return void 0 === e && (e = new n.Matrix4),
  45278. e.makeScale(t, i, r),
  45279. this.applyMatrix(e),
  45280. this
  45281. }
  45282. }(),
  45283. lookAt: function() {
  45284. var e;
  45285. return function(t) {
  45286. void 0 === e && (e = new n.Object3D),
  45287. e.lookAt(t),
  45288. e.updateMatrix(),
  45289. this.applyMatrix(e.matrix)
  45290. }
  45291. }(),
  45292. center: function() {
  45293. this.computeBoundingBox();
  45294. var e = this.boundingBox.center().negate();
  45295. return this.translate(e.x, e.y, e.z),
  45296. e
  45297. },
  45298. setFromObject: function(e) {
  45299. var t = e.geometry;
  45300. if (e instanceof n.Points || e instanceof n.Line) {
  45301. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45302. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45303. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45304. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45305. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45306. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45307. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45308. }
  45309. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45310. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45311. } else
  45312. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45313. return this
  45314. },
  45315. updateFromObject: function(e) {
  45316. var t = e.geometry;
  45317. if (e instanceof n.Mesh) {
  45318. var i = t.__directGeometry;
  45319. if (void 0 === i)
  45320. return this.fromGeometry(t);
  45321. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45322. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45323. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45324. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45325. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45326. t.verticesNeedUpdate = !1,
  45327. t.normalsNeedUpdate = !1,
  45328. t.colorsNeedUpdate = !1,
  45329. t.uvsNeedUpdate = !1,
  45330. t.groupsNeedUpdate = !1,
  45331. t = i
  45332. }
  45333. if (t.verticesNeedUpdate === !0) {
  45334. var r = this.attributes.position;
  45335. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45336. r.needsUpdate = !0),
  45337. t.verticesNeedUpdate = !1
  45338. }
  45339. if (t.normalsNeedUpdate === !0) {
  45340. var r = this.attributes.normal;
  45341. void 0 !== r && (r.copyVector3sArray(t.normals),
  45342. r.needsUpdate = !0),
  45343. t.normalsNeedUpdate = !1
  45344. }
  45345. if (t.colorsNeedUpdate === !0) {
  45346. var r = this.attributes.color;
  45347. void 0 !== r && (r.copyColorsArray(t.colors),
  45348. r.needsUpdate = !0),
  45349. t.colorsNeedUpdate = !1
  45350. }
  45351. if (t.uvsNeedUpdate) {
  45352. var r = this.attributes.uv;
  45353. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45354. r.needsUpdate = !0),
  45355. t.uvsNeedUpdate = !1
  45356. }
  45357. if (t.lineDistancesNeedUpdate) {
  45358. var r = this.attributes.lineDistance;
  45359. void 0 !== r && (r.copyArray(t.lineDistances),
  45360. r.needsUpdate = !0),
  45361. t.lineDistancesNeedUpdate = !1
  45362. }
  45363. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45364. this.groups = t.groups,
  45365. t.groupsNeedUpdate = !1),
  45366. this
  45367. },
  45368. fromGeometry: function(e) {
  45369. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45370. this.fromDirectGeometry(e.__directGeometry)
  45371. },
  45372. fromDirectGeometry: function(e) {
  45373. var t = new Float32Array(3 * e.vertices.length);
  45374. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45375. e.normals.length > 0) {
  45376. var i = new Float32Array(3 * e.normals.length);
  45377. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45378. }
  45379. if (e.colors.length > 0) {
  45380. var r = new Float32Array(3 * e.colors.length);
  45381. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45382. }
  45383. if (e.uvs.length > 0) {
  45384. var o = new Float32Array(2 * e.uvs.length);
  45385. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45386. }
  45387. if (e.uvs2.length > 0) {
  45388. var a = new Float32Array(2 * e.uvs2.length);
  45389. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45390. }
  45391. if (e.indices.length > 0) {
  45392. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45393. , l = new s(3 * e.indices.length);
  45394. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45395. }
  45396. this.groups = e.groups;
  45397. for (var c in e.morphTargets) {
  45398. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45399. var f = u[d]
  45400. , g = new n.Float32Attribute(3 * f.length,3);
  45401. h.push(g.copyVector3sArray(f))
  45402. }
  45403. this.morphAttributes[c] = h
  45404. }
  45405. if (e.skinIndices.length > 0) {
  45406. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45407. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45408. }
  45409. if (e.skinWeights.length > 0) {
  45410. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45411. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45412. }
  45413. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45414. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45415. this
  45416. },
  45417. computeBoundingBox: function() {
  45418. new n.Vector3;
  45419. return function() {
  45420. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45421. var e = this.attributes.position.array;
  45422. e && this.boundingBox.setFromArray(e),
  45423. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45424. this.boundingBox.max.set(0, 0, 0)),
  45425. (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)
  45426. }
  45427. }(),
  45428. computeBoundingSphere: function() {
  45429. var e = new n.Box3
  45430. , t = new n.Vector3;
  45431. return function() {
  45432. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45433. var i = this.attributes.position.array;
  45434. if (i) {
  45435. var r = this.boundingSphere.center;
  45436. e.setFromArray(i),
  45437. e.center(r);
  45438. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45439. t.fromArray(i, a),
  45440. o = Math.max(o, r.distanceToSquared(t));
  45441. this.boundingSphere.radius = Math.sqrt(o),
  45442. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45443. }
  45444. }
  45445. }(),
  45446. computeFaceNormals: function() {},
  45447. computeVertexNormals: function() {
  45448. var e = this.index
  45449. , t = this.attributes
  45450. , i = this.groups;
  45451. if (t.position) {
  45452. var r = t.position.array;
  45453. if (void 0 === t.normal)
  45454. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45455. else
  45456. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45457. o[a] = 0;
  45458. 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;
  45459. if (e) {
  45460. var v = e.array;
  45461. 0 === i.length && this.addGroup(0, v.length);
  45462. for (var A = 0, y = i.length; A < y; ++A)
  45463. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45464. l = 3 * v[a + 0],
  45465. c = 3 * v[a + 1],
  45466. h = 3 * v[a + 2],
  45467. d.fromArray(r, l),
  45468. p.fromArray(r, c),
  45469. f.fromArray(r, h),
  45470. g.subVectors(f, p),
  45471. m.subVectors(d, p),
  45472. g.cross(m),
  45473. u[l] += g.x,
  45474. u[l + 1] += g.y,
  45475. u[l + 2] += g.z,
  45476. u[c] += g.x,
  45477. u[c + 1] += g.y,
  45478. u[c + 2] += g.z,
  45479. u[h] += g.x,
  45480. u[h + 1] += g.y,
  45481. u[h + 2] += g.z
  45482. } else
  45483. for (var a = 0, s = r.length; a < s; a += 9)
  45484. d.fromArray(r, a),
  45485. p.fromArray(r, a + 3),
  45486. f.fromArray(r, a + 6),
  45487. g.subVectors(f, p),
  45488. m.subVectors(d, p),
  45489. g.cross(m),
  45490. u[a] = g.x,
  45491. u[a + 1] = g.y,
  45492. u[a + 2] = g.z,
  45493. u[a + 3] = g.x,
  45494. u[a + 4] = g.y,
  45495. u[a + 5] = g.z,
  45496. u[a + 6] = g.x,
  45497. u[a + 7] = g.y,
  45498. u[a + 8] = g.z;
  45499. this.normalizeNormals(),
  45500. t.normal.needsUpdate = !0
  45501. }
  45502. },
  45503. merge: function(e, t) {
  45504. if (e instanceof n.BufferGeometry == !1)
  45505. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45506. void 0 === t && (t = 0);
  45507. var i = this.attributes;
  45508. for (var r in i)
  45509. if (void 0 !== e.attributes[r])
  45510. 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++,
  45511. u++)
  45512. a[u] = l[h];
  45513. return this
  45514. },
  45515. normalizeNormals: function() {
  45516. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45517. e = r[o],
  45518. t = r[o + 1],
  45519. i = r[o + 2],
  45520. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45521. r[o] *= n,
  45522. r[o + 1] *= n,
  45523. r[o + 2] *= n
  45524. },
  45525. toNonIndexed: function() {
  45526. if (null === this.index)
  45527. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45528. this;
  45529. var e = new n.BufferGeometry
  45530. , t = this.index.array
  45531. , i = this.attributes;
  45532. for (var r in i) {
  45533. 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++) {
  45534. c = t[u] * s;
  45535. for (var p = 0; p < s; p++)
  45536. l[h++] = a[c++]
  45537. }
  45538. e.addAttribute(r, new n.BufferAttribute(l,s))
  45539. }
  45540. return e
  45541. },
  45542. toJSON: function() {
  45543. var e = {
  45544. metadata: {
  45545. version: 4.4,
  45546. type: "BufferGeometry",
  45547. generator: "BufferGeometry.toJSON"
  45548. }
  45549. };
  45550. if (e.uuid = this.uuid,
  45551. e.type = this.type,
  45552. "" !== this.name && (e.name = this.name),
  45553. void 0 !== this.parameters) {
  45554. var t = this.parameters;
  45555. for (var i in t)
  45556. void 0 !== t[i] && (e[i] = t[i]);
  45557. return e
  45558. }
  45559. e.data = {
  45560. attributes: {}
  45561. };
  45562. var n = this.index;
  45563. if (null !== n) {
  45564. var r = Array.prototype.slice.call(n.array);
  45565. e.data.index = {
  45566. type: n.array.constructor.name,
  45567. array: r
  45568. }
  45569. }
  45570. var o = this.attributes;
  45571. for (var i in o) {
  45572. var a = o[i]
  45573. , r = Array.prototype.slice.call(a.array);
  45574. e.data.attributes[i] = {
  45575. itemSize: a.itemSize,
  45576. type: a.array.constructor.name,
  45577. array: r
  45578. }
  45579. }
  45580. var s = this.groups;
  45581. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45582. var l = this.boundingSphere;
  45583. return null !== l && (e.data.boundingSphere = {
  45584. center: l.center.toArray(),
  45585. radius: l.radius
  45586. }),
  45587. e
  45588. },
  45589. clone: function() {
  45590. return (new n.BufferGeometry).copy(this)
  45591. },
  45592. copy: function(e) {
  45593. var t = e.index;
  45594. null !== t && this.setIndex(t.clone());
  45595. var i = e.attributes;
  45596. for (var n in i) {
  45597. var r = i[n];
  45598. this.addAttribute(n, r.clone())
  45599. }
  45600. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45601. var l = o[a];
  45602. this.addGroup(l.start, l.count)
  45603. }
  45604. return this
  45605. },
  45606. dispose: function() {
  45607. this.dispatchEvent({
  45608. type: "dispose"
  45609. })
  45610. }
  45611. },
  45612. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45613. n.BufferGeometry.MaxIndex = 65535,
  45614. n.InstancedBufferGeometry = function() {
  45615. n.BufferGeometry.call(this),
  45616. this.type = "InstancedBufferGeometry",
  45617. this.maxInstancedCount = void 0
  45618. }
  45619. ,
  45620. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45621. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45622. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45623. this.groups.push({
  45624. start: e,
  45625. count: t,
  45626. instances: i
  45627. })
  45628. }
  45629. ,
  45630. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45631. var t = e.index;
  45632. null !== t && this.setIndex(t.clone());
  45633. var i = e.attributes;
  45634. for (var n in i) {
  45635. var r = i[n];
  45636. this.addAttribute(n, r.clone())
  45637. }
  45638. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45639. var l = o[a];
  45640. this.addGroup(l.start, l.count, l.instances)
  45641. }
  45642. return this
  45643. }
  45644. ,
  45645. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45646. n.Uniform = function(e, t) {
  45647. this.type = e,
  45648. this.value = t,
  45649. this.dynamic = !1
  45650. }
  45651. ,
  45652. n.Uniform.prototype = {
  45653. constructor: n.Uniform,
  45654. onUpdate: function(e) {
  45655. return this.dynamic = !0,
  45656. this.onUpdateCallback = e,
  45657. this
  45658. }
  45659. },
  45660. n.AnimationClip = function(e, t, i) {
  45661. this.name = e || n.Math.generateUUID(),
  45662. this.tracks = i,
  45663. this.duration = void 0 !== t ? t : -1,
  45664. this.duration < 0 && this.resetDuration(),
  45665. this.trim(),
  45666. this.optimize()
  45667. }
  45668. ,
  45669. n.AnimationClip.prototype = {
  45670. constructor: n.AnimationClip,
  45671. resetDuration: function() {
  45672. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45673. var r = this.tracks[i];
  45674. t = Math.max(t, r.times[r.times.length - 1])
  45675. }
  45676. this.duration = t
  45677. },
  45678. trim: function() {
  45679. for (var e = 0; e < this.tracks.length; e++)
  45680. this.tracks[e].trim(0, this.duration);
  45681. return this
  45682. },
  45683. optimize: function() {
  45684. for (var e = 0; e < this.tracks.length; e++)
  45685. this.tracks[e].optimize();
  45686. return this
  45687. }
  45688. },
  45689. Object.assign(n.AnimationClip, {
  45690. parse: function(e) {
  45691. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45692. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45693. return new n.AnimationClip(e.name,e.duration,t)
  45694. },
  45695. toJSON: function(e) {
  45696. for (var t = [], i = e.tracks, r = {
  45697. name: e.name,
  45698. duration: e.duration,
  45699. tracks: t
  45700. }, o = 0, a = i.length; o !== a; ++o)
  45701. t.push(n.KeyframeTrack.toJSON(i[o]));
  45702. return r
  45703. },
  45704. CreateFromMorphTargetSequence: function(e, t, i) {
  45705. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45706. var s = []
  45707. , l = [];
  45708. s.push((a + r - 1) % r, a, (a + 1) % r),
  45709. l.push(0, 1, 0);
  45710. var c = n.AnimationUtils.getKeyframeOrder(s);
  45711. s = n.AnimationUtils.sortedArray(s, 1, c),
  45712. l = n.AnimationUtils.sortedArray(l, 1, c),
  45713. 0 === s[0] && (s.push(r),
  45714. l.push(l[0])),
  45715. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45716. }
  45717. return new n.AnimationClip(e,-1,o)
  45718. },
  45719. findByName: function(e, t) {
  45720. for (var i = 0; i < e.length; i++)
  45721. if (e[i].name === t)
  45722. return e[i];
  45723. return null
  45724. },
  45725. CreateClipsFromMorphTargetSequences: function(e, t) {
  45726. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45727. var s = e[o]
  45728. , l = s.name.match(r);
  45729. if (l && l.length > 1) {
  45730. var c = l[1]
  45731. , h = i[c];
  45732. h || (i[c] = h = []),
  45733. h.push(s)
  45734. }
  45735. }
  45736. var u = [];
  45737. for (var c in i)
  45738. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45739. return u
  45740. },
  45741. parseAnimation: function(e, t, i) {
  45742. if (!e)
  45743. return console.error(" no animation in JSONLoader data"),
  45744. null;
  45745. for (var r = function(e, t, i, r, o) {
  45746. if (0 !== i.length) {
  45747. var a = []
  45748. , s = [];
  45749. n.AnimationUtils.flattenJSON(i, a, s, r),
  45750. 0 !== a.length && o.push(new e(t,a,s))
  45751. }
  45752. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45753. var u = c[h].keys;
  45754. if (u && 0 != u.length)
  45755. if (u[0].morphTargets) {
  45756. for (var d = {}, p = 0; p < u.length; p++)
  45757. if (u[p].morphTargets)
  45758. for (var f = 0; f < u[p].morphTargets.length; f++)
  45759. d[u[p].morphTargets[f]] = -1;
  45760. for (var g in d) {
  45761. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45762. var A = u[p];
  45763. m.push(A.time),
  45764. v.push(A.morphTarget === g ? 1 : 0)
  45765. }
  45766. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45767. }
  45768. s = d.length * (l || 1)
  45769. } else {
  45770. var y = ".bones[" + t[h].name + "]";
  45771. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45772. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45773. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45774. }
  45775. }
  45776. if (0 === o.length)
  45777. return null;
  45778. var C = new n.AnimationClip(a,s,o);
  45779. return C
  45780. }
  45781. }),
  45782. n.AnimationMixer = function(e) {
  45783. this._root = e,
  45784. this._initMemoryManager(),
  45785. this._accuIndex = 0,
  45786. this.time = 0,
  45787. this.timeScale = 1
  45788. }
  45789. ,
  45790. n.AnimationMixer.prototype = {
  45791. constructor: n.AnimationMixer,
  45792. clipAction: function(e, t) {
  45793. 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];
  45794. if (void 0 !== l) {
  45795. var c = l.actionByRoot[o];
  45796. if (void 0 !== c)
  45797. return c;
  45798. if (i = l.knownActions[0],
  45799. s = i._clip,
  45800. e !== a && e !== s)
  45801. throw new Error("Different clips with the same name detected!")
  45802. }
  45803. if (null === s)
  45804. return null;
  45805. var h = new n.AnimationMixer._Action(this,s,t);
  45806. return this._bindAction(h, i),
  45807. this._addInactiveAction(h, a, o),
  45808. h
  45809. },
  45810. existingAction: function(e, t) {
  45811. var i = t || this._root
  45812. , n = i.uuid
  45813. , r = "string" == typeof e ? e : e.name
  45814. , o = this._actionsByClip[r];
  45815. return void 0 !== o ? o.actionByRoot[n] || null : null
  45816. },
  45817. stopAllAction: function() {
  45818. var e = this._actions
  45819. , t = this._nActiveActions
  45820. , i = this._bindings
  45821. , n = this._nActiveBindings;
  45822. this._nActiveActions = 0,
  45823. this._nActiveBindings = 0;
  45824. for (var r = 0; r !== t; ++r)
  45825. e[r].reset();
  45826. for (var r = 0; r !== n; ++r)
  45827. i[r].useCount = 0;
  45828. return this
  45829. },
  45830. update: function(e) {
  45831. e *= this.timeScale;
  45832. 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) {
  45833. var s = t[a];
  45834. s.enabled && s._update(n, e, r, o)
  45835. }
  45836. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45837. l[a].apply(o);
  45838. return this
  45839. },
  45840. getRoot: function() {
  45841. return this._root
  45842. },
  45843. uncacheClip: function(e) {
  45844. var t = this._actions
  45845. , i = e.name
  45846. , n = this._actionsByClip
  45847. , r = n[i];
  45848. if (void 0 !== r) {
  45849. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45850. var l = o[a];
  45851. this._deactivateAction(l);
  45852. var c = l._cacheIndex
  45853. , h = t[t.length - 1];
  45854. l._cacheIndex = null,
  45855. l._byClipCacheIndex = null,
  45856. h._cacheIndex = c,
  45857. t[c] = h,
  45858. t.pop(),
  45859. this._removeInactiveBindingsForAction(l)
  45860. }
  45861. delete n[i]
  45862. }
  45863. },
  45864. uncacheRoot: function(e) {
  45865. var t = e.uuid
  45866. , i = this._actionsByClip;
  45867. for (var n in i) {
  45868. var r = i[n].actionByRoot
  45869. , o = r[t];
  45870. void 0 !== o && (this._deactivateAction(o),
  45871. this._removeInactiveAction(o))
  45872. }
  45873. var a = this._bindingsByRootAndName
  45874. , s = a[t];
  45875. if (void 0 !== s)
  45876. for (var l in s) {
  45877. var c = s[l];
  45878. c.restoreOriginalState(),
  45879. this._removeInactiveBinding(c)
  45880. }
  45881. },
  45882. uncacheAction: function(e, t) {
  45883. var i = this.existingAction(e, t);
  45884. null !== i && (this._deactivateAction(i),
  45885. this._removeInactiveAction(i))
  45886. }
  45887. },
  45888. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45889. n.AnimationMixer._Action = function(e, t, i) {
  45890. this._mixer = e,
  45891. this._clip = t,
  45892. this._localRoot = i || null;
  45893. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45894. endingStart: n.ZeroCurvatureEnding,
  45895. endingEnd: n.ZeroCurvatureEnding
  45896. }, l = 0; l !== o; ++l) {
  45897. var c = r[l].createInterpolant(null);
  45898. a[l] = c,
  45899. c.settings = s
  45900. }
  45901. this._interpolantSettings = s,
  45902. this._interpolants = a,
  45903. this._propertyBindings = new Array(o),
  45904. this._cacheIndex = null,
  45905. this._byClipCacheIndex = null,
  45906. this._timeScaleInterpolant = null,
  45907. this._weightInterpolant = null,
  45908. this.loop = n.LoopRepeat,
  45909. this._loopCount = -1,
  45910. this._startTime = null,
  45911. this.time = 0,
  45912. this.timeScale = 1,
  45913. this._effectiveTimeScale = 1,
  45914. this.weight = 1,
  45915. this._effectiveWeight = 1,
  45916. this.repetitions = 1 / 0,
  45917. this.paused = !1,
  45918. this.enabled = !0,
  45919. this.clampWhenFinished = !1,
  45920. this.zeroSlopeAtStart = !0,
  45921. this.zeroSlopeAtEnd = !0
  45922. }
  45923. ,
  45924. n.AnimationMixer._Action.prototype = {
  45925. constructor: n.AnimationMixer._Action,
  45926. play: function() {
  45927. return this._mixer._activateAction(this),
  45928. this
  45929. },
  45930. stop: function() {
  45931. return this._mixer._deactivateAction(this),
  45932. this.reset()
  45933. },
  45934. reset: function() {
  45935. return this.paused = !1,
  45936. this.enabled = !0,
  45937. this.time = 0,
  45938. this._loopCount = -1,
  45939. this._startTime = null,
  45940. this.stopFading().stopWarping()
  45941. },
  45942. isRunning: function() {
  45943. this._startTime;
  45944. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45945. },
  45946. isScheduled: function() {
  45947. return this._mixer._isActiveAction(this)
  45948. },
  45949. startAt: function(e) {
  45950. return this._startTime = e,
  45951. this
  45952. },
  45953. setLoop: function(e, t) {
  45954. return this.loop = e,
  45955. this.repetitions = t,
  45956. this
  45957. },
  45958. setEffectiveWeight: function(e) {
  45959. return this.weight = e,
  45960. this._effectiveWeight = this.enabled ? e : 0,
  45961. this.stopFading()
  45962. },
  45963. getEffectiveWeight: function() {
  45964. return this._effectiveWeight
  45965. },
  45966. fadeIn: function(e) {
  45967. return this._scheduleFading(e, 0, 1)
  45968. },
  45969. fadeOut: function(e) {
  45970. return this._scheduleFading(e, 1, 0)
  45971. },
  45972. crossFadeFrom: function(e, t, i) {
  45973. this._mixer;
  45974. if (e.fadeOut(t),
  45975. this.fadeIn(t),
  45976. i) {
  45977. var n = this._clip.duration
  45978. , r = e._clip.duration
  45979. , o = r / n
  45980. , a = n / r;
  45981. e.warp(1, o, t),
  45982. this.warp(a, 1, t)
  45983. }
  45984. return this
  45985. },
  45986. crossFadeTo: function(e, t, i) {
  45987. return e.crossFadeFrom(this, t, i)
  45988. },
  45989. stopFading: function() {
  45990. var e = this._weightInterpolant;
  45991. return null !== e && (this._weightInterpolant = null,
  45992. this._mixer._takeBackControlInterpolant(e)),
  45993. this
  45994. },
  45995. setEffectiveTimeScale: function(e) {
  45996. return this.timeScale = e,
  45997. this._effectiveTimeScale = this.paused ? 0 : e,
  45998. this.stopWarping()
  45999. },
  46000. getEffectiveTimeScale: function() {
  46001. return this._effectiveTimeScale
  46002. },
  46003. setDuration: function(e) {
  46004. return this.timeScale = this._clip.duration / e,
  46005. this.stopWarping()
  46006. },
  46007. syncWith: function(e) {
  46008. return this.time = e.time,
  46009. this.timeScale = e.timeScale,
  46010. this.stopWarping()
  46011. },
  46012. halt: function(e) {
  46013. return this.warp(this._currentTimeScale, 0, e)
  46014. },
  46015. warp: function(e, t, i) {
  46016. var n = this._mixer
  46017. , r = n.time
  46018. , o = this._timeScaleInterpolant
  46019. , a = this.timeScale;
  46020. null === o && (o = n._lendControlInterpolant(),
  46021. this._timeScaleInterpolant = o);
  46022. var s = o.parameterPositions
  46023. , l = o.sampleValues;
  46024. return s[0] = r,
  46025. s[1] = r + i,
  46026. l[0] = e / a,
  46027. l[1] = t / a,
  46028. this
  46029. },
  46030. stopWarping: function() {
  46031. var e = this._timeScaleInterpolant;
  46032. return null !== e && (this._timeScaleInterpolant = null,
  46033. this._mixer._takeBackControlInterpolant(e)),
  46034. this
  46035. },
  46036. getMixer: function() {
  46037. return this._mixer
  46038. },
  46039. getClip: function() {
  46040. return this._clip
  46041. },
  46042. getRoot: function() {
  46043. return this._localRoot || this._mixer._root
  46044. },
  46045. _update: function(e, t, i, n) {
  46046. var r = this._startTime;
  46047. if (null !== r) {
  46048. var o = (e - r) * i;
  46049. if (o < 0 || 0 === i)
  46050. return;
  46051. this._startTime = null,
  46052. t = i * o
  46053. }
  46054. t *= this._updateTimeScale(e);
  46055. var a = this._updateTime(t)
  46056. , s = this._updateWeight(e);
  46057. if (s > 0)
  46058. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46059. l[h].evaluate(a),
  46060. c[h].accumulate(n, s)
  46061. },
  46062. _updateWeight: function(e) {
  46063. var t = 0;
  46064. if (this.enabled) {
  46065. t = this.weight;
  46066. var i = this._weightInterpolant;
  46067. if (null !== i) {
  46068. var n = i.evaluate(e)[0];
  46069. t *= n,
  46070. e > i.parameterPositions[1] && (this.stopFading(),
  46071. 0 === n && (this.enabled = !1))
  46072. }
  46073. }
  46074. return this._effectiveWeight = t,
  46075. t
  46076. },
  46077. _updateTimeScale: function(e) {
  46078. var t = 0;
  46079. if (!this.paused) {
  46080. t = this.timeScale;
  46081. var i = this._timeScaleInterpolant;
  46082. if (null !== i) {
  46083. var n = i.evaluate(e)[0];
  46084. t *= n,
  46085. e > i.parameterPositions[1] && (this.stopWarping(),
  46086. 0 === t ? this.pause = !0 : this.timeScale = t)
  46087. }
  46088. }
  46089. return this._effectiveTimeScale = t,
  46090. t
  46091. },
  46092. _updateTime: function(e) {
  46093. var t = this.time + e;
  46094. if (0 === e)
  46095. return t;
  46096. var i = this._clip.duration
  46097. , r = this.loop
  46098. , o = this._loopCount
  46099. , a = !1;
  46100. switch (r) {
  46101. case n.LoopOnce:
  46102. if (o === -1 && (this.loopCount = 0,
  46103. this._setEndings(!0, !0, !1)),
  46104. t >= i)
  46105. t = i;
  46106. else {
  46107. if (!(t < 0))
  46108. break;
  46109. t = 0
  46110. }
  46111. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46112. this._mixer.dispatchEvent({
  46113. type: "finished",
  46114. action: this,
  46115. direction: e < 0 ? -1 : 1
  46116. });
  46117. break;
  46118. case n.LoopPingPong:
  46119. a = !0;
  46120. case n.LoopRepeat:
  46121. if (o === -1 && (e > 0 ? (o = 0,
  46122. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46123. t >= i || t < 0) {
  46124. var s = Math.floor(t / i);
  46125. t -= i * s,
  46126. o += Math.abs(s);
  46127. var l = this.repetitions - o;
  46128. if (l < 0) {
  46129. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46130. t = e > 0 ? i : 0,
  46131. this._mixer.dispatchEvent({
  46132. type: "finished",
  46133. action: this,
  46134. direction: e > 0 ? 1 : -1
  46135. });
  46136. break
  46137. }
  46138. if (0 === l) {
  46139. var c = e < 0;
  46140. this._setEndings(c, !c, a)
  46141. } else
  46142. this._setEndings(!1, !1, a);
  46143. this._loopCount = o,
  46144. this._mixer.dispatchEvent({
  46145. type: "loop",
  46146. action: this,
  46147. loopDelta: s
  46148. })
  46149. }
  46150. if (r === n.LoopPingPong && 1 === (1 & o))
  46151. return this.time = t,
  46152. i - t
  46153. }
  46154. return this.time = t,
  46155. t
  46156. },
  46157. _setEndings: function(e, t, i) {
  46158. var r = this._interpolantSettings;
  46159. i ? (r.endingStart = n.ZeroSlopeEnding,
  46160. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46161. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46162. },
  46163. _scheduleFading: function(e, t, i) {
  46164. var n = this._mixer
  46165. , r = n.time
  46166. , o = this._weightInterpolant;
  46167. null === o && (o = n._lendControlInterpolant(),
  46168. this._weightInterpolant = o);
  46169. var a = o.parameterPositions
  46170. , s = o.sampleValues;
  46171. return a[0] = r,
  46172. s[0] = t,
  46173. a[1] = r + e,
  46174. s[1] = i,
  46175. this
  46176. }
  46177. },
  46178. Object.assign(n.AnimationMixer.prototype, {
  46179. _bindAction: function(e, t) {
  46180. var i = e._localRoot || this._root
  46181. , r = e._clip.tracks
  46182. , o = r.length
  46183. , a = e._propertyBindings
  46184. , s = e._interpolants
  46185. , l = i.uuid
  46186. , c = this._bindingsByRootAndName
  46187. , h = c[l];
  46188. void 0 === h && (h = {},
  46189. c[l] = h);
  46190. for (var u = 0; u !== o; ++u) {
  46191. var d = r[u]
  46192. , p = d.name
  46193. , f = h[p];
  46194. if (void 0 !== f)
  46195. a[u] = f;
  46196. else {
  46197. if (f = a[u],
  46198. void 0 !== f) {
  46199. null === f._cacheIndex && (++f.referenceCount,
  46200. this._addInactiveBinding(f, l, p));
  46201. continue
  46202. }
  46203. var g = t && t._propertyBindings[u].binding.parsedPath;
  46204. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46205. ++f.referenceCount,
  46206. this._addInactiveBinding(f, l, p),
  46207. a[u] = f
  46208. }
  46209. s[u].resultBuffer = f.buffer
  46210. }
  46211. },
  46212. _activateAction: function(e) {
  46213. if (!this._isActiveAction(e)) {
  46214. if (null === e._cacheIndex) {
  46215. var t = (e._localRoot || this._root).uuid
  46216. , i = e._clip.name
  46217. , n = this._actionsByClip[i];
  46218. this._bindAction(e, n && n.knownActions[0]),
  46219. this._addInactiveAction(e, i, t)
  46220. }
  46221. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46222. var s = r[o];
  46223. 0 === s.useCount++ && (this._lendBinding(s),
  46224. s.saveOriginalState())
  46225. }
  46226. this._lendAction(e)
  46227. }
  46228. },
  46229. _deactivateAction: function(e) {
  46230. if (this._isActiveAction(e)) {
  46231. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46232. var r = t[i];
  46233. 0 === --r.useCount && (r.restoreOriginalState(),
  46234. this._takeBackBinding(r))
  46235. }
  46236. this._takeBackAction(e)
  46237. }
  46238. },
  46239. _initMemoryManager: function() {
  46240. this._actions = [],
  46241. this._nActiveActions = 0,
  46242. this._actionsByClip = {},
  46243. this._bindings = [],
  46244. this._nActiveBindings = 0,
  46245. this._bindingsByRootAndName = {},
  46246. this._controlInterpolants = [],
  46247. this._nActiveControlInterpolants = 0;
  46248. var e = this;
  46249. this.stats = {
  46250. actions: {
  46251. get total() {
  46252. return e._actions.length
  46253. },
  46254. get inUse() {
  46255. return e._nActiveActions
  46256. }
  46257. },
  46258. bindings: {
  46259. get total() {
  46260. return e._bindings.length
  46261. },
  46262. get inUse() {
  46263. return e._nActiveBindings
  46264. }
  46265. },
  46266. controlInterpolants: {
  46267. get total() {
  46268. return e._controlInterpolants.length
  46269. },
  46270. get inUse() {
  46271. return e._nActiveControlInterpolants
  46272. }
  46273. }
  46274. }
  46275. },
  46276. _isActiveAction: function(e) {
  46277. var t = e._cacheIndex;
  46278. return null !== t && t < this._nActiveActions
  46279. },
  46280. _addInactiveAction: function(e, t, i) {
  46281. var n = this._actions
  46282. , r = this._actionsByClip
  46283. , o = r[t];
  46284. if (void 0 === o)
  46285. o = {
  46286. knownActions: [e],
  46287. actionByRoot: {}
  46288. },
  46289. e._byClipCacheIndex = 0,
  46290. r[t] = o;
  46291. else {
  46292. var a = o.knownActions;
  46293. e._byClipCacheIndex = a.length,
  46294. a.push(e)
  46295. }
  46296. e._cacheIndex = n.length,
  46297. n.push(e),
  46298. o.actionByRoot[i] = e
  46299. },
  46300. _removeInactiveAction: function(e) {
  46301. var t = this._actions
  46302. , i = t[t.length - 1]
  46303. , n = e._cacheIndex;
  46304. i._cacheIndex = n,
  46305. t[n] = i,
  46306. t.pop(),
  46307. e._cacheIndex = null;
  46308. var r = e._clip.name
  46309. , o = this._actionsByClip
  46310. , a = o[r]
  46311. , s = a.knownActions
  46312. , l = s[s.length - 1]
  46313. , c = e._byClipCacheIndex;
  46314. l._byClipCacheIndex = c,
  46315. s[c] = l,
  46316. s.pop(),
  46317. e._byClipCacheIndex = null;
  46318. var h = a.actionByRoot
  46319. , u = (t._localRoot || this._root).uuid;
  46320. delete h[u],
  46321. 0 === s.length && delete o[r],
  46322. this._removeInactiveBindingsForAction(e)
  46323. },
  46324. _removeInactiveBindingsForAction: function(e) {
  46325. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46326. var r = t[i];
  46327. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46328. }
  46329. },
  46330. _lendAction: function(e) {
  46331. var t = this._actions
  46332. , i = e._cacheIndex
  46333. , n = this._nActiveActions++
  46334. , r = t[n];
  46335. e._cacheIndex = n,
  46336. t[n] = e,
  46337. r._cacheIndex = i,
  46338. t[i] = r
  46339. },
  46340. _takeBackAction: function(e) {
  46341. var t = this._actions
  46342. , i = e._cacheIndex
  46343. , n = --this._nActiveActions
  46344. , r = t[n];
  46345. e._cacheIndex = n,
  46346. t[n] = e,
  46347. r._cacheIndex = i,
  46348. t[i] = r
  46349. },
  46350. _addInactiveBinding: function(e, t, i) {
  46351. var n = this._bindingsByRootAndName
  46352. , r = n[t]
  46353. , o = this._bindings;
  46354. void 0 === r && (r = {},
  46355. n[t] = r),
  46356. r[i] = e,
  46357. e._cacheIndex = o.length,
  46358. o.push(e)
  46359. },
  46360. _removeInactiveBinding: function(e) {
  46361. var t = this._bindings
  46362. , i = e.binding
  46363. , n = i.rootNode.uuid
  46364. , r = i.path
  46365. , o = this._bindingsByRootAndName
  46366. , a = o[n]
  46367. , s = t[t.length - 1]
  46368. , l = e._cacheIndex;
  46369. s._cacheIndex = l,
  46370. t[l] = s,
  46371. t.pop(),
  46372. delete a[r];
  46373. e: {
  46374. for (var c in a)
  46375. break e;
  46376. delete o[n]
  46377. }
  46378. },
  46379. _lendBinding: function(e) {
  46380. var t = this._bindings
  46381. , i = e._cacheIndex
  46382. , n = this._nActiveBindings++
  46383. , r = t[n];
  46384. e._cacheIndex = n,
  46385. t[n] = e,
  46386. r._cacheIndex = i,
  46387. t[i] = r
  46388. },
  46389. _takeBackBinding: function(e) {
  46390. var t = this._bindings
  46391. , i = e._cacheIndex
  46392. , n = --this._nActiveBindings
  46393. , r = t[n];
  46394. e._cacheIndex = n,
  46395. t[n] = e,
  46396. r._cacheIndex = i,
  46397. t[i] = r
  46398. },
  46399. _lendControlInterpolant: function() {
  46400. var e = this._controlInterpolants
  46401. , t = this._nActiveControlInterpolants++
  46402. , i = e[t];
  46403. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46404. i.__cacheIndex = t,
  46405. e[t] = i),
  46406. i
  46407. },
  46408. _takeBackControlInterpolant: function(e) {
  46409. var t = this._controlInterpolants
  46410. , i = e.__cacheIndex
  46411. , n = --this._nActiveControlInterpolants
  46412. , r = t[n];
  46413. e.__cacheIndex = n,
  46414. t[n] = e,
  46415. r.__cacheIndex = i,
  46416. t[i] = r
  46417. },
  46418. _controlInterpolantsResultBuffer: new Float32Array(1)
  46419. }),
  46420. n.AnimationObjectGroup = function(e) {
  46421. this.uuid = n.Math.generateUUID(),
  46422. this._objects = Array.prototype.slice.call(arguments),
  46423. this.nCachedObjects_ = 0;
  46424. var t = {};
  46425. this._indicesByUUID = t;
  46426. for (var i = 0, r = arguments.length; i !== r; ++i)
  46427. t[arguments[i].uuid] = i;
  46428. this._paths = [],
  46429. this._parsedPaths = [],
  46430. this._bindings = [],
  46431. this._bindingsIndicesByPath = {};
  46432. var o = this;
  46433. this.stats = {
  46434. objects: {
  46435. get total() {
  46436. return o._objects.length
  46437. },
  46438. get inUse() {
  46439. return this.total - o.nCachedObjects_
  46440. }
  46441. },
  46442. get bindingsPerObject() {
  46443. return o._bindings.length
  46444. }
  46445. }
  46446. }
  46447. ,
  46448. n.AnimationObjectGroup.prototype = {
  46449. constructor: n.AnimationObjectGroup,
  46450. add: function(e) {
  46451. 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) {
  46452. var d = arguments[h]
  46453. , p = d.uuid
  46454. , f = o[p];
  46455. if (void 0 === f) {
  46456. f = i++,
  46457. o[p] = f,
  46458. t.push(d);
  46459. for (var g = 0, m = c; g !== m; ++g)
  46460. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46461. } else if (f < r) {
  46462. var v = t[f]
  46463. , A = --r
  46464. , y = t[A];
  46465. o[y.uuid] = f,
  46466. t[f] = y,
  46467. o[p] = A,
  46468. t[A] = d;
  46469. for (var g = 0, m = c; g !== m; ++g) {
  46470. var C = l[g]
  46471. , I = C[A]
  46472. , E = C[f];
  46473. C[f] = I,
  46474. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46475. C[A] = E
  46476. }
  46477. } else
  46478. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46479. }
  46480. this.nCachedObjects_ = r
  46481. },
  46482. remove: function(e) {
  46483. for (var t = this._objects, i = (t.length,
  46484. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46485. var l = arguments[a]
  46486. , c = l.uuid
  46487. , h = n[c];
  46488. if (void 0 !== h && h >= i) {
  46489. var u = i++
  46490. , d = t[u];
  46491. n[d.uuid] = h,
  46492. t[h] = d,
  46493. n[c] = u,
  46494. t[u] = l;
  46495. for (var p = 0, f = o; p !== f; ++p) {
  46496. var g = r[p]
  46497. , m = g[u]
  46498. , v = g[h];
  46499. g[h] = m,
  46500. g[u] = v
  46501. }
  46502. }
  46503. }
  46504. this.nCachedObjects_ = i
  46505. },
  46506. uncache: function(e) {
  46507. 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) {
  46508. var c = arguments[s]
  46509. , h = c.uuid
  46510. , u = r[h];
  46511. if (void 0 !== u)
  46512. if (delete r[h],
  46513. u < n) {
  46514. var d = --n
  46515. , p = t[d]
  46516. , f = --i
  46517. , g = t[f];
  46518. r[p.uuid] = u,
  46519. t[u] = p,
  46520. r[g.uuid] = d,
  46521. t[d] = g,
  46522. t.pop();
  46523. for (var m = 0, v = a; m !== v; ++m) {
  46524. var A = o[m]
  46525. , y = A[d]
  46526. , C = A[f];
  46527. A[u] = y,
  46528. A[d] = C,
  46529. A.pop()
  46530. }
  46531. } else {
  46532. var f = --i
  46533. , g = t[f];
  46534. r[g.uuid] = u,
  46535. t[u] = g,
  46536. t.pop();
  46537. for (var m = 0, v = a; m !== v; ++m) {
  46538. var A = o[m];
  46539. A[u] = A[f],
  46540. A.pop()
  46541. }
  46542. }
  46543. }
  46544. this.nCachedObjects_ = n
  46545. },
  46546. subscribe_: function(e, t) {
  46547. var i = this._bindingsIndicesByPath
  46548. , r = i[e]
  46549. , o = this._bindings;
  46550. if (void 0 !== r)
  46551. return o[r];
  46552. var a = this._paths
  46553. , s = this._parsedPaths
  46554. , l = this._objects
  46555. , c = l.length
  46556. , h = this.nCachedObjects_
  46557. , u = new Array(c);
  46558. r = o.length,
  46559. i[e] = r,
  46560. a.push(e),
  46561. s.push(t),
  46562. o.push(u);
  46563. for (var d = h, p = l.length; d !== p; ++d) {
  46564. var f = l[d];
  46565. u[d] = new n.PropertyBinding(f,e,t)
  46566. }
  46567. return u
  46568. },
  46569. unsubscribe_: function(e) {
  46570. var t = this._bindingsIndicesByPath
  46571. , i = t[e];
  46572. if (void 0 !== i) {
  46573. var n = this._paths
  46574. , r = this._parsedPaths
  46575. , o = this._bindings
  46576. , a = o.length - 1
  46577. , s = o[a]
  46578. , l = e[a];
  46579. t[l] = i,
  46580. o[i] = s,
  46581. o.pop(),
  46582. r[i] = r[a],
  46583. r.pop(),
  46584. n[i] = n[a],
  46585. n.pop()
  46586. }
  46587. }
  46588. },
  46589. n.AnimationUtils = {
  46590. arraySlice: function(e, t, i) {
  46591. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46592. },
  46593. convertArray: function(e, t, i) {
  46594. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46595. },
  46596. isTypedArray: function(e) {
  46597. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46598. },
  46599. getKeyframeOrder: function(e) {
  46600. function t(t, i) {
  46601. return e[t] - e[i]
  46602. }
  46603. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46604. n[r] = r;
  46605. return n.sort(t),
  46606. n
  46607. },
  46608. sortedArray: function(e, t, i) {
  46609. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46610. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46611. r[a++] = e[s + l];
  46612. return r
  46613. },
  46614. flattenJSON: function(e, t, i, n) {
  46615. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46616. o = e[r++];
  46617. if (void 0 !== o) {
  46618. var a = o[n];
  46619. if (void 0 !== a)
  46620. if (Array.isArray(a)) {
  46621. do
  46622. a = o[n],
  46623. void 0 !== a && (t.push(o.time),
  46624. i.push.apply(i, a)),
  46625. o = e[r++];
  46626. while (void 0 !== o)
  46627. } else if (void 0 !== a.toArray) {
  46628. do
  46629. a = o[n],
  46630. void 0 !== a && (t.push(o.time),
  46631. a.toArray(i, i.length)),
  46632. o = e[r++];
  46633. while (void 0 !== o)
  46634. } else
  46635. do
  46636. a = o[n],
  46637. void 0 !== a && (t.push(o.time),
  46638. i.push(a)),
  46639. o = e[r++];
  46640. while (void 0 !== o)
  46641. }
  46642. }
  46643. },
  46644. n.KeyframeTrack = function(e, t, i, r) {
  46645. if (void 0 === e)
  46646. throw new Error("track name is undefined");
  46647. if (void 0 === t || 0 === t.length)
  46648. throw new Error("no keyframes in track named " + e);
  46649. this.name = e,
  46650. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46651. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46652. this.setInterpolation(r || this.DefaultInterpolation),
  46653. this.validate(),
  46654. this.optimize()
  46655. }
  46656. ,
  46657. n.KeyframeTrack.prototype = {
  46658. constructor: n.KeyframeTrack,
  46659. TimeBufferType: Float32Array,
  46660. ValueBufferType: Float32Array,
  46661. DefaultInterpolation: n.InterpolateLinear,
  46662. InterpolantFactoryMethodDiscrete: function(e) {
  46663. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46664. },
  46665. InterpolantFactoryMethodLinear: function(e) {
  46666. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46667. },
  46668. InterpolantFactoryMethodSmooth: function(e) {
  46669. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46670. },
  46671. setInterpolation: function(e) {
  46672. var t = void 0;
  46673. switch (e) {
  46674. case n.InterpolateDiscrete:
  46675. t = this.InterpolantFactoryMethodDiscrete;
  46676. break;
  46677. case n.InterpolateLinear:
  46678. t = this.InterpolantFactoryMethodLinear;
  46679. break;
  46680. case n.InterpolateSmooth:
  46681. t = this.InterpolantFactoryMethodSmooth
  46682. }
  46683. if (void 0 === t) {
  46684. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46685. if (void 0 === this.createInterpolant) {
  46686. if (e === this.DefaultInterpolation)
  46687. throw new Error(i);
  46688. this.setInterpolation(this.DefaultInterpolation)
  46689. }
  46690. return void console.warn(i)
  46691. }
  46692. this.createInterpolant = t
  46693. },
  46694. getInterpolation: function() {
  46695. switch (this.createInterpolant) {
  46696. case this.InterpolantFactoryMethodDiscrete:
  46697. return n.InterpolateDiscrete;
  46698. case this.InterpolantFactoryMethodLinear:
  46699. return n.InterpolateLinear;
  46700. case this.InterpolantFactoryMethodSmooth:
  46701. return n.InterpolateSmooth
  46702. }
  46703. },
  46704. getValueSize: function() {
  46705. return this.values.length / this.times.length
  46706. },
  46707. shift: function(e) {
  46708. if (0 !== e)
  46709. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46710. t[i] += e;
  46711. return this
  46712. },
  46713. scale: function(e) {
  46714. if (1 !== e)
  46715. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46716. t[i] *= e;
  46717. return this
  46718. },
  46719. trim: function(e, t) {
  46720. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46721. ++o;
  46722. for (; a !== -1 && i[a] > t; )
  46723. --a;
  46724. if (++a,
  46725. 0 !== o || a !== r) {
  46726. o >= a && (a = Math.max(a, 1),
  46727. o = a - 1);
  46728. var s = this.getValueSize();
  46729. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46730. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46731. }
  46732. return this
  46733. },
  46734. validate: function() {
  46735. var e = !0
  46736. , t = this.getValueSize();
  46737. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46738. e = !1);
  46739. var i = this.times
  46740. , r = this.values
  46741. , o = i.length;
  46742. 0 === o && (console.error("track is empty", this),
  46743. e = !1);
  46744. for (var a = null, s = 0; s !== o; s++) {
  46745. var l = i[s];
  46746. if ("number" == typeof l && isNaN(l)) {
  46747. console.error("time is not a valid number", this, s, l),
  46748. e = !1;
  46749. break
  46750. }
  46751. if (null !== a && a > l) {
  46752. console.error("out of order keys", this, s, l, a),
  46753. e = !1;
  46754. break
  46755. }
  46756. a = l
  46757. }
  46758. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46759. for (var s = 0, c = r.length; s !== c; ++s) {
  46760. var h = r[s];
  46761. if (isNaN(h)) {
  46762. console.error("value is not a valid number", this, s, h),
  46763. e = !1;
  46764. break
  46765. }
  46766. }
  46767. return e
  46768. },
  46769. optimize: function() {
  46770. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46771. var s = !1
  46772. , l = e[o]
  46773. , c = e[o + 1];
  46774. if (l !== c && (1 !== o || l !== l[0]))
  46775. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46776. var f = t[h + p];
  46777. if (f !== t[u + p] || f !== t[d + p]) {
  46778. s = !0;
  46779. break
  46780. }
  46781. }
  46782. if (s) {
  46783. if (o !== r) {
  46784. e[r] = e[o];
  46785. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46786. t[m + p] = t[g + p]
  46787. }
  46788. ++r
  46789. }
  46790. }
  46791. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46792. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46793. this
  46794. }
  46795. },
  46796. Object.assign(n.KeyframeTrack, {
  46797. parse: function(e) {
  46798. if (void 0 === e.type)
  46799. throw new Error("track type undefined, can not parse");
  46800. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46801. if (void 0 === e.times) {
  46802. console.warn("legacy JSON format detected, converting");
  46803. var i = []
  46804. , r = [];
  46805. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46806. e.times = i,
  46807. e.values = r
  46808. }
  46809. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46810. },
  46811. toJSON: function(e) {
  46812. var t, i = e.constructor;
  46813. if (void 0 !== i.toJSON)
  46814. t = i.toJSON(e);
  46815. else {
  46816. t = {
  46817. name: e.name,
  46818. times: n.AnimationUtils.convertArray(e.times, Array),
  46819. values: n.AnimationUtils.convertArray(e.values, Array)
  46820. };
  46821. var r = e.getInterpolation();
  46822. r !== e.DefaultInterpolation && (t.interpolation = r)
  46823. }
  46824. return t.type = e.ValueTypeName,
  46825. t
  46826. },
  46827. _getTrackTypeForValueTypeName: function(e) {
  46828. switch (e.toLowerCase()) {
  46829. case "scalar":
  46830. case "double":
  46831. case "float":
  46832. case "number":
  46833. case "integer":
  46834. return n.NumberKeyframeTrack;
  46835. case "vector":
  46836. case "vector2":
  46837. case "vector3":
  46838. case "vector4":
  46839. return n.VectorKeyframeTrack;
  46840. case "color":
  46841. return n.ColorKeyframeTrack;
  46842. case "quaternion":
  46843. return n.QuaternionKeyframeTrack;
  46844. case "bool":
  46845. case "boolean":
  46846. return n.BooleanKeyframeTrack;
  46847. case "string":
  46848. return n.StringKeyframeTrack
  46849. }
  46850. throw new Error("Unsupported typeName: " + e)
  46851. }
  46852. }),
  46853. n.PropertyBinding = function(e, t, i) {
  46854. this.path = t,
  46855. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46856. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46857. this.rootNode = e
  46858. }
  46859. ,
  46860. n.PropertyBinding.prototype = {
  46861. constructor: n.PropertyBinding,
  46862. getValue: function(e, t) {
  46863. this.bind(),
  46864. this.getValue(e, t)
  46865. },
  46866. setValue: function(e, t) {
  46867. this.bind(),
  46868. this.setValue(e, t)
  46869. },
  46870. bind: function() {
  46871. var e = this.node
  46872. , t = this.parsedPath
  46873. , i = t.objectName
  46874. , r = t.propertyName
  46875. , o = t.propertyIndex;
  46876. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46877. this.node = e),
  46878. this.getValue = this._getValue_unavailable,
  46879. this.setValue = this._setValue_unavailable,
  46880. !e)
  46881. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46882. if (i) {
  46883. var a = t.objectIndex;
  46884. switch (i) {
  46885. case "materials":
  46886. if (!e.material)
  46887. return void console.error(" can not bind to material as node does not have a material", this);
  46888. if (!e.material.materials)
  46889. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46890. e = e.material.materials;
  46891. break;
  46892. case "bones":
  46893. if (!e.skeleton)
  46894. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46895. e = e.skeleton.bones;
  46896. for (var s = 0; s < e.length; s++)
  46897. if (e[s].name === a) {
  46898. a = s;
  46899. break
  46900. }
  46901. break;
  46902. default:
  46903. if (void 0 === e[i])
  46904. return void console.error(" can not bind to objectName of node, undefined", this);
  46905. e = e[i]
  46906. }
  46907. if (void 0 !== a) {
  46908. if (void 0 === e[a])
  46909. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46910. e = e[a]
  46911. }
  46912. }
  46913. var l = e[r];
  46914. if (!l) {
  46915. var c = t.nodeName;
  46916. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46917. }
  46918. var h = this.Versioning.None;
  46919. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46920. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46921. this.targetObject = e);
  46922. var u = this.BindingType.Direct;
  46923. if (void 0 !== o) {
  46924. if ("morphTargetInfluences" === r) {
  46925. if (!e.geometry)
  46926. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46927. if (!e.geometry.morphTargets)
  46928. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46929. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46930. if (e.geometry.morphTargets[s].name === o) {
  46931. o = s;
  46932. break
  46933. }
  46934. }
  46935. u = this.BindingType.ArrayElement,
  46936. this.resolvedProperty = l,
  46937. this.propertyIndex = o
  46938. } else
  46939. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46940. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46941. this.resolvedProperty = l) : this.propertyName = r;
  46942. this.getValue = this.GetterByBindingType[u],
  46943. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46944. },
  46945. unbind: function() {
  46946. this.node = null,
  46947. this.getValue = this._getValue_unbound,
  46948. this.setValue = this._setValue_unbound
  46949. }
  46950. },
  46951. Object.assign(n.PropertyBinding.prototype, {
  46952. _getValue_unavailable: function() {},
  46953. _setValue_unavailable: function() {},
  46954. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46955. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46956. BindingType: {
  46957. Direct: 0,
  46958. EntireArray: 1,
  46959. ArrayElement: 2,
  46960. HasFromToArray: 3
  46961. },
  46962. Versioning: {
  46963. None: 0,
  46964. NeedsUpdate: 1,
  46965. MatrixWorldNeedsUpdate: 2
  46966. },
  46967. GetterByBindingType: [function(e, t) {
  46968. e[t] = this.node[this.propertyName]
  46969. }
  46970. , function(e, t) {
  46971. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46972. e[t++] = i[n]
  46973. }
  46974. , function(e, t) {
  46975. e[t] = this.resolvedProperty[this.propertyIndex]
  46976. }
  46977. , function(e, t) {
  46978. this.resolvedProperty.toArray(e, t)
  46979. }
  46980. ],
  46981. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46982. this.node[this.propertyName] = e[t]
  46983. }
  46984. , function(e, t) {
  46985. this.node[this.propertyName] = e[t],
  46986. this.targetObject.needsUpdate = !0
  46987. }
  46988. , function(e, t) {
  46989. this.node[this.propertyName] = e[t],
  46990. this.targetObject.matrixWorldNeedsUpdate = !0
  46991. }
  46992. ], [function(e, t) {
  46993. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46994. i[n] = e[t++]
  46995. }
  46996. , function(e, t) {
  46997. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46998. i[n] = e[t++];
  46999. this.targetObject.needsUpdate = !0
  47000. }
  47001. , function(e, t) {
  47002. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47003. i[n] = e[t++];
  47004. this.targetObject.matrixWorldNeedsUpdate = !0
  47005. }
  47006. ], [function(e, t) {
  47007. this.resolvedProperty[this.propertyIndex] = e[t]
  47008. }
  47009. , function(e, t) {
  47010. this.resolvedProperty[this.propertyIndex] = e[t],
  47011. this.targetObject.needsUpdate = !0
  47012. }
  47013. , function(e, t) {
  47014. this.resolvedProperty[this.propertyIndex] = e[t],
  47015. this.targetObject.matrixWorldNeedsUpdate = !0
  47016. }
  47017. ], [function(e, t) {
  47018. this.resolvedProperty.fromArray(e, t)
  47019. }
  47020. , function(e, t) {
  47021. this.resolvedProperty.fromArray(e, t),
  47022. this.targetObject.needsUpdate = !0
  47023. }
  47024. , function(e, t) {
  47025. this.resolvedProperty.fromArray(e, t),
  47026. this.targetObject.matrixWorldNeedsUpdate = !0
  47027. }
  47028. ]]
  47029. }),
  47030. n.PropertyBinding.Composite = function(e, t, i) {
  47031. var r = i || n.PropertyBinding.parseTrackName(t);
  47032. this._targetGroup = e,
  47033. this._bindings = e.subscribe_(t, r)
  47034. }
  47035. ,
  47036. n.PropertyBinding.Composite.prototype = {
  47037. constructor: n.PropertyBinding.Composite,
  47038. getValue: function(e, t) {
  47039. this.bind();
  47040. var i = this._targetGroup.nCachedObjects_
  47041. , n = this._bindings[i];
  47042. void 0 !== n && n.getValue(e, t)
  47043. },
  47044. setValue: function(e, t) {
  47045. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47046. i[n].setValue(e, t)
  47047. },
  47048. bind: function() {
  47049. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47050. e[t].bind()
  47051. },
  47052. unbind: function() {
  47053. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47054. e[t].unbind()
  47055. }
  47056. },
  47057. n.PropertyBinding.create = function(e, t, i) {
  47058. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47059. }
  47060. ,
  47061. n.PropertyBinding.parseTrackName = function(e) {
  47062. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47063. , i = t.exec(e);
  47064. if (!i)
  47065. throw new Error("cannot parse trackName at all: " + e);
  47066. i.index === t.lastIndex && t.lastIndex++;
  47067. var n = {
  47068. nodeName: i[3],
  47069. objectName: i[5],
  47070. objectIndex: i[7],
  47071. propertyName: i[9],
  47072. propertyIndex: i[11]
  47073. };
  47074. if (null === n.propertyName || 0 === n.propertyName.length)
  47075. throw new Error("can not parse propertyName from trackName: " + e);
  47076. return n
  47077. }
  47078. ,
  47079. n.PropertyBinding.findNode = function(e, t) {
  47080. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47081. return e;
  47082. if (e.skeleton) {
  47083. var i = function(e) {
  47084. for (var i = 0; i < e.bones.length; i++) {
  47085. var n = e.bones[i];
  47086. if (n.name === t)
  47087. return n
  47088. }
  47089. return null
  47090. }
  47091. , n = i(e.skeleton);
  47092. if (n)
  47093. return n
  47094. }
  47095. if (e.children) {
  47096. var r = function(e) {
  47097. for (var i = 0; i < e.length; i++) {
  47098. var n = e[i];
  47099. if (n.name === t || n.uuid === t)
  47100. return n;
  47101. var o = r(n.children);
  47102. if (o)
  47103. return o
  47104. }
  47105. return null
  47106. }
  47107. , o = r(e.children);
  47108. if (o)
  47109. return o
  47110. }
  47111. return null
  47112. }
  47113. ,
  47114. n.PropertyMixer = function(e, t, i) {
  47115. this.binding = e,
  47116. this.valueSize = i;
  47117. var n, r = Float64Array;
  47118. switch (t) {
  47119. case "quaternion":
  47120. n = this._slerp;
  47121. break;
  47122. case "string":
  47123. case "bool":
  47124. r = Array,
  47125. n = this._select;
  47126. break;
  47127. default:
  47128. n = this._lerp
  47129. }
  47130. this.buffer = new r(4 * i),
  47131. this._mixBufferRegion = n,
  47132. this.cumulativeWeight = 0,
  47133. this.useCount = 0,
  47134. this.referenceCount = 0
  47135. }
  47136. ,
  47137. n.PropertyMixer.prototype = {
  47138. constructor: n.PropertyMixer,
  47139. accumulate: function(e, t) {
  47140. var i = this.buffer
  47141. , n = this.valueSize
  47142. , r = e * n + n
  47143. , o = this.cumulativeWeight;
  47144. if (0 === o) {
  47145. for (var a = 0; a !== n; ++a)
  47146. i[r + a] = i[a];
  47147. o = t
  47148. } else {
  47149. o += t;
  47150. var s = t / o;
  47151. this._mixBufferRegion(i, r, 0, s, n)
  47152. }
  47153. this.cumulativeWeight = o
  47154. },
  47155. apply: function(e) {
  47156. var t = this.valueSize
  47157. , i = this.buffer
  47158. , n = e * t + t
  47159. , r = this.cumulativeWeight
  47160. , o = this.binding;
  47161. if (this.cumulativeWeight = 0,
  47162. r < 1) {
  47163. var a = 3 * t;
  47164. this._mixBufferRegion(i, n, a, 1 - r, t)
  47165. }
  47166. for (var s = t, l = t + t; s !== l; ++s)
  47167. if (i[s] !== i[s + t]) {
  47168. o.setValue(i, n);
  47169. break
  47170. }
  47171. },
  47172. saveOriginalState: function() {
  47173. var e = this.binding
  47174. , t = this.buffer
  47175. , i = this.valueSize
  47176. , n = 3 * i;
  47177. e.getValue(t, n);
  47178. for (var r = i, o = n; r !== o; ++r)
  47179. t[r] = t[n + r % i];
  47180. this.cumulativeWeight = 0
  47181. },
  47182. restoreOriginalState: function() {
  47183. var e = 3 * this.valueSize;
  47184. this.binding.setValue(this.buffer, e)
  47185. },
  47186. _select: function(e, t, i, n, r) {
  47187. if (n >= .5)
  47188. for (var o = 0; o !== r; ++o)
  47189. e[t + o] = e[i + o]
  47190. },
  47191. _slerp: function(e, t, i, r, o) {
  47192. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47193. },
  47194. _lerp: function(e, t, i, n, r) {
  47195. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47196. var s = t + a;
  47197. e[s] = e[s] * o + e[i + a] * n
  47198. }
  47199. }
  47200. },
  47201. n.BooleanKeyframeTrack = function(e, t, i) {
  47202. n.KeyframeTrack.call(this, e, t, i)
  47203. }
  47204. ,
  47205. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47206. constructor: n.BooleanKeyframeTrack,
  47207. ValueTypeName: "bool",
  47208. ValueBufferType: Array,
  47209. DefaultInterpolation: n.IntepolateDiscrete,
  47210. InterpolantFactoryMethodLinear: void 0,
  47211. InterpolantFactoryMethodSmooth: void 0
  47212. }),
  47213. n.NumberKeyframeTrack = function(e, t, i, r) {
  47214. n.KeyframeTrack.call(this, e, t, i, r)
  47215. }
  47216. ,
  47217. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47218. constructor: n.NumberKeyframeTrack,
  47219. ValueTypeName: "number"
  47220. }),
  47221. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47222. n.KeyframeTrack.call(this, e, t, i, r)
  47223. }
  47224. ,
  47225. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47226. constructor: n.QuaternionKeyframeTrack,
  47227. ValueTypeName: "quaternion",
  47228. DefaultInterpolation: n.InterpolateLinear,
  47229. InterpolantFactoryMethodLinear: function(e) {
  47230. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47231. },
  47232. InterpolantFactoryMethodSmooth: void 0
  47233. }),
  47234. n.StringKeyframeTrack = function(e, t, i, r) {
  47235. n.KeyframeTrack.call(this, e, t, i, r)
  47236. }
  47237. ,
  47238. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47239. constructor: n.StringKeyframeTrack,
  47240. ValueTypeName: "string",
  47241. ValueBufferType: Array,
  47242. DefaultInterpolation: n.IntepolateDiscrete,
  47243. InterpolantFactoryMethodLinear: void 0,
  47244. InterpolantFactoryMethodSmooth: void 0
  47245. }),
  47246. n.VectorKeyframeTrack = function(e, t, i, r) {
  47247. n.KeyframeTrack.call(this, e, t, i, r)
  47248. }
  47249. ,
  47250. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47251. constructor: n.VectorKeyframeTrack,
  47252. ValueTypeName: "vector"
  47253. }),
  47254. n.Audio = function(e) {
  47255. n.Object3D.call(this),
  47256. this.type = "Audio",
  47257. this.context = e.context,
  47258. this.source = this.context.createBufferSource(),
  47259. this.source.onended = this.onEnded.bind(this),
  47260. this.gain = this.context.createGain(),
  47261. this.gain.connect(e.getInput()),
  47262. this.autoplay = !1,
  47263. this.startTime = 0,
  47264. this.playbackRate = 1,
  47265. this.isPlaying = !1,
  47266. this.hasPlaybackControl = !0,
  47267. this.sourceType = "empty",
  47268. this.filter = null
  47269. }
  47270. ,
  47271. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47272. n.Audio.prototype.constructor = n.Audio,
  47273. n.Audio.prototype.getOutput = function() {
  47274. return this.gain
  47275. }
  47276. ,
  47277. n.Audio.prototype.load = function(e) {
  47278. var t = new n.AudioBuffer(this.context);
  47279. return t.load(e),
  47280. this.setBuffer(t),
  47281. this
  47282. }
  47283. ,
  47284. n.Audio.prototype.setNodeSource = function(e) {
  47285. return this.hasPlaybackControl = !1,
  47286. this.sourceType = "audioNode",
  47287. this.source = e,
  47288. this.connect(),
  47289. this
  47290. }
  47291. ,
  47292. n.Audio.prototype.setBuffer = function(e) {
  47293. var t = this;
  47294. return e.onReady(function(e) {
  47295. t.source.buffer = e,
  47296. t.sourceType = "buffer",
  47297. t.autoplay && t.play()
  47298. }),
  47299. this
  47300. }
  47301. ,
  47302. n.Audio.prototype.play = function() {
  47303. if (this.isPlaying === !0)
  47304. return void console.warn("THREE.Audio: Audio is already playing.");
  47305. if (this.hasPlaybackControl === !1)
  47306. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47307. var e = this.context.createBufferSource();
  47308. e.buffer = this.source.buffer,
  47309. e.loop = this.source.loop,
  47310. e.onended = this.source.onended,
  47311. e.start(0, this.startTime),
  47312. e.playbackRate.value = this.playbackRate,
  47313. this.isPlaying = !0,
  47314. this.source = e,
  47315. this.connect()
  47316. }
  47317. ,
  47318. n.Audio.prototype.pause = function() {
  47319. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47320. void (this.startTime = this.context.currentTime))
  47321. }
  47322. ,
  47323. n.Audio.prototype.stop = function() {
  47324. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47325. void (this.startTime = 0))
  47326. }
  47327. ,
  47328. n.Audio.prototype.connect = function() {
  47329. null !== this.filter ? (this.source.connect(this.filter),
  47330. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47331. }
  47332. ,
  47333. n.Audio.prototype.disconnect = function() {
  47334. null !== this.filter ? (this.source.disconnect(this.filter),
  47335. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47336. }
  47337. ,
  47338. n.Audio.prototype.getFilter = function() {
  47339. return this.filter
  47340. }
  47341. ,
  47342. n.Audio.prototype.setFilter = function(e) {
  47343. void 0 === e && (e = null),
  47344. this.isPlaying === !0 ? (this.disconnect(),
  47345. this.filter = e,
  47346. this.connect()) : this.filter = e
  47347. }
  47348. ,
  47349. n.Audio.prototype.setPlaybackRate = function(e) {
  47350. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47351. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47352. }
  47353. ,
  47354. n.Audio.prototype.getPlaybackRate = function() {
  47355. return this.playbackRate
  47356. }
  47357. ,
  47358. n.Audio.prototype.onEnded = function() {
  47359. this.isPlaying = !1
  47360. }
  47361. ,
  47362. n.Audio.prototype.setLoop = function(e) {
  47363. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47364. }
  47365. ,
  47366. n.Audio.prototype.getLoop = function() {
  47367. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47368. !1) : this.source.loop
  47369. }
  47370. ,
  47371. n.Audio.prototype.setVolume = function(e) {
  47372. this.gain.gain.value = e
  47373. }
  47374. ,
  47375. n.Audio.prototype.getVolume = function() {
  47376. return this.gain.gain.value
  47377. }
  47378. ,
  47379. n.AudioAnalyser = function(e, t) {
  47380. this.analyser = e.context.createAnalyser(),
  47381. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47382. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47383. e.getOutput().connect(this.analyser)
  47384. }
  47385. ,
  47386. n.AudioAnalyser.prototype = {
  47387. constructor: n.AudioAnalyser,
  47388. getData: function() {
  47389. return this.analyser.getByteFrequencyData(this.data),
  47390. this.data
  47391. }
  47392. },
  47393. n.AudioBuffer = function(e) {
  47394. this.context = e,
  47395. this.ready = !1,
  47396. this.readyCallbacks = []
  47397. }
  47398. ,
  47399. n.AudioBuffer.prototype.load = function(e) {
  47400. var t = this
  47401. , i = new XMLHttpRequest;
  47402. return i.open("GET", e, !0),
  47403. i.responseType = "arraybuffer",
  47404. i.onload = function(e) {
  47405. t.context.decodeAudioData(this.response, function(e) {
  47406. t.buffer = e,
  47407. t.ready = !0;
  47408. for (var i = 0; i < t.readyCallbacks.length; i++)
  47409. t.readyCallbacks[i](t.buffer);
  47410. t.readyCallbacks = []
  47411. })
  47412. }
  47413. ,
  47414. i.send(),
  47415. this
  47416. }
  47417. ,
  47418. n.AudioBuffer.prototype.onReady = function(e) {
  47419. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47420. }
  47421. ,
  47422. n.PositionalAudio = function(e) {
  47423. n.Audio.call(this, e),
  47424. this.panner = this.context.createPanner(),
  47425. this.panner.connect(this.gain)
  47426. }
  47427. ,
  47428. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47429. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47430. n.PositionalAudio.prototype.getOutput = function() {
  47431. return this.panner
  47432. }
  47433. ,
  47434. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47435. this.panner.refDistance = e
  47436. }
  47437. ,
  47438. n.PositionalAudio.prototype.getRefDistance = function() {
  47439. return this.panner.refDistance
  47440. }
  47441. ,
  47442. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47443. this.panner.rolloffFactor = e
  47444. }
  47445. ,
  47446. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47447. return this.panner.rolloffFactor
  47448. }
  47449. ,
  47450. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47451. this.panner.distanceModel = e
  47452. }
  47453. ,
  47454. n.PositionalAudio.prototype.getDistanceModel = function() {
  47455. return this.panner.distanceModel
  47456. }
  47457. ,
  47458. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47459. this.panner.maxDistance = e
  47460. }
  47461. ,
  47462. n.PositionalAudio.prototype.getMaxDistance = function() {
  47463. return this.panner.maxDistance
  47464. }
  47465. ,
  47466. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47467. var e = new n.Vector3;
  47468. return function(t) {
  47469. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47470. e.setFromMatrixPosition(this.matrixWorld),
  47471. this.panner.setPosition(e.x, e.y, e.z)
  47472. }
  47473. }(),
  47474. n.AudioListener = function() {
  47475. n.Object3D.call(this),
  47476. this.type = "AudioListener",
  47477. this.context = new (window.AudioContext || window.webkitAudioContext),
  47478. this.gain = this.context.createGain(),
  47479. this.gain.connect(this.context.destination),
  47480. this.filter = null
  47481. }
  47482. ,
  47483. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47484. n.AudioListener.prototype.constructor = n.AudioListener,
  47485. n.AudioListener.prototype.getInput = function() {
  47486. return this.gain
  47487. }
  47488. ,
  47489. n.AudioListener.prototype.removeFilter = function() {
  47490. null !== this.filter && (this.gain.disconnect(this.filter),
  47491. this.filter.disconnect(this.context.destination),
  47492. this.gain.connect(this.context.destination),
  47493. this.filter = null)
  47494. }
  47495. ,
  47496. n.AudioListener.prototype.setFilter = function(e) {
  47497. null !== this.filter ? (this.gain.disconnect(this.filter),
  47498. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47499. this.filter = e,
  47500. this.gain.connect(this.filter),
  47501. this.filter.connect(this.context.destination)
  47502. }
  47503. ,
  47504. n.AudioListener.prototype.getFilter = function() {
  47505. return this.filter
  47506. }
  47507. ,
  47508. n.AudioListener.prototype.setMasterVolume = function(e) {
  47509. this.gain.gain.value = e
  47510. }
  47511. ,
  47512. n.AudioListener.prototype.getMasterVolume = function() {
  47513. return this.gain.gain.value
  47514. }
  47515. ,
  47516. n.AudioListener.prototype.updateMatrixWorld = function() {
  47517. var e = new n.Vector3
  47518. , t = new n.Quaternion
  47519. , i = new n.Vector3
  47520. , r = new n.Vector3;
  47521. return function(o) {
  47522. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47523. var a = this.context.listener
  47524. , s = this.up;
  47525. this.matrixWorld.decompose(e, t, i),
  47526. r.set(0, 0, -1).applyQuaternion(t),
  47527. a.setPosition(e.x, e.y, e.z),
  47528. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47529. }
  47530. }(),
  47531. n.Camera = function() {
  47532. n.Object3D.call(this),
  47533. this.type = "Camera",
  47534. this.matrixWorldInverse = new n.Matrix4,
  47535. this.projectionMatrix = new n.Matrix4
  47536. }
  47537. ,
  47538. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47539. n.Camera.prototype.constructor = n.Camera,
  47540. n.Camera.prototype.getWorldDirection = function() {
  47541. var e = new n.Quaternion;
  47542. return function(t) {
  47543. var i = t || new n.Vector3;
  47544. return this.getWorldQuaternion(e),
  47545. i.set(0, 0, -1).applyQuaternion(e)
  47546. }
  47547. }(),
  47548. n.Camera.prototype.lookAt = function() {
  47549. var e = new n.Matrix4;
  47550. return function(t) {
  47551. e.lookAt(this.position, t, this.up),
  47552. this.quaternion.setFromRotationMatrix(e)
  47553. }
  47554. }(),
  47555. n.Camera.prototype.clone = function() {
  47556. return (new this.constructor).copy(this)
  47557. }
  47558. ,
  47559. n.Camera.prototype.copy = function(e) {
  47560. return n.Object3D.prototype.copy.call(this, e),
  47561. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47562. this.projectionMatrix.copy(e.projectionMatrix),
  47563. this
  47564. }
  47565. ,
  47566. n.CubeCamera = function(e, t, i) {
  47567. n.Object3D.call(this),
  47568. this.type = "CubeCamera";
  47569. var r = 90
  47570. , o = 1
  47571. , a = new n.PerspectiveCamera(r,o,e,t);
  47572. a.up.set(0, -1, 0),
  47573. a.lookAt(new n.Vector3(1,0,0)),
  47574. this.add(a);
  47575. var s = new n.PerspectiveCamera(r,o,e,t);
  47576. s.up.set(0, -1, 0),
  47577. s.lookAt(new n.Vector3(-1,0,0)),
  47578. this.add(s);
  47579. var l = new n.PerspectiveCamera(r,o,e,t);
  47580. l.up.set(0, 0, 1),
  47581. l.lookAt(new n.Vector3(0,1,0)),
  47582. this.add(l);
  47583. var c = new n.PerspectiveCamera(r,o,e,t);
  47584. c.up.set(0, 0, -1),
  47585. c.lookAt(new n.Vector3(0,-1,0)),
  47586. this.add(c);
  47587. var h = new n.PerspectiveCamera(r,o,e,t);
  47588. h.up.set(0, -1, 0),
  47589. h.lookAt(new n.Vector3(0,0,1)),
  47590. this.add(h);
  47591. var u = new n.PerspectiveCamera(r,o,e,t);
  47592. u.up.set(0, -1, 0),
  47593. u.lookAt(new n.Vector3(0,0,-1)),
  47594. this.add(u);
  47595. var d = {
  47596. format: n.RGBFormat,
  47597. magFilter: n.LinearFilter,
  47598. minFilter: n.LinearFilter
  47599. };
  47600. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47601. this.updateCubeMap = function(e, t) {
  47602. null === this.parent && this.updateMatrixWorld();
  47603. var i = this.renderTarget
  47604. , n = i.texture.generateMipmaps;
  47605. i.texture.generateMipmaps = !1,
  47606. i.activeCubeFace = 0,
  47607. e.render(t, a, i),
  47608. i.activeCubeFace = 1,
  47609. e.render(t, s, i),
  47610. i.activeCubeFace = 2,
  47611. e.render(t, l, i),
  47612. i.activeCubeFace = 3,
  47613. e.render(t, c, i),
  47614. i.activeCubeFace = 4,
  47615. e.render(t, h, i),
  47616. i.texture.generateMipmaps = n,
  47617. i.activeCubeFace = 5,
  47618. e.render(t, u, i),
  47619. e.setRenderTarget(null)
  47620. }
  47621. }
  47622. ,
  47623. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47624. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47625. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47626. n.Camera.call(this),
  47627. this.type = "OrthographicCamera",
  47628. this.zoom = 1,
  47629. this.left = e,
  47630. this.right = t,
  47631. this.top = i,
  47632. this.bottom = r,
  47633. this.near = void 0 !== o ? o : .1,
  47634. this.far = void 0 !== a ? a : 2e3,
  47635. this.updateProjectionMatrix()
  47636. }
  47637. ,
  47638. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47639. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47640. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47641. var e = (this.right - this.left) / (2 * this.zoom)
  47642. , t = (this.top - this.bottom) / (2 * this.zoom)
  47643. , i = (this.right + this.left) / 2
  47644. , n = (this.top + this.bottom) / 2;
  47645. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47646. }
  47647. ,
  47648. n.OrthographicCamera.prototype.copy = function(e) {
  47649. return n.Camera.prototype.copy.call(this, e),
  47650. this.left = e.left,
  47651. this.right = e.right,
  47652. this.top = e.top,
  47653. this.bottom = e.bottom,
  47654. this.near = e.near,
  47655. this.far = e.far,
  47656. this.zoom = e.zoom,
  47657. this
  47658. }
  47659. ,
  47660. n.OrthographicCamera.prototype.toJSON = function(e) {
  47661. var t = n.Object3D.prototype.toJSON.call(this, e);
  47662. return t.object.zoom = this.zoom,
  47663. t.object.left = this.left,
  47664. t.object.right = this.right,
  47665. t.object.top = this.top,
  47666. t.object.bottom = this.bottom,
  47667. t.object.near = this.near,
  47668. t.object.far = this.far,
  47669. t
  47670. }
  47671. ,
  47672. n.PerspectiveCamera = function(e, t, i, r) {
  47673. n.Camera.call(this),
  47674. this.type = "PerspectiveCamera",
  47675. this.focalLength = 10,
  47676. this.zoom = 1,
  47677. this.fov = void 0 !== e ? e : 50,
  47678. this.aspect = void 0 !== t ? t : 1,
  47679. this.near = void 0 !== i ? i : .1,
  47680. this.far = void 0 !== r ? r : 2e3,
  47681. this.updateProjectionMatrix()
  47682. }
  47683. ,
  47684. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47685. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47686. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47687. void 0 === t && (t = 24),
  47688. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47689. this.updateProjectionMatrix()
  47690. }
  47691. ,
  47692. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47693. this.fullWidth = e,
  47694. this.fullHeight = t,
  47695. this.x = i,
  47696. this.y = n,
  47697. this.width = r,
  47698. this.height = o,
  47699. this.updateProjectionMatrix()
  47700. }
  47701. ,
  47702. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47703. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47704. if (this.fullWidth) {
  47705. var t = this.fullWidth / this.fullHeight
  47706. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47707. , r = -i
  47708. , o = t * r
  47709. , a = t * i
  47710. , s = Math.abs(a - o)
  47711. , l = Math.abs(i - r);
  47712. 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)
  47713. } else
  47714. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47715. }
  47716. ,
  47717. n.PerspectiveCamera.prototype.copy = function(e) {
  47718. return n.Camera.prototype.copy.call(this, e),
  47719. this.focalLength = e.focalLength,
  47720. this.zoom = e.zoom,
  47721. this.fov = e.fov,
  47722. this.aspect = e.aspect,
  47723. this.near = e.near,
  47724. this.far = e.far,
  47725. this
  47726. }
  47727. ,
  47728. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47729. var t = n.Object3D.prototype.toJSON.call(this, e);
  47730. return t.object.focalLength = this.focalLength,
  47731. t.object.zoom = this.zoom,
  47732. t.object.fov = this.fov,
  47733. t.object.aspect = this.aspect,
  47734. t.object.near = this.near,
  47735. t.object.far = this.far,
  47736. t
  47737. }
  47738. ,
  47739. n.StereoCamera = function() {
  47740. this.type = "StereoCamera",
  47741. this.aspect = 1,
  47742. this.cameraL = new n.PerspectiveCamera,
  47743. this.cameraL.layers.enable(1),
  47744. this.cameraL.matrixAutoUpdate = !1,
  47745. this.cameraR = new n.PerspectiveCamera,
  47746. this.cameraR.layers.enable(2),
  47747. this.cameraR.matrixAutoUpdate = !1
  47748. }
  47749. ,
  47750. n.StereoCamera.prototype = {
  47751. constructor: n.StereoCamera,
  47752. update: function() {
  47753. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47754. return function(l) {
  47755. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47756. if (c) {
  47757. e = l.focalLength,
  47758. t = l.fov,
  47759. i = l.aspect * this.aspect,
  47760. r = l.near,
  47761. o = l.far;
  47762. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47763. s.elements[12] = -p,
  47764. a.elements[12] = p,
  47765. h = -g * i + f,
  47766. u = g * i + f,
  47767. d.elements[0] = 2 * r / (u - h),
  47768. d.elements[8] = (u + h) / (u - h),
  47769. this.cameraL.projectionMatrix.copy(d),
  47770. h = -g * i - f,
  47771. u = g * i - f,
  47772. d.elements[0] = 2 * r / (u - h),
  47773. d.elements[8] = (u + h) / (u - h),
  47774. this.cameraR.projectionMatrix.copy(d)
  47775. }
  47776. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47777. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47778. }
  47779. }()
  47780. },
  47781. n.Light = function(e, t) {
  47782. n.Object3D.call(this),
  47783. this.type = "Light",
  47784. this.color = new n.Color(e),
  47785. this.intensity = void 0 !== t ? t : 1,
  47786. this.receiveShadow = void 0
  47787. }
  47788. ,
  47789. n.Light.prototype = Object.create(n.Object3D.prototype),
  47790. n.Light.prototype.constructor = n.Light,
  47791. n.Light.prototype.copy = function(e) {
  47792. return n.Object3D.prototype.copy.call(this, e),
  47793. this.color.copy(e.color),
  47794. this.intensity = e.intensity,
  47795. this
  47796. }
  47797. ,
  47798. n.Light.prototype.toJSON = function(e) {
  47799. var t = n.Object3D.prototype.toJSON.call(this, e);
  47800. return t.object.color = this.color.getHex(),
  47801. t.object.intensity = this.intensity,
  47802. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47803. void 0 !== this.distance && (t.object.distance = this.distance),
  47804. void 0 !== this.angle && (t.object.angle = this.angle),
  47805. void 0 !== this.decay && (t.object.decay = this.decay),
  47806. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47807. t
  47808. }
  47809. ,
  47810. n.LightShadow = function(e) {
  47811. this.camera = e,
  47812. this.bias = 0,
  47813. this.radius = 1,
  47814. this.mapSize = new n.Vector2(512,512),
  47815. this.map = null,
  47816. this.matrix = new n.Matrix4
  47817. }
  47818. ,
  47819. n.LightShadow.prototype = {
  47820. constructor: n.LightShadow,
  47821. copy: function(e) {
  47822. return this.camera = e.camera.clone(),
  47823. this.bias = e.bias,
  47824. this.radius = e.radius,
  47825. this.mapSize.copy(e.mapSize),
  47826. this
  47827. },
  47828. clone: function() {
  47829. return (new this.constructor).copy(this)
  47830. }
  47831. },
  47832. n.AmbientLight = function(e, t) {
  47833. n.Light.call(this, e, t),
  47834. this.type = "AmbientLight",
  47835. this.castShadow = void 0
  47836. }
  47837. ,
  47838. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47839. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47840. n.DirectionalLight = function(e, t) {
  47841. n.Light.call(this, e, t),
  47842. this.type = "DirectionalLight",
  47843. this.position.set(0, 1, 0),
  47844. this.updateMatrix(),
  47845. this.target = new n.Object3D,
  47846. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47847. }
  47848. ,
  47849. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47850. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47851. n.DirectionalLight.prototype.copy = function(e) {
  47852. return n.Light.prototype.copy.call(this, e),
  47853. this.target = e.target.clone(),
  47854. this.shadow = e.shadow.clone(),
  47855. this
  47856. }
  47857. ,
  47858. n.HemisphereLight = function(e, t, i) {
  47859. n.Light.call(this, e, i),
  47860. this.type = "HemisphereLight",
  47861. this.castShadow = void 0,
  47862. this.position.set(0, 1, 0),
  47863. this.updateMatrix(),
  47864. this.groundColor = new n.Color(t)
  47865. }
  47866. ,
  47867. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47868. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47869. n.HemisphereLight.prototype.copy = function(e) {
  47870. return n.Light.prototype.copy.call(this, e),
  47871. this.groundColor.copy(e.groundColor),
  47872. this
  47873. }
  47874. ,
  47875. n.PointLight = function(e, t, i, r) {
  47876. n.Light.call(this, e, t),
  47877. this.type = "PointLight",
  47878. this.distance = void 0 !== i ? i : 0,
  47879. this.decay = void 0 !== r ? r : 1,
  47880. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47881. }
  47882. ,
  47883. n.PointLight.prototype = Object.create(n.Light.prototype),
  47884. n.PointLight.prototype.constructor = n.PointLight,
  47885. Object.defineProperty(n.PointLight.prototype, "power", {
  47886. get: function() {
  47887. return 4 * this.intensity * Math.PI
  47888. },
  47889. set: function(e) {
  47890. this.intensity = e / (4 * Math.PI)
  47891. }
  47892. }),
  47893. n.PointLight.prototype.copy = function(e) {
  47894. return n.Light.prototype.copy.call(this, e),
  47895. this.distance = e.distance,
  47896. this.decay = e.decay,
  47897. this.shadow = e.shadow.clone(),
  47898. this
  47899. }
  47900. ,
  47901. n.SpotLight = function(e, t, i, r, o, a) {
  47902. n.Light.call(this, e, t),
  47903. this.type = "SpotLight",
  47904. this.position.set(0, 1, 0),
  47905. this.updateMatrix(),
  47906. this.target = new n.Object3D,
  47907. this.distance = void 0 !== i ? i : 0,
  47908. this.angle = void 0 !== r ? r : Math.PI / 3,
  47909. this.penumbra = void 0 !== o ? o : 0,
  47910. this.decay = void 0 !== a ? a : 1,
  47911. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47912. }
  47913. ,
  47914. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47915. n.SpotLight.prototype.constructor = n.SpotLight,
  47916. Object.defineProperty(n.SpotLight.prototype, "power", {
  47917. get: function() {
  47918. return this.intensity * Math.PI
  47919. },
  47920. set: function(e) {
  47921. this.intensity = e / Math.PI
  47922. }
  47923. }),
  47924. n.SpotLight.prototype.copy = function(e) {
  47925. return n.Light.prototype.copy.call(this, e),
  47926. this.distance = e.distance,
  47927. this.angle = e.angle,
  47928. this.penumbra = e.penumbra,
  47929. this.decay = e.decay,
  47930. this.target = e.target.clone(),
  47931. this.shadow = e.shadow.clone(),
  47932. this
  47933. }
  47934. ,
  47935. n.Cache = {
  47936. enabled: !1,
  47937. files: {},
  47938. add: function(e, t) {
  47939. this.enabled !== !1 && (this.files[e] = t)
  47940. },
  47941. get: function(e) {
  47942. if (this.enabled !== !1)
  47943. return this.files[e]
  47944. },
  47945. remove: function(e) {
  47946. delete this.files[e]
  47947. },
  47948. clear: function() {
  47949. this.files = {}
  47950. }
  47951. },
  47952. n.Loader = function() {
  47953. this.onLoadStart = function() {}
  47954. ,
  47955. this.onLoadProgress = function() {}
  47956. ,
  47957. this.onLoadComplete = function() {}
  47958. }
  47959. ,
  47960. n.Loader.prototype = {
  47961. constructor: n.Loader,
  47962. crossOrigin: void 0,
  47963. extractUrlBase: function(e) {
  47964. var t = e.split("/");
  47965. return 1 === t.length ? "./" : (t.pop(),
  47966. t.join("/") + "/")
  47967. },
  47968. initMaterials: function(e, t, i) {
  47969. for (var n = [], r = 0; r < e.length; ++r)
  47970. n[r] = this.createMaterial(e[r], t, i);
  47971. return n
  47972. },
  47973. createMaterial: function() {
  47974. var e, t, i;
  47975. return function(r, o, a) {
  47976. function s(e, i, r, s, c) {
  47977. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47978. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47979. h = t.load(u)),
  47980. void 0 !== i && (h.repeat.fromArray(i),
  47981. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47982. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47983. void 0 !== r && h.offset.fromArray(r),
  47984. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47985. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47986. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47987. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47988. void 0 !== c && (h.anisotropy = c);
  47989. var p = n.Math.generateUUID();
  47990. return l[p] = h,
  47991. p
  47992. }
  47993. void 0 === e && (e = new n.Color),
  47994. void 0 === t && (t = new n.TextureLoader),
  47995. void 0 === i && (i = new n.MaterialLoader);
  47996. var l = {}
  47997. , c = {
  47998. uuid: n.Math.generateUUID(),
  47999. type: "MeshLambertMaterial"
  48000. };
  48001. for (var h in r) {
  48002. var u = r[h];
  48003. switch (h) {
  48004. case "DbgColor":
  48005. case "DbgIndex":
  48006. case "opticalDensity":
  48007. case "illumination":
  48008. break;
  48009. case "DbgName":
  48010. c.name = u;
  48011. break;
  48012. case "blending":
  48013. c.blending = n[u];
  48014. break;
  48015. case "colorAmbient":
  48016. case "mapAmbient":
  48017. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48018. break;
  48019. case "colorDiffuse":
  48020. c.color = e.fromArray(u).getHex();
  48021. break;
  48022. case "colorSpecular":
  48023. c.specular = e.fromArray(u).getHex();
  48024. break;
  48025. case "colorEmissive":
  48026. c.emissive = e.fromArray(u).getHex();
  48027. break;
  48028. case "specularCoef":
  48029. c.shininess = u;
  48030. break;
  48031. case "shading":
  48032. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48033. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48034. break;
  48035. case "mapDiffuse":
  48036. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48037. break;
  48038. case "mapDiffuseRepeat":
  48039. case "mapDiffuseOffset":
  48040. case "mapDiffuseWrap":
  48041. case "mapDiffuseAnisotropy":
  48042. break;
  48043. case "mapLight":
  48044. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48045. break;
  48046. case "mapLightRepeat":
  48047. case "mapLightOffset":
  48048. case "mapLightWrap":
  48049. case "mapLightAnisotropy":
  48050. break;
  48051. case "mapAO":
  48052. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48053. break;
  48054. case "mapAORepeat":
  48055. case "mapAOOffset":
  48056. case "mapAOWrap":
  48057. case "mapAOAnisotropy":
  48058. break;
  48059. case "mapBump":
  48060. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48061. break;
  48062. case "mapBumpScale":
  48063. c.bumpScale = u;
  48064. break;
  48065. case "mapBumpRepeat":
  48066. case "mapBumpOffset":
  48067. case "mapBumpWrap":
  48068. case "mapBumpAnisotropy":
  48069. break;
  48070. case "mapNormal":
  48071. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48072. break;
  48073. case "mapNormalFactor":
  48074. c.normalScale = [u, u];
  48075. break;
  48076. case "mapNormalRepeat":
  48077. case "mapNormalOffset":
  48078. case "mapNormalWrap":
  48079. case "mapNormalAnisotropy":
  48080. break;
  48081. case "mapSpecular":
  48082. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48083. break;
  48084. case "mapSpecularRepeat":
  48085. case "mapSpecularOffset":
  48086. case "mapSpecularWrap":
  48087. case "mapSpecularAnisotropy":
  48088. break;
  48089. case "mapAlpha":
  48090. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48091. break;
  48092. case "mapAlphaRepeat":
  48093. case "mapAlphaOffset":
  48094. case "mapAlphaWrap":
  48095. case "mapAlphaAnisotropy":
  48096. break;
  48097. case "flipSided":
  48098. c.side = n.BackSide;
  48099. break;
  48100. case "doubleSided":
  48101. c.side = n.DoubleSide;
  48102. break;
  48103. case "transparency":
  48104. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48105. c.opacity = u;
  48106. break;
  48107. case "depthTest":
  48108. case "depthWrite":
  48109. case "colorWrite":
  48110. case "opacity":
  48111. case "reflectivity":
  48112. case "transparent":
  48113. case "visible":
  48114. case "wireframe":
  48115. c[h] = u;
  48116. break;
  48117. case "vertexColors":
  48118. u === !0 && (c.vertexColors = n.VertexColors),
  48119. "face" === u && (c.vertexColors = n.FaceColors);
  48120. break;
  48121. default:
  48122. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48123. }
  48124. }
  48125. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48126. "MeshPhongMaterial" !== c.type && delete c.specular,
  48127. c.opacity < 1 && (c.transparent = !0),
  48128. i.setTextures(l),
  48129. i.parse(c)
  48130. }
  48131. }()
  48132. },
  48133. n.Loader.Handlers = {
  48134. handlers: [],
  48135. add: function(e, t) {
  48136. this.handlers.push(e, t)
  48137. },
  48138. get: function(e) {
  48139. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48140. var r = t[i]
  48141. , o = t[i + 1];
  48142. if (r.test(e))
  48143. return o
  48144. }
  48145. return null
  48146. }
  48147. },
  48148. n.XHRLoader = function(e) {
  48149. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48150. }
  48151. ,
  48152. n.XHRLoader.prototype = {
  48153. constructor: n.XHRLoader,
  48154. load: function(e, t, i, r) {
  48155. void 0 !== this.path && (e = this.path + e);
  48156. var o = this
  48157. , a = n.Cache.get(e);
  48158. if (void 0 !== a)
  48159. return t && setTimeout(function() {
  48160. t(a)
  48161. }, 0),
  48162. a;
  48163. var s = new XMLHttpRequest;
  48164. return s.overrideMimeType("text/plain"),
  48165. s.open("GET", e, !0),
  48166. s.addEventListener("load", function(i) {
  48167. var a = i.target.response;
  48168. n.Cache.add(e, a),
  48169. 200 === this.status ? (t && t(a),
  48170. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48171. t && t(a),
  48172. o.manager.itemEnd(e)) : (r && r(i),
  48173. o.manager.itemError(e))
  48174. }, !1),
  48175. void 0 !== i && s.addEventListener("progress", function(e) {
  48176. i(e)
  48177. }, !1),
  48178. s.addEventListener("error", function(t) {
  48179. r && r(t),
  48180. o.manager.itemError(e)
  48181. }, !1),
  48182. void 0 !== this.responseType && (s.responseType = this.responseType),
  48183. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48184. s.send(null),
  48185. o.manager.itemStart(e),
  48186. s
  48187. },
  48188. setPath: function(e) {
  48189. this.path = e
  48190. },
  48191. setResponseType: function(e) {
  48192. this.responseType = e
  48193. },
  48194. setWithCredentials: function(e) {
  48195. this.withCredentials = e
  48196. }
  48197. },
  48198. n.FontLoader = function(e) {
  48199. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48200. }
  48201. ,
  48202. n.FontLoader.prototype = {
  48203. constructor: n.FontLoader,
  48204. load: function(e, t, i, r) {
  48205. var o = new n.XHRLoader(this.manager);
  48206. o.load(e, function(e) {
  48207. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48208. }, i, r)
  48209. }
  48210. },
  48211. n.ImageLoader = function(e) {
  48212. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48213. }
  48214. ,
  48215. n.ImageLoader.prototype = {
  48216. constructor: n.ImageLoader,
  48217. load: function(e, t, i, r) {
  48218. void 0 !== this.path && (e = this.path + e);
  48219. var o = this
  48220. , a = n.Cache.get(e);
  48221. if (void 0 !== a)
  48222. return o.manager.itemStart(e),
  48223. t ? setTimeout(function() {
  48224. t(a),
  48225. o.manager.itemEnd(e)
  48226. }, 0) : o.manager.itemEnd(e),
  48227. a;
  48228. var s = document.createElement("img");
  48229. return s.addEventListener("load", function(i) {
  48230. n.Cache.add(e, this),
  48231. t && t(this),
  48232. o.manager.itemEnd(e)
  48233. }, !1),
  48234. void 0 !== i && s.addEventListener("progress", function(e) {
  48235. i(e)
  48236. }, !1),
  48237. s.addEventListener("error", function(t) {
  48238. r && r(t),
  48239. o.manager.itemError(e)
  48240. }, !1),
  48241. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48242. o.manager.itemStart(e),
  48243. s.src = e,
  48244. s
  48245. },
  48246. setCrossOrigin: function(e) {
  48247. this.crossOrigin = e
  48248. },
  48249. setPath: function(e) {
  48250. this.path = e
  48251. }
  48252. },
  48253. n.JSONLoader = function(e) {
  48254. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48255. e = void 0),
  48256. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48257. this.withCredentials = !1
  48258. }
  48259. ,
  48260. n.JSONLoader.prototype = {
  48261. constructor: n.JSONLoader,
  48262. get statusDomElement() {
  48263. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48264. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48265. this._statusDomElement
  48266. },
  48267. load: function(e, t, i, r) {
  48268. var o = this
  48269. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48270. , s = new n.XHRLoader(this.manager);
  48271. s.setWithCredentials(this.withCredentials),
  48272. s.load(e, function(i) {
  48273. var n = JSON.parse(i)
  48274. , r = n.metadata;
  48275. if (void 0 !== r) {
  48276. var s = r.type;
  48277. if (void 0 !== s) {
  48278. if ("object" === s.toLowerCase())
  48279. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48280. if ("scene" === s.toLowerCase())
  48281. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48282. }
  48283. }
  48284. var l = o.parse(n, a);
  48285. t(l.geometry, l.materials)
  48286. }, i, r)
  48287. },
  48288. setTexturePath: function(e) {
  48289. this.texturePath = e
  48290. },
  48291. parse: function(e, t) {
  48292. function i(t) {
  48293. function i(e, t) {
  48294. return e & 1 << t
  48295. }
  48296. 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;
  48297. if (void 0 !== e.uvs) {
  48298. for (r = 0; r < e.uvs.length; r++)
  48299. e.uvs[r].length && B++;
  48300. for (r = 0; r < B; r++)
  48301. s.faceVertexUvs[r] = []
  48302. }
  48303. for (l = 0,
  48304. c = L.length; l < c; )
  48305. E = new n.Vector3,
  48306. E.x = L[l++] * t,
  48307. E.y = L[l++] * t,
  48308. E.z = L[l++] * t,
  48309. s.vertices.push(E);
  48310. for (l = 0,
  48311. c = O.length; l < c; )
  48312. if (f = O[l++],
  48313. g = i(f, 0),
  48314. m = i(f, 1),
  48315. v = i(f, 3),
  48316. A = i(f, 4),
  48317. y = i(f, 5),
  48318. C = i(f, 6),
  48319. I = i(f, 7),
  48320. g) {
  48321. if (w = new n.Face3,
  48322. w.a = O[l],
  48323. w.b = O[l + 1],
  48324. w.c = O[l + 3],
  48325. _ = new n.Face3,
  48326. _.a = O[l + 1],
  48327. _.b = O[l + 2],
  48328. _.c = O[l + 3],
  48329. l += 4,
  48330. m && (p = O[l++],
  48331. w.materialIndex = p,
  48332. _.materialIndex = p),
  48333. a = s.faces.length,
  48334. v)
  48335. for (r = 0; r < B; r++)
  48336. for (S = e.uvs[r],
  48337. s.faceVertexUvs[r][a] = [],
  48338. s.faceVertexUvs[r][a + 1] = [],
  48339. o = 0; o < 4; o++)
  48340. d = O[l++],
  48341. R = S[2 * d],
  48342. P = S[2 * d + 1],
  48343. M = new n.Vector2(R,P),
  48344. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48345. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48346. if (A && (u = 3 * O[l++],
  48347. w.normal.set(D[u++], D[u++], D[u]),
  48348. _.normal.copy(w.normal)),
  48349. y)
  48350. for (r = 0; r < 4; r++)
  48351. u = 3 * O[l++],
  48352. x = new n.Vector3(D[u++],D[u++],D[u]),
  48353. 2 !== r && w.vertexNormals.push(x),
  48354. 0 !== r && _.vertexNormals.push(x);
  48355. if (C && (h = O[l++],
  48356. T = N[h],
  48357. w.color.setHex(T),
  48358. _.color.setHex(T)),
  48359. I)
  48360. for (r = 0; r < 4; r++)
  48361. h = O[l++],
  48362. T = N[h],
  48363. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48364. 0 !== r && _.vertexColors.push(new n.Color(T));
  48365. s.faces.push(w),
  48366. s.faces.push(_)
  48367. } else {
  48368. if (b = new n.Face3,
  48369. b.a = O[l++],
  48370. b.b = O[l++],
  48371. b.c = O[l++],
  48372. m && (p = O[l++],
  48373. b.materialIndex = p),
  48374. a = s.faces.length,
  48375. v)
  48376. for (r = 0; r < B; r++)
  48377. for (S = e.uvs[r],
  48378. s.faceVertexUvs[r][a] = [],
  48379. o = 0; o < 3; o++)
  48380. d = O[l++],
  48381. R = S[2 * d],
  48382. P = S[2 * d + 1],
  48383. M = new n.Vector2(R,P),
  48384. s.faceVertexUvs[r][a].push(M);
  48385. if (A && (u = 3 * O[l++],
  48386. b.normal.set(D[u++], D[u++], D[u])),
  48387. y)
  48388. for (r = 0; r < 3; r++)
  48389. u = 3 * O[l++],
  48390. x = new n.Vector3(D[u++],D[u++],D[u]),
  48391. b.vertexNormals.push(x);
  48392. if (C && (h = O[l++],
  48393. b.color.setHex(N[h])),
  48394. I)
  48395. for (r = 0; r < 3; r++)
  48396. h = O[l++],
  48397. b.vertexColors.push(new n.Color(N[h]));
  48398. s.faces.push(b)
  48399. }
  48400. }
  48401. function r() {
  48402. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48403. if (e.skinWeights)
  48404. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48405. var o = e.skinWeights[i]
  48406. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48407. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48408. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48409. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48410. }
  48411. if (e.skinIndices)
  48412. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48413. var h = e.skinIndices[i]
  48414. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48415. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48416. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48417. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48418. }
  48419. s.bones = e.bones,
  48420. 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.")
  48421. }
  48422. function o(t) {
  48423. if (void 0 !== e.morphTargets)
  48424. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48425. s.morphTargets[i] = {},
  48426. s.morphTargets[i].name = e.morphTargets[i].name,
  48427. s.morphTargets[i].vertices = [];
  48428. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48429. var h = new n.Vector3;
  48430. h.x = a[l] * t,
  48431. h.y = a[l + 1] * t,
  48432. h.z = a[l + 2] * t,
  48433. o.push(h)
  48434. }
  48435. }
  48436. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48437. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48438. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48439. u[i].color.fromArray(d, 3 * i)
  48440. }
  48441. }
  48442. function a() {
  48443. var t = []
  48444. , i = [];
  48445. void 0 !== e.animation && i.push(e.animation),
  48446. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48447. for (var r = 0; r < i.length; r++) {
  48448. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48449. o && t.push(o)
  48450. }
  48451. if (s.morphTargets) {
  48452. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48453. t = t.concat(a)
  48454. }
  48455. t.length > 0 && (s.animations = t)
  48456. }
  48457. var s = new n.Geometry
  48458. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48459. if (i(l),
  48460. r(),
  48461. o(l),
  48462. a(),
  48463. s.computeFaceNormals(),
  48464. s.computeBoundingSphere(),
  48465. void 0 === e.materials || 0 === e.materials.length)
  48466. return {
  48467. geometry: s
  48468. };
  48469. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48470. return {
  48471. geometry: s,
  48472. materials: c
  48473. }
  48474. }
  48475. },
  48476. n.LoadingManager = function(e, t, i) {
  48477. var n = this
  48478. , r = !1
  48479. , o = 0
  48480. , a = 0;
  48481. this.onStart = void 0,
  48482. this.onLoad = e,
  48483. this.onProgress = t,
  48484. this.onError = i,
  48485. this.itemStart = function(e) {
  48486. a++,
  48487. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48488. r = !0
  48489. }
  48490. ,
  48491. this.itemEnd = function(e) {
  48492. o++,
  48493. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48494. o === a && (r = !1,
  48495. void 0 !== n.onLoad && n.onLoad())
  48496. }
  48497. ,
  48498. this.itemError = function(e) {
  48499. void 0 !== n.onError && n.onError(e)
  48500. }
  48501. }
  48502. ,
  48503. n.DefaultLoadingManager = new n.LoadingManager,
  48504. n.BufferGeometryLoader = function(e) {
  48505. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48506. }
  48507. ,
  48508. n.BufferGeometryLoader.prototype = {
  48509. constructor: n.BufferGeometryLoader,
  48510. load: function(e, t, i, r) {
  48511. var o = this
  48512. , a = new n.XHRLoader(o.manager);
  48513. a.load(e, function(e) {
  48514. t(o.parse(JSON.parse(e)))
  48515. }, i, r)
  48516. },
  48517. parse: function(e) {
  48518. var t = new n.BufferGeometry
  48519. , i = e.data.index
  48520. , r = {
  48521. Int8Array: Int8Array,
  48522. Uint8Array: Uint8Array,
  48523. Uint8ClampedArray: Uint8ClampedArray,
  48524. Int16Array: Int16Array,
  48525. Uint16Array: Uint16Array,
  48526. Int32Array: Int32Array,
  48527. Uint32Array: Uint32Array,
  48528. Float32Array: Float32Array,
  48529. Float64Array: Float64Array
  48530. };
  48531. if (void 0 !== i) {
  48532. var o = new r[i.type](i.array);
  48533. t.setIndex(new n.BufferAttribute(o,1))
  48534. }
  48535. var a = e.data.attributes;
  48536. for (var s in a) {
  48537. var l = a[s]
  48538. , o = new r[l.type](l.array);
  48539. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48540. }
  48541. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48542. if (void 0 !== c)
  48543. for (var h = 0, u = c.length; h !== u; ++h) {
  48544. var d = c[h];
  48545. t.addGroup(d.start, d.count, d.materialIndex)
  48546. }
  48547. var p = e.data.boundingSphere;
  48548. if (void 0 !== p) {
  48549. var f = new n.Vector3;
  48550. void 0 !== p.center && f.fromArray(p.center),
  48551. t.boundingSphere = new n.Sphere(f,p.radius)
  48552. }
  48553. return t
  48554. }
  48555. },
  48556. n.MaterialLoader = function(e) {
  48557. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48558. this.textures = {}
  48559. }
  48560. ,
  48561. n.MaterialLoader.prototype = {
  48562. constructor: n.MaterialLoader,
  48563. load: function(e, t, i, r) {
  48564. var o = this
  48565. , a = new n.XHRLoader(o.manager);
  48566. a.load(e, function(e) {
  48567. t(o.parse(JSON.parse(e)))
  48568. }, i, r)
  48569. },
  48570. setTextures: function(e) {
  48571. this.textures = e
  48572. },
  48573. getTexture: function(e) {
  48574. var t = this.textures;
  48575. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48576. t[e]
  48577. },
  48578. parse: function(e) {
  48579. var t = new n[e.type];
  48580. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48581. void 0 !== e.name && (t.name = e.name),
  48582. void 0 !== e.color && t.color.setHex(e.color),
  48583. void 0 !== e.roughness && (t.roughness = e.roughness),
  48584. void 0 !== e.metalness && (t.metalness = e.metalness),
  48585. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48586. void 0 !== e.specular && t.specular.setHex(e.specular),
  48587. void 0 !== e.shininess && (t.shininess = e.shininess),
  48588. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48589. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48590. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48591. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48592. void 0 !== e.shading && (t.shading = e.shading),
  48593. void 0 !== e.blending && (t.blending = e.blending),
  48594. void 0 !== e.side && (t.side = e.side),
  48595. void 0 !== e.opacity && (t.opacity = e.opacity),
  48596. void 0 !== e.transparent && (t.transparent = e.transparent),
  48597. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48598. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48599. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48600. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48601. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48602. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48603. void 0 !== e.size && (t.size = e.size),
  48604. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48605. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48606. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48607. t.transparent = !0),
  48608. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48609. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48610. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48611. void 0 !== e.normalScale) {
  48612. var i = e.normalScale;
  48613. Array.isArray(i) === !1 && (i = [i, i]),
  48614. t.normalScale = (new n.Vector2).fromArray(i)
  48615. }
  48616. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48617. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48618. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48619. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48620. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48621. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48622. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48623. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48624. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48625. t.combine = n.MultiplyOperation),
  48626. e.reflectivity && (t.reflectivity = e.reflectivity),
  48627. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48628. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48629. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48630. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48631. void 0 !== e.materials)
  48632. for (var r = 0, o = e.materials.length; r < o; r++)
  48633. t.materials.push(this.parse(e.materials[r]));
  48634. return t
  48635. }
  48636. },
  48637. n.ObjectLoader = function(e) {
  48638. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48639. this.texturePath = ""
  48640. }
  48641. ,
  48642. n.ObjectLoader.prototype = {
  48643. constructor: n.ObjectLoader,
  48644. load: function(e, t, i, r) {
  48645. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48646. var o = this
  48647. , a = new n.XHRLoader(o.manager);
  48648. a.load(e, function(e) {
  48649. o.parse(JSON.parse(e), t)
  48650. }, i, r)
  48651. },
  48652. setTexturePath: function(e) {
  48653. this.texturePath = e
  48654. },
  48655. setCrossOrigin: function(e) {
  48656. this.crossOrigin = e
  48657. },
  48658. parse: function(e, t) {
  48659. var i = this.parseGeometries(e.geometries)
  48660. , n = this.parseImages(e.images, function() {
  48661. void 0 !== t && t(a)
  48662. })
  48663. , r = this.parseTextures(e.textures, n)
  48664. , o = this.parseMaterials(e.materials, r)
  48665. , a = this.parseObject(e.object, i, o);
  48666. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48667. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48668. a
  48669. },
  48670. parseGeometries: function(e) {
  48671. var t = {};
  48672. if (void 0 !== e)
  48673. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48674. var s, l = e[o];
  48675. switch (l.type) {
  48676. case "PlaneGeometry":
  48677. case "PlaneBufferGeometry":
  48678. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48679. break;
  48680. case "BoxGeometry":
  48681. case "BoxBufferGeometry":
  48682. case "CubeGeometry":
  48683. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48684. break;
  48685. case "CircleGeometry":
  48686. case "CircleBufferGeometry":
  48687. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48688. break;
  48689. case "CylinderGeometry":
  48690. case "CylinderBufferGeometry":
  48691. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48692. break;
  48693. case "SphereGeometry":
  48694. case "SphereBufferGeometry":
  48695. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48696. break;
  48697. case "DodecahedronGeometry":
  48698. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48699. break;
  48700. case "IcosahedronGeometry":
  48701. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48702. break;
  48703. case "OctahedronGeometry":
  48704. s = new n.OctahedronGeometry(l.radius,l.detail);
  48705. break;
  48706. case "TetrahedronGeometry":
  48707. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48708. break;
  48709. case "RingGeometry":
  48710. case "RingBufferGeometry":
  48711. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48712. break;
  48713. case "TorusGeometry":
  48714. case "TorusBufferGeometry":
  48715. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48716. break;
  48717. case "TorusKnotGeometry":
  48718. case "TorusKnotBufferGeometry":
  48719. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48720. break;
  48721. case "LatheGeometry":
  48722. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48723. break;
  48724. case "BufferGeometry":
  48725. s = r.parse(l);
  48726. break;
  48727. case "Geometry":
  48728. s = i.parse(l.data, this.texturePath).geometry;
  48729. break;
  48730. default:
  48731. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48732. continue
  48733. }
  48734. s.uuid = l.uuid,
  48735. void 0 !== l.name && (s.name = l.name),
  48736. t[l.uuid] = s
  48737. }
  48738. return t
  48739. },
  48740. parseMaterials: function(e, t) {
  48741. var i = {};
  48742. if (void 0 !== e) {
  48743. var r = new n.MaterialLoader;
  48744. r.setTextures(t);
  48745. for (var o = 0, a = e.length; o < a; o++) {
  48746. var s = r.parse(e[o]);
  48747. i[s.uuid] = s
  48748. }
  48749. }
  48750. return i
  48751. },
  48752. parseAnimations: function(e) {
  48753. for (var t = [], i = 0; i < e.length; i++) {
  48754. var r = n.AnimationClip.parse(e[i]);
  48755. t.push(r)
  48756. }
  48757. return t
  48758. },
  48759. parseImages: function(e, t) {
  48760. function i(e) {
  48761. return r.manager.itemStart(e),
  48762. s.load(e, function() {
  48763. r.manager.itemEnd(e)
  48764. })
  48765. }
  48766. var r = this
  48767. , o = {};
  48768. if (void 0 !== e && e.length > 0) {
  48769. var a = new n.LoadingManager(t)
  48770. , s = new n.ImageLoader(a);
  48771. s.setCrossOrigin(this.crossOrigin);
  48772. for (var l = 0, c = e.length; l < c; l++) {
  48773. var h = e[l]
  48774. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48775. o[h.uuid] = i(u)
  48776. }
  48777. }
  48778. return o
  48779. },
  48780. parseTextures: function(e, t) {
  48781. function i(e) {
  48782. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48783. n[e])
  48784. }
  48785. var r = {};
  48786. if (void 0 !== e)
  48787. for (var o = 0, a = e.length; o < a; o++) {
  48788. var s = e[o];
  48789. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48790. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48791. var l = new n.Texture(t[s.image]);
  48792. l.needsUpdate = !0,
  48793. l.uuid = s.uuid,
  48794. void 0 !== s.name && (l.name = s.name),
  48795. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48796. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48797. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48798. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48799. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48800. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48801. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48802. l.wrapT = i(s.wrap[1])),
  48803. r[s.uuid] = l
  48804. }
  48805. return r
  48806. },
  48807. parseObject: function() {
  48808. var e = new n.Matrix4;
  48809. return function(t, i, r) {
  48810. function o(e) {
  48811. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48812. i[e]
  48813. }
  48814. function a(e) {
  48815. if (void 0 !== e)
  48816. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48817. r[e]
  48818. }
  48819. var s;
  48820. switch (t.type) {
  48821. case "Scene":
  48822. s = new n.Scene;
  48823. break;
  48824. case "PerspectiveCamera":
  48825. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48826. break;
  48827. case "OrthographicCamera":
  48828. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48829. break;
  48830. case "AmbientLight":
  48831. s = new n.AmbientLight(t.color,t.intensity);
  48832. break;
  48833. case "DirectionalLight":
  48834. s = new n.DirectionalLight(t.color,t.intensity);
  48835. break;
  48836. case "PointLight":
  48837. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48838. break;
  48839. case "SpotLight":
  48840. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48841. break;
  48842. case "HemisphereLight":
  48843. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48844. break;
  48845. case "Mesh":
  48846. var l = o(t.geometry)
  48847. , c = a(t.material);
  48848. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48849. break;
  48850. case "LOD":
  48851. s = new n.LOD;
  48852. break;
  48853. case "Line":
  48854. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48855. break;
  48856. case "PointCloud":
  48857. case "Points":
  48858. s = new n.Points(o(t.geometry),a(t.material));
  48859. break;
  48860. case "Sprite":
  48861. s = new n.Sprite(a(t.material));
  48862. break;
  48863. case "Group":
  48864. s = new n.Group;
  48865. break;
  48866. default:
  48867. s = new n.Object3D
  48868. }
  48869. if (s.uuid = t.uuid,
  48870. void 0 !== t.name && (s.name = t.name),
  48871. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48872. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48873. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48874. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48875. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48876. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48877. void 0 !== t.visible && (s.visible = t.visible),
  48878. void 0 !== t.userData && (s.userData = t.userData),
  48879. void 0 !== t.children)
  48880. for (var h in t.children)
  48881. s.add(this.parseObject(t.children[h], i, r));
  48882. if ("LOD" === t.type)
  48883. for (var u = t.levels, d = 0; d < u.length; d++) {
  48884. var p = u[d]
  48885. , h = s.getObjectByProperty("uuid", p.object);
  48886. void 0 !== h && s.addLevel(h, p.distance)
  48887. }
  48888. return s
  48889. }
  48890. }()
  48891. },
  48892. n.TextureLoader = function(e) {
  48893. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48894. }
  48895. ,
  48896. n.TextureLoader.prototype = {
  48897. constructor: n.TextureLoader,
  48898. load: function(e, t, i, r) {
  48899. var o = new n.Texture
  48900. , a = new n.ImageLoader(this.manager);
  48901. return a.setCrossOrigin(this.crossOrigin),
  48902. a.setPath(this.path),
  48903. a.load(e, function(e) {
  48904. o.image = e,
  48905. o.needsUpdate = !0,
  48906. void 0 !== t && t(o)
  48907. }, i, r),
  48908. o
  48909. },
  48910. setCrossOrigin: function(e) {
  48911. this.crossOrigin = e
  48912. },
  48913. setPath: function(e) {
  48914. this.path = e
  48915. }
  48916. },
  48917. n.CubeTextureLoader = function(e) {
  48918. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48919. }
  48920. ,
  48921. n.CubeTextureLoader.prototype = {
  48922. constructor: n.CubeTextureLoader,
  48923. load: function(e, t, i, r) {
  48924. function o(i) {
  48925. s.load(e[i], function(e) {
  48926. a.images[i] = e,
  48927. l++,
  48928. 6 === l && (a.needsUpdate = !0,
  48929. t && t(a))
  48930. }, void 0, r)
  48931. }
  48932. var a = new n.CubeTexture
  48933. , s = new n.ImageLoader(this.manager);
  48934. s.setCrossOrigin(this.crossOrigin),
  48935. s.setPath(this.path);
  48936. for (var l = 0, c = 0; c < e.length; ++c)
  48937. o(c);
  48938. return a
  48939. },
  48940. setCrossOrigin: function(e) {
  48941. this.crossOrigin = e
  48942. },
  48943. setPath: function(e) {
  48944. this.path = e
  48945. }
  48946. },
  48947. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48948. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48949. this._parser = null
  48950. }
  48951. ,
  48952. n.BinaryTextureLoader.prototype = {
  48953. constructor: n.BinaryTextureLoader,
  48954. load: function(e, t, i, r) {
  48955. var o = this
  48956. , a = new n.DataTexture
  48957. , s = new n.XHRLoader(this.manager);
  48958. return s.setResponseType("arraybuffer"),
  48959. s.load(e, function(e) {
  48960. var i = o._parser(e);
  48961. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48962. a.image.height = i.height,
  48963. a.image.data = i.data),
  48964. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48965. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48966. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48967. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48968. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48969. void 0 !== i.format && (a.format = i.format),
  48970. void 0 !== i.type && (a.type = i.type),
  48971. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48972. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48973. a.needsUpdate = !0,
  48974. t && t(a, i))
  48975. }, i, r),
  48976. a
  48977. }
  48978. },
  48979. n.CompressedTextureLoader = function(e) {
  48980. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48981. this._parser = null
  48982. }
  48983. ;
  48984. n.CompressedTextureLoader.prototype = {
  48985. constructor: n.CompressedTextureLoader,
  48986. load: function(e, t, i, r) {
  48987. function o(o) {
  48988. c.load(e[o], function(e) {
  48989. var i = a._parser(e, !0);
  48990. s[o] = {
  48991. width: i.width,
  48992. height: i.height,
  48993. format: i.format,
  48994. mipmaps: i.mipmaps
  48995. },
  48996. h += 1,
  48997. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48998. l.format = i.format,
  48999. l.needsUpdate = !0,
  49000. t && t(l))
  49001. }, i, r)
  49002. }
  49003. var a = this
  49004. , s = []
  49005. , l = new n.CompressedTexture;
  49006. l.image = s;
  49007. var c = new n.XHRLoader(this.manager);
  49008. if (c.setPath(this.path),
  49009. c.setResponseType("arraybuffer"),
  49010. Array.isArray(e))
  49011. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49012. o(u);
  49013. else
  49014. c.load(e, function(e) {
  49015. var i = a._parser(e, !0);
  49016. if (i.isCubemap)
  49017. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49018. s[o] = {
  49019. mipmaps: []
  49020. };
  49021. for (var c = 0; c < i.mipmapCount; c++)
  49022. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49023. s[o].format = i.format,
  49024. s[o].width = i.width,
  49025. s[o].height = i.height
  49026. }
  49027. else
  49028. l.image.width = i.width,
  49029. l.image.height = i.height,
  49030. l.mipmaps = i.mipmaps;
  49031. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49032. l.format = i.format,
  49033. l.needsUpdate = !0,
  49034. t && t(l)
  49035. }, i, r);
  49036. return l
  49037. },
  49038. setPath: function(e) {
  49039. this.path = e
  49040. }
  49041. };
  49042. n.Material = function() {
  49043. Object.defineProperty(this, "id", {
  49044. value: n.MaterialIdCount++
  49045. }),
  49046. this.uuid = n.Math.generateUUID(),
  49047. this.name = "",
  49048. this.type = "Material",
  49049. this.side = n.FrontSide,
  49050. this.opacity = 1,
  49051. this.transparent = !1,
  49052. this.blending = n.NormalBlending,
  49053. this.blendSrc = n.SrcAlphaFactor,
  49054. this.blendDst = n.OneMinusSrcAlphaFactor,
  49055. this.blendEquation = n.AddEquation,
  49056. this.blendSrcAlpha = null,
  49057. this.blendDstAlpha = null,
  49058. this.blendEquationAlpha = null,
  49059. this.depthFunc = n.LessEqualDepth,
  49060. this.depthTest = !0,
  49061. this.depthWrite = !0,
  49062. this.colorWrite = !0,
  49063. this.precision = null,
  49064. this.polygonOffset = !1,
  49065. this.polygonOffsetFactor = 0,
  49066. this.polygonOffsetUnits = 0,
  49067. this.alphaTest = 0,
  49068. this.premultipliedAlpha = !1,
  49069. this.overdraw = 0,
  49070. this.visible = !0,
  49071. this._needsUpdate = !0
  49072. }
  49073. ,
  49074. n.Material.prototype = {
  49075. constructor: n.Material,
  49076. get needsUpdate() {
  49077. return this._needsUpdate
  49078. },
  49079. set needsUpdate(e) {
  49080. e === !0 && this.update(),
  49081. this._needsUpdate = e
  49082. },
  49083. setValues: function(e) {
  49084. if (void 0 !== e)
  49085. for (var t in e) {
  49086. var i = e[t];
  49087. if (void 0 !== i) {
  49088. var r = this[t];
  49089. 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.")
  49090. } else
  49091. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49092. }
  49093. },
  49094. toJSON: function(e) {
  49095. function t(e) {
  49096. var t = [];
  49097. for (var i in e) {
  49098. var n = e[i];
  49099. delete n.metadata,
  49100. t.push(n)
  49101. }
  49102. return t
  49103. }
  49104. var i = void 0 === e;
  49105. i && (e = {
  49106. textures: {},
  49107. images: {}
  49108. });
  49109. var r = {
  49110. metadata: {
  49111. version: 4.4,
  49112. type: "Material",
  49113. generator: "Material.toJSON"
  49114. }
  49115. };
  49116. if (r.uuid = this.uuid,
  49117. r.type = this.type,
  49118. "" !== this.name && (r.name = this.name),
  49119. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49120. .5 !== this.roughness && (r.roughness = this.roughness),
  49121. .5 !== this.metalness && (r.metalness = this.metalness),
  49122. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49123. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49124. void 0 !== this.shininess && (r.shininess = this.shininess),
  49125. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49126. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49127. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49128. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49129. r.bumpScale = this.bumpScale),
  49130. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49131. r.normalScale = this.normalScale.toArray()),
  49132. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49133. r.displacementScale = this.displacementScale,
  49134. r.displacementBias = this.displacementBias),
  49135. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49136. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49137. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49138. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49139. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49140. r.reflectivity = this.reflectivity),
  49141. void 0 !== this.size && (r.size = this.size),
  49142. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49143. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49144. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49145. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49146. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49147. this.opacity < 1 && (r.opacity = this.opacity),
  49148. this.transparent === !0 && (r.transparent = this.transparent),
  49149. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49150. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49151. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49152. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49153. i) {
  49154. var o = t(e.textures)
  49155. , a = t(e.images);
  49156. o.length > 0 && (r.textures = o),
  49157. a.length > 0 && (r.images = a)
  49158. }
  49159. return r
  49160. },
  49161. clone: function() {
  49162. return (new this.constructor).copy(this)
  49163. },
  49164. copy: function(e) {
  49165. return this.name = e.name,
  49166. this.side = e.side,
  49167. this.opacity = e.opacity,
  49168. this.transparent = e.transparent,
  49169. this.blending = e.blending,
  49170. this.blendSrc = e.blendSrc,
  49171. this.blendDst = e.blendDst,
  49172. this.blendEquation = e.blendEquation,
  49173. this.blendSrcAlpha = e.blendSrcAlpha,
  49174. this.blendDstAlpha = e.blendDstAlpha,
  49175. this.blendEquationAlpha = e.blendEquationAlpha,
  49176. this.depthFunc = e.depthFunc,
  49177. this.depthTest = e.depthTest,
  49178. this.depthWrite = e.depthWrite,
  49179. this.colorWrite = e.colorWrite,
  49180. this.precision = e.precision,
  49181. this.polygonOffset = e.polygonOffset,
  49182. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49183. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49184. this.alphaTest = e.alphaTest,
  49185. this.premultipliedAlpha = e.premultipliedAlpha,
  49186. this.overdraw = e.overdraw,
  49187. this.visible = e.visible,
  49188. this
  49189. },
  49190. update: function() {
  49191. this.dispatchEvent({
  49192. type: "update"
  49193. })
  49194. },
  49195. dispose: function() {
  49196. this.dispatchEvent({
  49197. type: "dispose"
  49198. })
  49199. }
  49200. },
  49201. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49202. n.MaterialIdCount = 0,
  49203. n.LineBasicMaterial = function(e) {
  49204. n.Material.call(this),
  49205. this.type = "LineBasicMaterial",
  49206. this.color = new n.Color(16777215),
  49207. this.linewidth = 1,
  49208. this.linecap = "round",
  49209. this.linejoin = "round",
  49210. this.blending = n.NormalBlending,
  49211. this.vertexColors = n.NoColors,
  49212. this.fog = !0,
  49213. this.setValues(e)
  49214. }
  49215. ,
  49216. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49217. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49218. n.LineBasicMaterial.prototype.copy = function(e) {
  49219. return n.Material.prototype.copy.call(this, e),
  49220. this.color.copy(e.color),
  49221. this.linewidth = e.linewidth,
  49222. this.linecap = e.linecap,
  49223. this.linejoin = e.linejoin,
  49224. this.vertexColors = e.vertexColors,
  49225. this.fog = e.fog,
  49226. this
  49227. }
  49228. ,
  49229. n.LineDashedMaterial = function(e) {
  49230. n.Material.call(this),
  49231. this.type = "LineDashedMaterial",
  49232. this.color = new n.Color(16777215),
  49233. this.linewidth = 1,
  49234. this.scale = 1,
  49235. this.dashSize = 3,
  49236. this.gapSize = 1,
  49237. this.blending = n.NormalBlending,
  49238. this.vertexColors = n.NoColors,
  49239. this.fog = !0,
  49240. this.setValues(e)
  49241. }
  49242. ,
  49243. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49244. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49245. n.LineDashedMaterial.prototype.copy = function(e) {
  49246. return n.Material.prototype.copy.call(this, e),
  49247. this.color.copy(e.color),
  49248. this.linewidth = e.linewidth,
  49249. this.scale = e.scale,
  49250. this.dashSize = e.dashSize,
  49251. this.gapSize = e.gapSize,
  49252. this.vertexColors = e.vertexColors,
  49253. this.fog = e.fog,
  49254. this
  49255. }
  49256. ,
  49257. n.MeshBasicMaterial = function(e) {
  49258. n.Material.call(this),
  49259. this.type = "MeshBasicMaterial",
  49260. this.color = new n.Color(16777215),
  49261. this.map = null,
  49262. this.aoMap = null,
  49263. this.aoMapIntensity = 1,
  49264. this.specularMap = null,
  49265. this.alphaMap = null,
  49266. this.envMap = null,
  49267. this.combine = n.MultiplyOperation,
  49268. this.reflectivity = 1,
  49269. this.refractionRatio = .98,
  49270. this.fog = !0,
  49271. this.shading = n.SmoothShading,
  49272. this.blending = n.NormalBlending,
  49273. this.wireframe = !1,
  49274. this.wireframeLinewidth = 1,
  49275. this.wireframeLinecap = "round",
  49276. this.wireframeLinejoin = "round",
  49277. this.vertexColors = n.NoColors,
  49278. this.skinning = !1,
  49279. this.morphTargets = !1,
  49280. this.setValues(e)
  49281. }
  49282. ,
  49283. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49284. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49285. n.MeshBasicMaterial.prototype.copy = function(e) {
  49286. return n.Material.prototype.copy.call(this, e),
  49287. this.color.copy(e.color),
  49288. this.map = e.map,
  49289. this.aoMap = e.aoMap,
  49290. this.aoMapIntensity = e.aoMapIntensity,
  49291. this.specularMap = e.specularMap,
  49292. this.alphaMap = e.alphaMap,
  49293. this.envMap = e.envMap,
  49294. this.combine = e.combine,
  49295. this.reflectivity = e.reflectivity,
  49296. this.refractionRatio = e.refractionRatio,
  49297. this.fog = e.fog,
  49298. this.shading = e.shading,
  49299. this.wireframe = e.wireframe,
  49300. this.wireframeLinewidth = e.wireframeLinewidth,
  49301. this.wireframeLinecap = e.wireframeLinecap,
  49302. this.wireframeLinejoin = e.wireframeLinejoin,
  49303. this.vertexColors = e.vertexColors,
  49304. this.skinning = e.skinning,
  49305. this.morphTargets = e.morphTargets,
  49306. this
  49307. }
  49308. ,
  49309. n.MeshLambertMaterial = function(e) {
  49310. n.Material.call(this),
  49311. this.type = "MeshLambertMaterial",
  49312. this.color = new n.Color(16777215),
  49313. this.map = null,
  49314. this.lightMap = null,
  49315. this.lightMapIntensity = 1,
  49316. this.aoMap = null,
  49317. this.aoMapIntensity = 1,
  49318. this.emissive = new n.Color(0),
  49319. this.emissiveIntensity = 1,
  49320. this.emissiveMap = null,
  49321. this.specularMap = null,
  49322. this.alphaMap = null,
  49323. this.envMap = null,
  49324. this.combine = n.MultiplyOperation,
  49325. this.reflectivity = 1,
  49326. this.refractionRatio = .98,
  49327. this.fog = !0,
  49328. this.blending = n.NormalBlending,
  49329. this.wireframe = !1,
  49330. this.wireframeLinewidth = 1,
  49331. this.wireframeLinecap = "round",
  49332. this.wireframeLinejoin = "round",
  49333. this.vertexColors = n.NoColors,
  49334. this.skinning = !1,
  49335. this.morphTargets = !1,
  49336. this.morphNormals = !1,
  49337. this.setValues(e)
  49338. }
  49339. ,
  49340. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49341. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49342. n.MeshLambertMaterial.prototype.copy = function(e) {
  49343. return n.Material.prototype.copy.call(this, e),
  49344. this.color.copy(e.color),
  49345. this.map = e.map,
  49346. this.lightMap = e.lightMap,
  49347. this.lightMapIntensity = e.lightMapIntensity,
  49348. this.aoMap = e.aoMap,
  49349. this.aoMapIntensity = e.aoMapIntensity,
  49350. this.emissive.copy(e.emissive),
  49351. this.emissiveMap = e.emissiveMap,
  49352. this.emissiveIntensity = e.emissiveIntensity,
  49353. this.specularMap = e.specularMap,
  49354. this.alphaMap = e.alphaMap,
  49355. this.envMap = e.envMap,
  49356. this.combine = e.combine,
  49357. this.reflectivity = e.reflectivity,
  49358. this.refractionRatio = e.refractionRatio,
  49359. this.fog = e.fog,
  49360. this.wireframe = e.wireframe,
  49361. this.wireframeLinewidth = e.wireframeLinewidth,
  49362. this.wireframeLinecap = e.wireframeLinecap,
  49363. this.wireframeLinejoin = e.wireframeLinejoin,
  49364. this.vertexColors = e.vertexColors,
  49365. this.skinning = e.skinning,
  49366. this.morphTargets = e.morphTargets,
  49367. this.morphNormals = e.morphNormals,
  49368. this
  49369. }
  49370. ,
  49371. n.MeshPhongMaterial = function(e) {
  49372. n.Material.call(this),
  49373. this.type = "MeshPhongMaterial",
  49374. this.color = new n.Color(16777215),
  49375. this.specular = new n.Color(1118481),
  49376. this.shininess = 30,
  49377. this.map = null,
  49378. this.lightMap = null,
  49379. this.lightMapIntensity = 1,
  49380. this.aoMap = null,
  49381. this.aoMapIntensity = 1,
  49382. this.emissive = new n.Color(0),
  49383. this.emissiveIntensity = 1,
  49384. this.emissiveMap = null,
  49385. this.bumpMap = null,
  49386. this.bumpScale = 1,
  49387. this.normalMap = null,
  49388. this.normalScale = new n.Vector2(1,1),
  49389. this.displacementMap = null,
  49390. this.displacementScale = 1,
  49391. this.displacementBias = 0,
  49392. this.specularMap = null,
  49393. this.alphaMap = null,
  49394. this.envMap = null,
  49395. this.combine = n.MultiplyOperation,
  49396. this.reflectivity = 1,
  49397. this.refractionRatio = .98,
  49398. this.fog = !0,
  49399. this.shading = n.SmoothShading,
  49400. this.blending = n.NormalBlending,
  49401. this.wireframe = !1,
  49402. this.wireframeLinewidth = 1,
  49403. this.wireframeLinecap = "round",
  49404. this.wireframeLinejoin = "round",
  49405. this.vertexColors = n.NoColors,
  49406. this.skinning = !1,
  49407. this.morphTargets = !1,
  49408. this.morphNormals = !1,
  49409. this.setValues(e)
  49410. }
  49411. ,
  49412. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49413. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49414. n.MeshPhongMaterial.prototype.copy = function(e) {
  49415. return n.Material.prototype.copy.call(this, e),
  49416. this.color.copy(e.color),
  49417. this.specular.copy(e.specular),
  49418. this.shininess = e.shininess,
  49419. this.map = e.map,
  49420. this.lightMap = e.lightMap,
  49421. this.lightMapIntensity = e.lightMapIntensity,
  49422. this.aoMap = e.aoMap,
  49423. this.aoMapIntensity = e.aoMapIntensity,
  49424. this.emissive.copy(e.emissive),
  49425. this.emissiveMap = e.emissiveMap,
  49426. this.emissiveIntensity = e.emissiveIntensity,
  49427. this.bumpMap = e.bumpMap,
  49428. this.bumpScale = e.bumpScale,
  49429. this.normalMap = e.normalMap,
  49430. this.normalScale.copy(e.normalScale),
  49431. this.displacementMap = e.displacementMap,
  49432. this.displacementScale = e.displacementScale,
  49433. this.displacementBias = e.displacementBias,
  49434. this.specularMap = e.specularMap,
  49435. this.alphaMap = e.alphaMap,
  49436. this.envMap = e.envMap,
  49437. this.combine = e.combine,
  49438. this.reflectivity = e.reflectivity,
  49439. this.refractionRatio = e.refractionRatio,
  49440. this.fog = e.fog,
  49441. this.shading = e.shading,
  49442. this.wireframe = e.wireframe,
  49443. this.wireframeLinewidth = e.wireframeLinewidth,
  49444. this.wireframeLinecap = e.wireframeLinecap,
  49445. this.wireframeLinejoin = e.wireframeLinejoin,
  49446. this.vertexColors = e.vertexColors,
  49447. this.skinning = e.skinning,
  49448. this.morphTargets = e.morphTargets,
  49449. this.morphNormals = e.morphNormals,
  49450. this
  49451. }
  49452. ,
  49453. n.MeshStandardMaterial = function(e) {
  49454. n.Material.call(this),
  49455. this.type = "MeshStandardMaterial",
  49456. this.color = new n.Color(16777215),
  49457. this.roughness = .5,
  49458. this.metalness = .5,
  49459. this.map = null,
  49460. this.lightMap = null,
  49461. this.lightMapIntensity = 1,
  49462. this.aoMap = null,
  49463. this.aoMapIntensity = 1,
  49464. this.emissive = new n.Color(0),
  49465. this.emissiveIntensity = 1,
  49466. this.emissiveMap = null,
  49467. this.bumpMap = null,
  49468. this.bumpScale = 1,
  49469. this.normalMap = null,
  49470. this.normalScale = new n.Vector2(1,1),
  49471. this.displacementMap = null,
  49472. this.displacementScale = 1,
  49473. this.displacementBias = 0,
  49474. this.roughnessMap = null,
  49475. this.metalnessMap = null,
  49476. this.alphaMap = null,
  49477. this.envMap = null,
  49478. this.envMapIntensity = 1,
  49479. this.refractionRatio = .98,
  49480. this.fog = !0,
  49481. this.shading = n.SmoothShading,
  49482. this.blending = n.NormalBlending,
  49483. this.wireframe = !1,
  49484. this.wireframeLinewidth = 1,
  49485. this.wireframeLinecap = "round",
  49486. this.wireframeLinejoin = "round",
  49487. this.vertexColors = n.NoColors,
  49488. this.skinning = !1,
  49489. this.morphTargets = !1,
  49490. this.morphNormals = !1,
  49491. this.setValues(e)
  49492. }
  49493. ,
  49494. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49495. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49496. n.MeshStandardMaterial.prototype.copy = function(e) {
  49497. return n.Material.prototype.copy.call(this, e),
  49498. this.color.copy(e.color),
  49499. this.roughness = e.roughness,
  49500. this.metalness = e.metalness,
  49501. this.map = e.map,
  49502. this.lightMap = e.lightMap,
  49503. this.lightMapIntensity = e.lightMapIntensity,
  49504. this.aoMap = e.aoMap,
  49505. this.aoMapIntensity = e.aoMapIntensity,
  49506. this.emissive.copy(e.emissive),
  49507. this.emissiveMap = e.emissiveMap,
  49508. this.emissiveIntensity = e.emissiveIntensity,
  49509. this.bumpMap = e.bumpMap,
  49510. this.bumpScale = e.bumpScale,
  49511. this.normalMap = e.normalMap,
  49512. this.normalScale.copy(e.normalScale),
  49513. this.displacementMap = e.displacementMap,
  49514. this.displacementScale = e.displacementScale,
  49515. this.displacementBias = e.displacementBias,
  49516. this.roughnessMap = e.roughnessMap,
  49517. this.metalnessMap = e.metalnessMap,
  49518. this.alphaMap = e.alphaMap,
  49519. this.envMap = e.envMap,
  49520. this.envMapIntensity = e.envMapIntensity,
  49521. this.refractionRatio = e.refractionRatio,
  49522. this.fog = e.fog,
  49523. this.shading = e.shading,
  49524. this.wireframe = e.wireframe,
  49525. this.wireframeLinewidth = e.wireframeLinewidth,
  49526. this.wireframeLinecap = e.wireframeLinecap,
  49527. this.wireframeLinejoin = e.wireframeLinejoin,
  49528. this.vertexColors = e.vertexColors,
  49529. this.skinning = e.skinning,
  49530. this.morphTargets = e.morphTargets,
  49531. this.morphNormals = e.morphNormals,
  49532. this
  49533. }
  49534. ,
  49535. n.MeshDepthMaterial = function(e) {
  49536. n.Material.call(this),
  49537. this.type = "MeshDepthMaterial",
  49538. this.morphTargets = !1,
  49539. this.wireframe = !1,
  49540. this.wireframeLinewidth = 1,
  49541. this.setValues(e)
  49542. }
  49543. ,
  49544. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49545. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49546. n.MeshDepthMaterial.prototype.copy = function(e) {
  49547. return n.Material.prototype.copy.call(this, e),
  49548. this.wireframe = e.wireframe,
  49549. this.wireframeLinewidth = e.wireframeLinewidth,
  49550. this
  49551. }
  49552. ,
  49553. n.MeshNormalMaterial = function(e) {
  49554. n.Material.call(this, e),
  49555. this.type = "MeshNormalMaterial",
  49556. this.wireframe = !1,
  49557. this.wireframeLinewidth = 1,
  49558. this.morphTargets = !1,
  49559. this.setValues(e)
  49560. }
  49561. ,
  49562. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49563. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49564. n.MeshNormalMaterial.prototype.copy = function(e) {
  49565. return n.Material.prototype.copy.call(this, e),
  49566. this.wireframe = e.wireframe,
  49567. this.wireframeLinewidth = e.wireframeLinewidth,
  49568. this
  49569. }
  49570. ,
  49571. n.MultiMaterial = function(e) {
  49572. this.uuid = n.Math.generateUUID(),
  49573. this.type = "MultiMaterial",
  49574. this.materials = e instanceof Array ? e : [],
  49575. this.visible = !0
  49576. }
  49577. ,
  49578. n.MultiMaterial.prototype = {
  49579. constructor: n.MultiMaterial,
  49580. toJSON: function(e) {
  49581. for (var t = {
  49582. metadata: {
  49583. version: 4.2,
  49584. type: "material",
  49585. generator: "MaterialExporter"
  49586. },
  49587. uuid: this.uuid,
  49588. type: this.type,
  49589. materials: []
  49590. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49591. var o = i[n].toJSON(e);
  49592. delete o.metadata,
  49593. t.materials.push(o)
  49594. }
  49595. return t.visible = this.visible,
  49596. t
  49597. },
  49598. clone: function() {
  49599. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49600. e.materials.push(this.materials[t].clone());
  49601. return e.visible = this.visible,
  49602. e
  49603. }
  49604. },
  49605. n.PointsMaterial = function(e) {
  49606. n.Material.call(this),
  49607. this.type = "PointsMaterial",
  49608. this.color = new n.Color(16777215),
  49609. this.map = null,
  49610. this.size = 1,
  49611. this.sizeAttenuation = !0,
  49612. this.blending = n.NormalBlending,
  49613. this.vertexColors = n.NoColors,
  49614. this.fog = !0,
  49615. this.setValues(e)
  49616. }
  49617. ,
  49618. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49619. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49620. n.PointsMaterial.prototype.copy = function(e) {
  49621. return n.Material.prototype.copy.call(this, e),
  49622. this.color.copy(e.color),
  49623. this.map = e.map,
  49624. this.size = e.size,
  49625. this.sizeAttenuation = e.sizeAttenuation,
  49626. this.vertexColors = e.vertexColors,
  49627. this.fog = e.fog,
  49628. this
  49629. }
  49630. ,
  49631. n.ShaderMaterial = function(e) {
  49632. n.Material.call(this),
  49633. this.type = "ShaderMaterial",
  49634. this.defines = {},
  49635. this.uniforms = {},
  49636. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49637. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49638. this.shading = n.SmoothShading,
  49639. this.linewidth = 1,
  49640. this.wireframe = !1,
  49641. this.wireframeLinewidth = 1,
  49642. this.fog = !1,
  49643. this.lights = !1,
  49644. this.vertexColors = n.NoColors,
  49645. this.skinning = !1,
  49646. this.morphTargets = !1,
  49647. this.morphNormals = !1,
  49648. this.extensions = {
  49649. derivatives: !1,
  49650. fragDepth: !1,
  49651. drawBuffers: !1,
  49652. shaderTextureLOD: !1
  49653. },
  49654. this.defaultAttributeValues = {
  49655. color: [1, 1, 1],
  49656. uv: [0, 0],
  49657. uv2: [0, 0]
  49658. },
  49659. this.index0AttributeName = void 0,
  49660. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49661. this.setValues(e))
  49662. }
  49663. ,
  49664. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49665. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49666. n.ShaderMaterial.prototype.copy = function(e) {
  49667. return n.Material.prototype.copy.call(this, e),
  49668. this.fragmentShader = e.fragmentShader,
  49669. this.vertexShader = e.vertexShader,
  49670. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49671. this.defines = e.defines,
  49672. this.shading = e.shading,
  49673. this.wireframe = e.wireframe,
  49674. this.wireframeLinewidth = e.wireframeLinewidth,
  49675. this.fog = e.fog,
  49676. this.lights = e.lights,
  49677. this.vertexColors = e.vertexColors,
  49678. this.skinning = e.skinning,
  49679. this.morphTargets = e.morphTargets,
  49680. this.morphNormals = e.morphNormals,
  49681. this.extensions = e.extensions,
  49682. this
  49683. }
  49684. ,
  49685. n.ShaderMaterial.prototype.toJSON = function(e) {
  49686. var t = n.Material.prototype.toJSON.call(this, e);
  49687. return t.uniforms = this.uniforms,
  49688. t.vertexShader = this.vertexShader,
  49689. t.fragmentShader = this.fragmentShader,
  49690. t
  49691. }
  49692. ,
  49693. n.RawShaderMaterial = function(e) {
  49694. n.ShaderMaterial.call(this, e),
  49695. this.type = "RawShaderMaterial"
  49696. }
  49697. ,
  49698. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49699. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49700. n.SpriteMaterial = function(e) {
  49701. n.Material.call(this),
  49702. this.type = "SpriteMaterial",
  49703. this.color = new n.Color(16777215),
  49704. this.map = null,
  49705. this.rotation = 0,
  49706. this.fog = !1,
  49707. this.setValues(e)
  49708. }
  49709. ,
  49710. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49711. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49712. n.SpriteMaterial.prototype.copy = function(e) {
  49713. return n.Material.prototype.copy.call(this, e),
  49714. this.color.copy(e.color),
  49715. this.map = e.map,
  49716. this.rotation = e.rotation,
  49717. this.fog = e.fog,
  49718. this
  49719. }
  49720. ,
  49721. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49722. Object.defineProperty(this, "id", {
  49723. value: n.TextureIdCount++
  49724. }),
  49725. this.uuid = n.Math.generateUUID(),
  49726. this.name = "",
  49727. this.sourceFile = "",
  49728. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49729. this.mipmaps = [],
  49730. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49731. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49732. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49733. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49734. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49735. this.anisotropy = void 0 !== c ? c : 1,
  49736. this.format = void 0 !== s ? s : n.RGBAFormat,
  49737. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49738. this.offset = new n.Vector2(0,0),
  49739. this.repeat = new n.Vector2(1,1),
  49740. this.generateMipmaps = !0,
  49741. this.premultiplyAlpha = !1,
  49742. this.flipY = !0,
  49743. this.unpackAlignment = 4,
  49744. this.encoding = n.LinearEncoding,
  49745. this.version = 0,
  49746. this.onUpdate = null
  49747. }
  49748. ,
  49749. n.Texture.DEFAULT_IMAGE = void 0,
  49750. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49751. n.Texture.prototype = {
  49752. constructor: n.Texture,
  49753. set needsUpdate(e) {
  49754. e === !0 && this.version++
  49755. },
  49756. clone: function() {
  49757. return (new this.constructor).copy(this)
  49758. },
  49759. copy: function(e) {
  49760. return this.image = e.image,
  49761. this.mipmaps = e.mipmaps.slice(0),
  49762. this.mapping = e.mapping,
  49763. this.wrapS = e.wrapS,
  49764. this.wrapT = e.wrapT,
  49765. this.magFilter = e.magFilter,
  49766. this.minFilter = e.minFilter,
  49767. this.anisotropy = e.anisotropy,
  49768. this.format = e.format,
  49769. this.type = e.type,
  49770. this.offset.copy(e.offset),
  49771. this.repeat.copy(e.repeat),
  49772. this.generateMipmaps = e.generateMipmaps,
  49773. this.premultiplyAlpha = e.premultiplyAlpha,
  49774. this.flipY = e.flipY,
  49775. this.unpackAlignment = e.unpackAlignment,
  49776. this.encoding = e.encoding,
  49777. this
  49778. },
  49779. toJSON: function(e) {
  49780. function t(e) {
  49781. var t;
  49782. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49783. t.width = e.width,
  49784. t.height = e.height,
  49785. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49786. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49787. }
  49788. if (void 0 !== e.textures[this.uuid])
  49789. return e.textures[this.uuid];
  49790. var i = {
  49791. metadata: {
  49792. version: 4.4,
  49793. type: "Texture",
  49794. generator: "Texture.toJSON"
  49795. },
  49796. uuid: this.uuid,
  49797. name: this.name,
  49798. mapping: this.mapping,
  49799. repeat: [this.repeat.x, this.repeat.y],
  49800. offset: [this.offset.x, this.offset.y],
  49801. wrap: [this.wrapS, this.wrapT],
  49802. minFilter: this.minFilter,
  49803. magFilter: this.magFilter,
  49804. anisotropy: this.anisotropy
  49805. };
  49806. if (void 0 !== this.image) {
  49807. var r = this.image;
  49808. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49809. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49810. uuid: r.uuid,
  49811. url: t(r)
  49812. }),
  49813. i.image = r.uuid
  49814. }
  49815. return e.textures[this.uuid] = i,
  49816. i
  49817. },
  49818. dispose: function() {
  49819. this.dispatchEvent({
  49820. type: "dispose"
  49821. })
  49822. },
  49823. transformUv: function(e) {
  49824. if (this.mapping === n.UVMapping) {
  49825. if (e.multiply(this.repeat),
  49826. e.add(this.offset),
  49827. e.x < 0 || e.x > 1)
  49828. switch (this.wrapS) {
  49829. case n.RepeatWrapping:
  49830. e.x = e.x - Math.floor(e.x);
  49831. break;
  49832. case n.ClampToEdgeWrapping:
  49833. e.x = e.x < 0 ? 0 : 1;
  49834. break;
  49835. case n.MirroredRepeatWrapping:
  49836. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49837. }
  49838. if (e.y < 0 || e.y > 1)
  49839. switch (this.wrapT) {
  49840. case n.RepeatWrapping:
  49841. e.y = e.y - Math.floor(e.y);
  49842. break;
  49843. case n.ClampToEdgeWrapping:
  49844. e.y = e.y < 0 ? 0 : 1;
  49845. break;
  49846. case n.MirroredRepeatWrapping:
  49847. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49848. }
  49849. this.flipY && (e.y = 1 - e.y)
  49850. }
  49851. }
  49852. },
  49853. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49854. n.TextureIdCount = 0,
  49855. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49856. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49857. this.needsUpdate = !0
  49858. }
  49859. ,
  49860. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49861. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49862. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49863. e = void 0 !== e ? e : [],
  49864. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49865. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49866. this.flipY = !1
  49867. }
  49868. ,
  49869. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49870. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49871. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49872. get: function() {
  49873. return this.image
  49874. },
  49875. set: function(e) {
  49876. this.image = e
  49877. }
  49878. }),
  49879. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49880. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49881. this.image = {
  49882. width: t,
  49883. height: i
  49884. },
  49885. this.mipmaps = e,
  49886. this.flipY = !1,
  49887. this.generateMipmaps = !1
  49888. }
  49889. ,
  49890. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49891. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49892. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49893. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49894. this.image = {
  49895. data: e,
  49896. width: t,
  49897. height: i
  49898. },
  49899. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49900. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49901. this.flipY = !1,
  49902. this.generateMipmaps = !1
  49903. }
  49904. ,
  49905. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49906. n.DataTexture.prototype.constructor = n.DataTexture,
  49907. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49908. function h() {
  49909. requestAnimationFrame(h)
  49910. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49911. u.needsUpdate = !0
  49912. }
  49913. }
  49914. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49915. this.generateMipmaps = !1;
  49916. var u = this;
  49917. h()
  49918. }
  49919. ,
  49920. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49921. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49922. n.Group = function() {
  49923. n.Object3D.call(this),
  49924. this.type = "Group"
  49925. }
  49926. ,
  49927. n.Group.prototype = Object.create(n.Object3D.prototype),
  49928. n.Group.prototype.constructor = n.Group,
  49929. n.Points = function(e, t) {
  49930. n.Object3D.call(this),
  49931. this.type = "Points",
  49932. this.geometry = void 0 !== e ? e : new n.Geometry,
  49933. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49934. color: 16777215 * Math.random()
  49935. })
  49936. }
  49937. ,
  49938. n.Points.prototype = Object.create(n.Object3D.prototype),
  49939. n.Points.prototype.constructor = n.Points,
  49940. n.Points.prototype.raycast = function() {
  49941. var e = new n.Matrix4
  49942. , t = new n.Ray
  49943. , i = new n.Sphere;
  49944. return function(r, o) {
  49945. function a(e, i) {
  49946. var n = t.distanceSqToPoint(e);
  49947. if (n < d) {
  49948. var a = t.closestPointToPoint(e);
  49949. a.applyMatrix4(c);
  49950. var l = r.ray.origin.distanceTo(a);
  49951. if (l < r.near || l > r.far)
  49952. return;
  49953. o.push({
  49954. distance: l,
  49955. distanceToRay: Math.sqrt(n),
  49956. point: a.clone(),
  49957. index: i,
  49958. face: null,
  49959. object: s
  49960. })
  49961. }
  49962. }
  49963. var s = this
  49964. , l = this.geometry
  49965. , c = this.matrixWorld
  49966. , h = r.params.Points.threshold;
  49967. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49968. i.copy(l.boundingSphere),
  49969. i.applyMatrix4(c),
  49970. r.ray.intersectsSphere(i) !== !1) {
  49971. e.getInverse(c),
  49972. t.copy(r.ray).applyMatrix4(e);
  49973. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49974. , d = u * u
  49975. , p = new n.Vector3;
  49976. if (l instanceof n.BufferGeometry) {
  49977. var f = l.index
  49978. , g = l.attributes
  49979. , m = g.position.array;
  49980. if (null !== f)
  49981. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49982. var C = v[A];
  49983. p.fromArray(m, 3 * C),
  49984. a(p, C)
  49985. }
  49986. else
  49987. for (var A = 0, I = m.length / 3; A < I; A++)
  49988. p.fromArray(m, 3 * A),
  49989. a(p, A)
  49990. } else
  49991. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49992. a(E[A], A)
  49993. }
  49994. }
  49995. }(),
  49996. n.Points.prototype.clone = function() {
  49997. return new this.constructor(this.geometry,this.material).copy(this)
  49998. }
  49999. ,
  50000. n.Line = function(e, t, i) {
  50001. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50002. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50003. this.type = "Line",
  50004. this.geometry = void 0 !== e ? e : new n.Geometry,
  50005. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50006. color: 16777215 * Math.random()
  50007. })))
  50008. }
  50009. ,
  50010. n.Line.prototype = Object.create(n.Object3D.prototype),
  50011. n.Line.prototype.constructor = n.Line,
  50012. n.Line.prototype.raycast = function() {
  50013. var e = new n.Matrix4
  50014. , t = new n.Ray
  50015. , i = new n.Sphere;
  50016. return function(r, o) {
  50017. var a = r.linePrecision
  50018. , s = a * a
  50019. , l = this.geometry
  50020. , c = this.matrixWorld;
  50021. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50022. i.copy(l.boundingSphere),
  50023. i.applyMatrix4(c),
  50024. r.ray.intersectsSphere(i) !== !1) {
  50025. e.getInverse(c),
  50026. t.copy(r.ray).applyMatrix4(e);
  50027. var h = new n.Vector3
  50028. , u = new n.Vector3
  50029. , d = new n.Vector3
  50030. , p = new n.Vector3
  50031. , f = this instanceof n.LineSegments ? 2 : 1;
  50032. if (l instanceof n.BufferGeometry) {
  50033. var g = l.index
  50034. , m = l.attributes
  50035. , v = m.position.array;
  50036. if (null !== g)
  50037. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50038. var I = A[y]
  50039. , E = A[y + 1];
  50040. h.fromArray(v, 3 * I),
  50041. u.fromArray(v, 3 * E);
  50042. var b = t.distanceSqToSegment(h, u, p, d);
  50043. if (!(b > s)) {
  50044. p.applyMatrix4(this.matrixWorld);
  50045. var w = r.ray.origin.distanceTo(p);
  50046. w < r.near || w > r.far || o.push({
  50047. distance: w,
  50048. point: d.clone().applyMatrix4(this.matrixWorld),
  50049. index: y,
  50050. face: null,
  50051. faceIndex: null,
  50052. object: this
  50053. })
  50054. }
  50055. }
  50056. else
  50057. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50058. h.fromArray(v, 3 * y),
  50059. u.fromArray(v, 3 * y + 3);
  50060. var b = t.distanceSqToSegment(h, u, p, d);
  50061. if (!(b > s)) {
  50062. p.applyMatrix4(this.matrixWorld);
  50063. var w = r.ray.origin.distanceTo(p);
  50064. w < r.near || w > r.far || o.push({
  50065. distance: w,
  50066. point: d.clone().applyMatrix4(this.matrixWorld),
  50067. index: y,
  50068. face: null,
  50069. faceIndex: null,
  50070. object: this
  50071. })
  50072. }
  50073. }
  50074. } else if (l instanceof n.Geometry)
  50075. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50076. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50077. if (!(b > s)) {
  50078. p.applyMatrix4(this.matrixWorld);
  50079. var w = r.ray.origin.distanceTo(p);
  50080. w < r.near || w > r.far || o.push({
  50081. distance: w,
  50082. point: d.clone().applyMatrix4(this.matrixWorld),
  50083. index: y,
  50084. face: null,
  50085. faceIndex: null,
  50086. object: this
  50087. })
  50088. }
  50089. }
  50090. }
  50091. }
  50092. }(),
  50093. n.Line.prototype.clone = function() {
  50094. return new this.constructor(this.geometry,this.material).copy(this)
  50095. }
  50096. ,
  50097. n.LineStrip = 0,
  50098. n.LinePieces = 1,
  50099. n.LineSegments = function(e, t) {
  50100. n.Line.call(this, e, t),
  50101. this.type = "LineSegments"
  50102. }
  50103. ,
  50104. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50105. n.LineSegments.prototype.constructor = n.LineSegments,
  50106. n.Mesh = function(e, t) {
  50107. n.Object3D.call(this),
  50108. this.type = "Mesh",
  50109. this.geometry = void 0 !== e ? e : new n.Geometry,
  50110. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50111. color: 16777215 * Math.random()
  50112. }),
  50113. this.drawMode = n.TrianglesDrawMode,
  50114. this.updateMorphTargets()
  50115. }
  50116. ,
  50117. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50118. n.Mesh.prototype.constructor = n.Mesh,
  50119. n.Mesh.prototype.setDrawMode = function(e) {
  50120. this.drawMode = e
  50121. }
  50122. ,
  50123. n.Mesh.prototype.updateMorphTargets = function() {
  50124. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50125. this.morphTargetBase = -1,
  50126. this.morphTargetInfluences = [],
  50127. this.morphTargetDictionary = {};
  50128. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50129. this.morphTargetInfluences.push(0),
  50130. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50131. }
  50132. }
  50133. ,
  50134. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50135. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50136. 0)
  50137. }
  50138. ,
  50139. n.Mesh.prototype.raycast = function() {
  50140. function e(e, t, i, r, o, a, s) {
  50141. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50142. o.multiplyScalar(m.x),
  50143. a.multiplyScalar(m.y),
  50144. s.multiplyScalar(m.z),
  50145. o.add(a).add(s),
  50146. o.clone()
  50147. }
  50148. function t(e, t, i, r, o, a, s) {
  50149. var l, c = e.material;
  50150. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50151. null === l)
  50152. return null;
  50153. A.copy(s),
  50154. A.applyMatrix4(e.matrixWorld);
  50155. var h = t.ray.origin.distanceTo(A);
  50156. return h < t.near || h > t.far ? null : {
  50157. distance: h,
  50158. point: A.clone(),
  50159. object: e
  50160. }
  50161. }
  50162. function i(i, r, o, a, h, u, d, m) {
  50163. s.fromArray(a, 3 * u),
  50164. l.fromArray(a, 3 * d),
  50165. c.fromArray(a, 3 * m);
  50166. var A = t(i, r, o, s, l, c, v);
  50167. return A && (h && (p.fromArray(h, 2 * u),
  50168. f.fromArray(h, 2 * d),
  50169. g.fromArray(h, 2 * m),
  50170. A.uv = e(v, s, l, c, p, f, g)),
  50171. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50172. A.faceIndex = u),
  50173. A
  50174. }
  50175. var r = new n.Matrix4
  50176. , o = new n.Ray
  50177. , a = new n.Sphere
  50178. , s = new n.Vector3
  50179. , l = new n.Vector3
  50180. , c = new n.Vector3
  50181. , h = new n.Vector3
  50182. , u = new n.Vector3
  50183. , d = new n.Vector3
  50184. , p = new n.Vector2
  50185. , f = new n.Vector2
  50186. , g = new n.Vector2
  50187. , m = new n.Vector3
  50188. , v = new n.Vector3
  50189. , A = new n.Vector3;
  50190. return function(m, A) {
  50191. var y = this.geometry
  50192. , C = this.material
  50193. , I = this.matrixWorld;
  50194. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50195. a.copy(y.boundingSphere),
  50196. a.applyMatrix4(I),
  50197. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50198. o.copy(m.ray).applyMatrix4(r),
  50199. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50200. var E, b;
  50201. if (y instanceof n.BufferGeometry) {
  50202. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50203. if (void 0 !== S.uv && (E = S.uv.array),
  50204. null !== x)
  50205. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50206. w = R[P],
  50207. _ = R[P + 1],
  50208. T = R[P + 2],
  50209. b = i(this, m, o, M, E, w, _, T),
  50210. b && (b.faceIndex = Math.floor(P / 3),
  50211. A.push(b));
  50212. else
  50213. for (var P = 0, O = M.length; P < O; P += 9)
  50214. w = P / 3,
  50215. _ = w + 1,
  50216. T = w + 2,
  50217. b = i(this, m, o, M, E, w, _, T),
  50218. b && (b.index = w,
  50219. A.push(b))
  50220. } else if (y instanceof n.Geometry) {
  50221. 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];
  50222. k.length > 0 && (E = k);
  50223. for (var H = 0, G = U.length; H < G; H++) {
  50224. var z = U[H]
  50225. , W = B === !0 ? F[z.materialIndex] : C;
  50226. if (void 0 !== W) {
  50227. if (L = V[z.a],
  50228. D = V[z.b],
  50229. N = V[z.c],
  50230. W.morphTargets === !0) {
  50231. var j = y.morphTargets
  50232. , Y = this.morphTargetInfluences;
  50233. s.set(0, 0, 0),
  50234. l.set(0, 0, 0),
  50235. c.set(0, 0, 0);
  50236. for (var X = 0, Z = j.length; X < Z; X++) {
  50237. var q = Y[X];
  50238. if (0 !== q) {
  50239. var K = j[X].vertices;
  50240. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50241. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50242. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50243. }
  50244. }
  50245. s.add(L),
  50246. l.add(D),
  50247. c.add(N),
  50248. L = s,
  50249. D = l,
  50250. N = c
  50251. }
  50252. if (b = t(this, m, o, L, D, N, v)) {
  50253. if (E) {
  50254. var Q = E[H];
  50255. p.copy(Q[0]),
  50256. f.copy(Q[1]),
  50257. g.copy(Q[2]),
  50258. b.uv = e(v, L, D, N, p, f, g)
  50259. }
  50260. b.face = z,
  50261. b.faceIndex = H,
  50262. A.push(b)
  50263. }
  50264. }
  50265. }
  50266. }
  50267. }
  50268. }
  50269. }(),
  50270. n.Mesh.prototype.clone = function() {
  50271. return new this.constructor(this.geometry,this.material).copy(this)
  50272. }
  50273. ,
  50274. n.Bone = function(e) {
  50275. n.Object3D.call(this),
  50276. this.type = "Bone",
  50277. this.skin = e
  50278. }
  50279. ,
  50280. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50281. n.Bone.prototype.constructor = n.Bone,
  50282. n.Bone.prototype.copy = function(e) {
  50283. return n.Object3D.prototype.copy.call(this, e),
  50284. this.skin = e.skin,
  50285. this
  50286. }
  50287. ,
  50288. n.Skeleton = function(e, t, i) {
  50289. if (this.useVertexTexture = void 0 === i || i,
  50290. this.identityMatrix = new n.Matrix4,
  50291. e = e || [],
  50292. this.bones = e.slice(0),
  50293. this.useVertexTexture) {
  50294. var r = Math.sqrt(4 * this.bones.length);
  50295. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50296. r = Math.max(r, 4),
  50297. this.boneTextureWidth = r,
  50298. this.boneTextureHeight = r,
  50299. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50300. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50301. } else
  50302. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50303. if (void 0 === t)
  50304. this.calculateInverses();
  50305. else if (this.bones.length === t.length)
  50306. this.boneInverses = t.slice(0);
  50307. else {
  50308. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50309. this.boneInverses = [];
  50310. for (var o = 0, a = this.bones.length; o < a; o++)
  50311. this.boneInverses.push(new n.Matrix4)
  50312. }
  50313. }
  50314. ,
  50315. n.Skeleton.prototype.calculateInverses = function() {
  50316. this.boneInverses = [];
  50317. for (var e = 0, t = this.bones.length; e < t; e++) {
  50318. var i = new n.Matrix4;
  50319. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50320. this.boneInverses.push(i)
  50321. }
  50322. }
  50323. ,
  50324. n.Skeleton.prototype.pose = function() {
  50325. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50326. e = this.bones[t],
  50327. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50328. for (var t = 0, i = this.bones.length; t < i; t++)
  50329. e = this.bones[t],
  50330. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50331. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50332. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50333. }
  50334. ,
  50335. n.Skeleton.prototype.update = function() {
  50336. var e = new n.Matrix4;
  50337. return function() {
  50338. for (var t = 0, i = this.bones.length; t < i; t++) {
  50339. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50340. e.multiplyMatrices(n, this.boneInverses[t]),
  50341. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50342. }
  50343. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50344. }
  50345. }(),
  50346. n.Skeleton.prototype.clone = function() {
  50347. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50348. }
  50349. ,
  50350. n.SkinnedMesh = function(e, t, i) {
  50351. n.Mesh.call(this, e, t),
  50352. this.type = "SkinnedMesh",
  50353. this.bindMode = "attached",
  50354. this.bindMatrix = new n.Matrix4,
  50355. this.bindMatrixInverse = new n.Matrix4;
  50356. var r = [];
  50357. if (this.geometry && void 0 !== this.geometry.bones) {
  50358. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50359. a = this.geometry.bones[s],
  50360. o = new n.Bone(this),
  50361. r.push(o),
  50362. o.name = a.name,
  50363. o.position.fromArray(a.pos),
  50364. o.quaternion.fromArray(a.rotq),
  50365. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50366. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50367. a = this.geometry.bones[s],
  50368. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50369. }
  50370. this.normalizeSkinWeights(),
  50371. this.updateMatrixWorld(!0),
  50372. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50373. }
  50374. ,
  50375. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50376. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50377. n.SkinnedMesh.prototype.bind = function(e, t) {
  50378. this.skeleton = e,
  50379. void 0 === t && (this.updateMatrixWorld(!0),
  50380. this.skeleton.calculateInverses(),
  50381. t = this.matrixWorld),
  50382. this.bindMatrix.copy(t),
  50383. this.bindMatrixInverse.getInverse(t)
  50384. }
  50385. ,
  50386. n.SkinnedMesh.prototype.pose = function() {
  50387. this.skeleton.pose()
  50388. }
  50389. ,
  50390. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50391. if (this.geometry instanceof n.Geometry)
  50392. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50393. var t = this.geometry.skinWeights[e]
  50394. , i = 1 / t.lengthManhattan();
  50395. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50396. }
  50397. else if (this.geometry instanceof n.BufferGeometry)
  50398. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50399. r.x = o.getX(e),
  50400. r.y = o.getY(e),
  50401. r.z = o.getZ(e),
  50402. r.w = o.getW(e);
  50403. var i = 1 / r.lengthManhattan();
  50404. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50405. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50406. }
  50407. }
  50408. ,
  50409. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50410. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50411. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50412. }
  50413. ,
  50414. n.SkinnedMesh.prototype.clone = function() {
  50415. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50416. }
  50417. ,
  50418. n.LOD = function() {
  50419. n.Object3D.call(this),
  50420. this.type = "LOD",
  50421. Object.defineProperties(this, {
  50422. levels: {
  50423. enumerable: !0,
  50424. value: []
  50425. },
  50426. objects: {
  50427. get: function() {
  50428. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50429. this.levels
  50430. }
  50431. }
  50432. })
  50433. }
  50434. ,
  50435. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50436. n.LOD.prototype.constructor = n.LOD,
  50437. n.LOD.prototype.addLevel = function(e, t) {
  50438. void 0 === t && (t = 0),
  50439. t = Math.abs(t);
  50440. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50441. ;
  50442. i.splice(n, 0, {
  50443. distance: t,
  50444. object: e
  50445. }),
  50446. this.add(e)
  50447. }
  50448. ,
  50449. n.LOD.prototype.getObjectForDistance = function(e) {
  50450. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50451. ;
  50452. return t[i - 1].object
  50453. }
  50454. ,
  50455. n.LOD.prototype.raycast = function() {
  50456. var e = new n.Vector3;
  50457. return function(t, i) {
  50458. e.setFromMatrixPosition(this.matrixWorld);
  50459. var n = t.ray.origin.distanceTo(e);
  50460. this.getObjectForDistance(n).raycast(t, i)
  50461. }
  50462. }(),
  50463. n.LOD.prototype.update = function() {
  50464. var e = new n.Vector3
  50465. , t = new n.Vector3;
  50466. return function(i) {
  50467. var n = this.levels;
  50468. if (n.length > 1) {
  50469. e.setFromMatrixPosition(i.matrixWorld),
  50470. t.setFromMatrixPosition(this.matrixWorld);
  50471. var r = e.distanceTo(t);
  50472. n[0].object.visible = !0;
  50473. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50474. n[o - 1].object.visible = !1,
  50475. n[o].object.visible = !0;
  50476. for (; o < a; o++)
  50477. n[o].object.visible = !1
  50478. }
  50479. }
  50480. }(),
  50481. n.LOD.prototype.copy = function(e) {
  50482. n.Object3D.prototype.copy.call(this, e, !1);
  50483. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50484. var o = t[i];
  50485. this.addLevel(o.object.clone(), o.distance)
  50486. }
  50487. return this
  50488. }
  50489. ,
  50490. n.LOD.prototype.toJSON = function(e) {
  50491. var t = n.Object3D.prototype.toJSON.call(this, e);
  50492. t.object.levels = [];
  50493. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50494. var a = i[r];
  50495. t.object.levels.push({
  50496. object: a.object.uuid,
  50497. distance: a.distance
  50498. })
  50499. }
  50500. return t
  50501. }
  50502. ,
  50503. n.Sprite = function() {
  50504. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50505. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50506. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50507. , r = new n.BufferGeometry;
  50508. return r.setIndex(new n.BufferAttribute(e,1)),
  50509. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50510. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50511. function(e) {
  50512. n.Object3D.call(this),
  50513. this.type = "Sprite",
  50514. this.geometry = r,
  50515. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50516. }
  50517. }(),
  50518. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50519. n.Sprite.prototype.constructor = n.Sprite,
  50520. n.Sprite.prototype.raycast = function() {
  50521. var e = new n.Vector3;
  50522. return function(t, i) {
  50523. e.setFromMatrixPosition(this.matrixWorld);
  50524. var n = t.ray.distanceSqToPoint(e)
  50525. , r = this.scale.x * this.scale.y;
  50526. n > r || i.push({
  50527. distance: Math.sqrt(n),
  50528. point: this.position,
  50529. face: null,
  50530. object: this
  50531. })
  50532. }
  50533. }(),
  50534. n.Sprite.prototype.clone = function() {
  50535. return new this.constructor(this.material).copy(this)
  50536. }
  50537. ,
  50538. n.Particle = n.Sprite,
  50539. n.LensFlare = function(e, t, i, r, o) {
  50540. n.Object3D.call(this),
  50541. this.lensFlares = [],
  50542. this.positionScreen = new n.Vector3,
  50543. this.customUpdateCallback = void 0,
  50544. void 0 !== e && this.add(e, t, i, r, o)
  50545. }
  50546. ,
  50547. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50548. n.LensFlare.prototype.constructor = n.LensFlare,
  50549. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50550. void 0 === t && (t = -1),
  50551. void 0 === i && (i = 0),
  50552. void 0 === a && (a = 1),
  50553. void 0 === o && (o = new n.Color(16777215)),
  50554. void 0 === r && (r = n.NormalBlending),
  50555. i = Math.min(i, Math.max(0, i)),
  50556. this.lensFlares.push({
  50557. texture: e,
  50558. size: t,
  50559. distance: i,
  50560. x: 0,
  50561. y: 0,
  50562. z: 0,
  50563. scale: 1,
  50564. rotation: 0,
  50565. opacity: a,
  50566. color: o,
  50567. blending: r
  50568. })
  50569. }
  50570. ,
  50571. n.LensFlare.prototype.updateLensFlares = function() {
  50572. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50573. for (e = 0; e < i; e++)
  50574. t = this.lensFlares[e],
  50575. t.x = this.positionScreen.x + n * t.distance,
  50576. t.y = this.positionScreen.y + r * t.distance,
  50577. t.wantedRotation = t.x * Math.PI * .25,
  50578. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50579. }
  50580. ,
  50581. n.LensFlare.prototype.copy = function(e) {
  50582. n.Object3D.prototype.copy.call(this, e),
  50583. this.positionScreen.copy(e.positionScreen),
  50584. this.customUpdateCallback = e.customUpdateCallback;
  50585. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50586. this.lensFlares.push(e.lensFlares[t]);
  50587. return this
  50588. }
  50589. ,
  50590. n.Scene = function() {
  50591. n.Object3D.call(this),
  50592. this.type = "Scene",
  50593. this.fog = null,
  50594. this.overrideMaterial = null,
  50595. this.autoUpdate = !0
  50596. }
  50597. ,
  50598. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50599. n.Scene.prototype.constructor = n.Scene,
  50600. n.Scene.prototype.copy = function(e, t) {
  50601. return n.Object3D.prototype.copy.call(this, e, t),
  50602. null !== e.fog && (this.fog = e.fog.clone()),
  50603. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50604. this.autoUpdate = e.autoUpdate,
  50605. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50606. this
  50607. }
  50608. ,
  50609. n.Fog = function(e, t, i) {
  50610. this.name = "",
  50611. this.color = new n.Color(e),
  50612. this.near = void 0 !== t ? t : 1,
  50613. this.far = void 0 !== i ? i : 1e3
  50614. }
  50615. ,
  50616. n.Fog.prototype.clone = function() {
  50617. return new n.Fog(this.color.getHex(),this.near,this.far)
  50618. }
  50619. ,
  50620. n.FogExp2 = function(e, t) {
  50621. this.name = "",
  50622. this.color = new n.Color(e),
  50623. this.density = void 0 !== t ? t : 25e-5
  50624. }
  50625. ,
  50626. n.FogExp2.prototype.clone = function() {
  50627. return new n.FogExp2(this.color.getHex(),this.density)
  50628. }
  50629. ,
  50630. n.ShaderChunk = {},
  50631. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50632. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50633. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50634. 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",
  50635. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50636. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50637. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50638. 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",
  50639. 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",
  50640. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50641. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50642. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50643. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50644. 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",
  50645. 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",
  50646. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50647. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50648. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50649. 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",
  50650. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50651. 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",
  50652. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50653. 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",
  50654. 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",
  50655. 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",
  50656. 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",
  50657. 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",
  50658. 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",
  50659. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50660. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50661. 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",
  50662. 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",
  50663. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50664. 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",
  50665. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50666. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50667. 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",
  50668. 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",
  50669. 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",
  50670. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50671. 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",
  50672. 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",
  50673. 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",
  50674. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50675. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50676. 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",
  50677. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50678. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50679. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50680. 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",
  50681. 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";
  50682. 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";
  50683. 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",
  50684. 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",
  50685. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50686. 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",
  50687. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50688. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50689. 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",
  50690. 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",
  50691. 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",
  50692. 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",
  50693. 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",
  50694. 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",
  50695. 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",
  50696. 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",
  50697. 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",
  50698. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50699. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50700. 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",
  50701. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50702. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50703. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50704. 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",
  50705. 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",
  50706. 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",
  50707. 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",
  50708. n.UniformsUtils = {
  50709. merge: function(e) {
  50710. for (var t = {}, i = 0; i < e.length; i++) {
  50711. var n = this.clone(e[i]);
  50712. for (var r in n)
  50713. t[r] = n[r]
  50714. }
  50715. return t
  50716. },
  50717. clone: function(e) {
  50718. var t = {};
  50719. for (var i in e) {
  50720. t[i] = {};
  50721. for (var r in e[i]) {
  50722. var o = e[i][r];
  50723. 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
  50724. }
  50725. }
  50726. return t
  50727. }
  50728. },
  50729. n.UniformsLib = {
  50730. common: {
  50731. diffuse: {
  50732. type: "c",
  50733. value: new n.Color(15658734)
  50734. },
  50735. opacity: {
  50736. type: "f",
  50737. value: 1
  50738. },
  50739. map: {
  50740. type: "t",
  50741. value: null
  50742. },
  50743. offsetRepeat: {
  50744. type: "v4",
  50745. value: new n.Vector4(0,0,1,1)
  50746. },
  50747. specularMap: {
  50748. type: "t",
  50749. value: null
  50750. },
  50751. alphaMap: {
  50752. type: "t",
  50753. value: null
  50754. },
  50755. envMap: {
  50756. type: "t",
  50757. value: null
  50758. },
  50759. flipEnvMap: {
  50760. type: "f",
  50761. value: -1
  50762. },
  50763. reflectivity: {
  50764. type: "f",
  50765. value: 1
  50766. },
  50767. refractionRatio: {
  50768. type: "f",
  50769. value: .98
  50770. }
  50771. },
  50772. aomap: {
  50773. aoMap: {
  50774. type: "t",
  50775. value: null
  50776. },
  50777. aoMapIntensity: {
  50778. type: "f",
  50779. value: 1
  50780. }
  50781. },
  50782. lightmap: {
  50783. lightMap: {
  50784. type: "t",
  50785. value: null
  50786. },
  50787. lightMapIntensity: {
  50788. type: "f",
  50789. value: 1
  50790. }
  50791. },
  50792. emissivemap: {
  50793. emissiveMap: {
  50794. type: "t",
  50795. value: null
  50796. }
  50797. },
  50798. bumpmap: {
  50799. bumpMap: {
  50800. type: "t",
  50801. value: null
  50802. },
  50803. bumpScale: {
  50804. type: "f",
  50805. value: 1
  50806. }
  50807. },
  50808. normalmap: {
  50809. normalMap: {
  50810. type: "t",
  50811. value: null
  50812. },
  50813. normalScale: {
  50814. type: "v2",
  50815. value: new n.Vector2(1,1)
  50816. }
  50817. },
  50818. displacementmap: {
  50819. displacementMap: {
  50820. type: "t",
  50821. value: null
  50822. },
  50823. displacementScale: {
  50824. type: "f",
  50825. value: 1
  50826. },
  50827. displacementBias: {
  50828. type: "f",
  50829. value: 0
  50830. }
  50831. },
  50832. roughnessmap: {
  50833. roughnessMap: {
  50834. type: "t",
  50835. value: null
  50836. }
  50837. },
  50838. metalnessmap: {
  50839. metalnessMap: {
  50840. type: "t",
  50841. value: null
  50842. }
  50843. },
  50844. fog: {
  50845. fogDensity: {
  50846. type: "f",
  50847. value: 25e-5
  50848. },
  50849. fogNear: {
  50850. type: "f",
  50851. value: 1
  50852. },
  50853. fogFar: {
  50854. type: "f",
  50855. value: 2e3
  50856. },
  50857. fogColor: {
  50858. type: "c",
  50859. value: new n.Color(16777215)
  50860. }
  50861. },
  50862. lights: {
  50863. ambientLightColor: {
  50864. type: "fv",
  50865. value: []
  50866. },
  50867. directionalLights: {
  50868. type: "sa",
  50869. value: [],
  50870. properties: {
  50871. direction: {
  50872. type: "v3"
  50873. },
  50874. color: {
  50875. type: "c"
  50876. },
  50877. shadow: {
  50878. type: "i"
  50879. },
  50880. shadowBias: {
  50881. type: "f"
  50882. },
  50883. shadowRadius: {
  50884. type: "f"
  50885. },
  50886. shadowMapSize: {
  50887. type: "v2"
  50888. }
  50889. }
  50890. },
  50891. directionalShadowMap: {
  50892. type: "tv",
  50893. value: []
  50894. },
  50895. directionalShadowMatrix: {
  50896. type: "m4v",
  50897. value: []
  50898. },
  50899. spotLights: {
  50900. type: "sa",
  50901. value: [],
  50902. properties: {
  50903. color: {
  50904. type: "c"
  50905. },
  50906. position: {
  50907. type: "v3"
  50908. },
  50909. direction: {
  50910. type: "v3"
  50911. },
  50912. distance: {
  50913. type: "f"
  50914. },
  50915. coneCos: {
  50916. type: "f"
  50917. },
  50918. penumbraCos: {
  50919. type: "f"
  50920. },
  50921. decay: {
  50922. type: "f"
  50923. },
  50924. shadow: {
  50925. type: "i"
  50926. },
  50927. shadowBias: {
  50928. type: "f"
  50929. },
  50930. shadowRadius: {
  50931. type: "f"
  50932. },
  50933. shadowMapSize: {
  50934. type: "v2"
  50935. }
  50936. }
  50937. },
  50938. spotShadowMap: {
  50939. type: "tv",
  50940. value: []
  50941. },
  50942. spotShadowMatrix: {
  50943. type: "m4v",
  50944. value: []
  50945. },
  50946. pointLights: {
  50947. type: "sa",
  50948. value: [],
  50949. properties: {
  50950. color: {
  50951. type: "c"
  50952. },
  50953. position: {
  50954. type: "v3"
  50955. },
  50956. decay: {
  50957. type: "f"
  50958. },
  50959. distance: {
  50960. type: "f"
  50961. },
  50962. shadow: {
  50963. type: "i"
  50964. },
  50965. shadowBias: {
  50966. type: "f"
  50967. },
  50968. shadowRadius: {
  50969. type: "f"
  50970. },
  50971. shadowMapSize: {
  50972. type: "v2"
  50973. }
  50974. }
  50975. },
  50976. pointShadowMap: {
  50977. type: "tv",
  50978. value: []
  50979. },
  50980. pointShadowMatrix: {
  50981. type: "m4v",
  50982. value: []
  50983. },
  50984. hemisphereLights: {
  50985. type: "sa",
  50986. value: [],
  50987. properties: {
  50988. direction: {
  50989. type: "v3"
  50990. },
  50991. skyColor: {
  50992. type: "c"
  50993. },
  50994. groundColor: {
  50995. type: "c"
  50996. }
  50997. }
  50998. }
  50999. },
  51000. points: {
  51001. diffuse: {
  51002. type: "c",
  51003. value: new n.Color(15658734)
  51004. },
  51005. opacity: {
  51006. type: "f",
  51007. value: 1
  51008. },
  51009. size: {
  51010. type: "f",
  51011. value: 1
  51012. },
  51013. scale: {
  51014. type: "f",
  51015. value: 1
  51016. },
  51017. map: {
  51018. type: "t",
  51019. value: null
  51020. },
  51021. offsetRepeat: {
  51022. type: "v4",
  51023. value: new n.Vector4(0,0,1,1)
  51024. }
  51025. }
  51026. },
  51027. 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",
  51028. 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",
  51029. 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",
  51030. 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",
  51031. 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",
  51032. 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",
  51033. 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",
  51034. 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",
  51035. 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",
  51036. 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",
  51037. 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",
  51038. 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",
  51039. 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",
  51040. 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",
  51041. 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",
  51042. 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",
  51043. 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",
  51044. 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",
  51045. 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",
  51046. 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",
  51047. 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",
  51048. 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",
  51049. 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",
  51050. 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",
  51051. n.ShaderLib = {
  51052. basic: {
  51053. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51054. vertexShader: n.ShaderChunk.meshbasic_vert,
  51055. fragmentShader: n.ShaderChunk.meshbasic_frag
  51056. },
  51057. lambert: {
  51058. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51059. emissive: {
  51060. type: "c",
  51061. value: new n.Color(0)
  51062. }
  51063. }]),
  51064. vertexShader: n.ShaderChunk.meshlambert_vert,
  51065. fragmentShader: n.ShaderChunk.meshlambert_frag
  51066. },
  51067. phong: {
  51068. 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, {
  51069. emissive: {
  51070. type: "c",
  51071. value: new n.Color(0)
  51072. },
  51073. specular: {
  51074. type: "c",
  51075. value: new n.Color(1118481)
  51076. },
  51077. shininess: {
  51078. type: "f",
  51079. value: 30
  51080. }
  51081. }]),
  51082. vertexShader: n.ShaderChunk.meshphong_vert,
  51083. fragmentShader: n.ShaderChunk.meshphong_frag
  51084. },
  51085. standard: {
  51086. 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, {
  51087. emissive: {
  51088. type: "c",
  51089. value: new n.Color(0)
  51090. },
  51091. roughness: {
  51092. type: "f",
  51093. value: .5
  51094. },
  51095. metalness: {
  51096. type: "f",
  51097. value: 0
  51098. },
  51099. envMapIntensity: {
  51100. type: "f",
  51101. value: 1
  51102. }
  51103. }]),
  51104. vertexShader: n.ShaderChunk.meshstandard_vert,
  51105. fragmentShader: n.ShaderChunk.meshstandard_frag
  51106. },
  51107. points: {
  51108. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51109. vertexShader: n.ShaderChunk.points_vert,
  51110. fragmentShader: n.ShaderChunk.points_frag
  51111. },
  51112. dashed: {
  51113. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51114. scale: {
  51115. type: "f",
  51116. value: 1
  51117. },
  51118. dashSize: {
  51119. type: "f",
  51120. value: 1
  51121. },
  51122. totalSize: {
  51123. type: "f",
  51124. value: 2
  51125. }
  51126. }]),
  51127. vertexShader: n.ShaderChunk.linedashed_vert,
  51128. fragmentShader: n.ShaderChunk.linedashed_frag
  51129. },
  51130. depth: {
  51131. uniforms: {
  51132. mNear: {
  51133. type: "f",
  51134. value: 1
  51135. },
  51136. mFar: {
  51137. type: "f",
  51138. value: 2e3
  51139. },
  51140. opacity: {
  51141. type: "f",
  51142. value: 1
  51143. }
  51144. },
  51145. vertexShader: n.ShaderChunk.depth_vert,
  51146. fragmentShader: n.ShaderChunk.depth_frag
  51147. },
  51148. normal: {
  51149. uniforms: {
  51150. opacity: {
  51151. type: "f",
  51152. value: 1
  51153. }
  51154. },
  51155. vertexShader: n.ShaderChunk.normal_vert,
  51156. fragmentShader: n.ShaderChunk.normal_frag
  51157. },
  51158. cube: {
  51159. uniforms: {
  51160. tCube: {
  51161. type: "t",
  51162. value: null
  51163. },
  51164. tFlip: {
  51165. type: "f",
  51166. value: -1
  51167. }
  51168. },
  51169. vertexShader: n.ShaderChunk.cube_vert,
  51170. fragmentShader: n.ShaderChunk.cube_frag
  51171. },
  51172. equirect: {
  51173. uniforms: {
  51174. tEquirect: {
  51175. type: "t",
  51176. value: null
  51177. },
  51178. tFlip: {
  51179. type: "f",
  51180. value: -1
  51181. }
  51182. },
  51183. vertexShader: n.ShaderChunk.equirect_vert,
  51184. fragmentShader: n.ShaderChunk.equirect_frag
  51185. },
  51186. depthRGBA: {
  51187. uniforms: {},
  51188. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51189. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51190. },
  51191. distanceRGBA: {
  51192. uniforms: {
  51193. lightPos: {
  51194. type: "v3",
  51195. value: new n.Vector3(0,0,0)
  51196. }
  51197. },
  51198. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51199. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51200. }
  51201. },
  51202. n.WebGLRenderer = function(e) {
  51203. function t() {
  51204. return null === ye ? Oe : 1
  51205. }
  51206. function i(e, t, i, n) {
  51207. se === !0 && (e *= n,
  51208. t *= n,
  51209. i *= n),
  51210. Ye.clearColor(e, t, i, n)
  51211. }
  51212. function r() {
  51213. Ye.init(),
  51214. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51215. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51216. i(Se.r, Se.g, Se.b, Me)
  51217. }
  51218. function o() {
  51219. Ae = null,
  51220. be = null,
  51221. Ee = "",
  51222. Ie = -1,
  51223. Ye.reset()
  51224. }
  51225. function a(e) {
  51226. e.preventDefault(),
  51227. o(),
  51228. r(),
  51229. Xe.clear()
  51230. }
  51231. function s(e) {
  51232. var t = e.target;
  51233. t.removeEventListener("dispose", s),
  51234. h(t),
  51235. ke.textures--
  51236. }
  51237. function l(e) {
  51238. var t = e.target;
  51239. t.removeEventListener("dispose", l),
  51240. u(t),
  51241. ke.textures--
  51242. }
  51243. function c(e) {
  51244. var t = e.target;
  51245. t.removeEventListener("dispose", c),
  51246. d(t)
  51247. }
  51248. function h(e) {
  51249. var t = Xe.get(e);
  51250. if (e.image && t.__image__webglTextureCube)
  51251. Ge.deleteTexture(t.__image__webglTextureCube);
  51252. else {
  51253. if (void 0 === t.__webglInit)
  51254. return;
  51255. Ge.deleteTexture(t.__webglTexture)
  51256. }
  51257. Xe.delete(e)
  51258. }
  51259. function u(e) {
  51260. var t = Xe.get(e)
  51261. , i = Xe.get(e.texture);
  51262. if (e && void 0 !== i.__webglTexture) {
  51263. if (Ge.deleteTexture(i.__webglTexture),
  51264. e instanceof n.WebGLRenderTargetCube)
  51265. for (var r = 0; r < 6; r++)
  51266. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51267. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51268. else
  51269. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51270. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51271. Xe.delete(e.texture),
  51272. Xe.delete(e)
  51273. }
  51274. }
  51275. function d(e) {
  51276. p(e),
  51277. Xe.delete(e)
  51278. }
  51279. function p(e) {
  51280. var t = Xe.get(e).program;
  51281. e.program = void 0,
  51282. void 0 !== t && qe.releaseProgram(t)
  51283. }
  51284. function f(e, t, i, r) {
  51285. var o;
  51286. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51287. null === o))
  51288. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51289. void 0 === r && (r = 0),
  51290. Ye.initAttributes();
  51291. var a = i.attributes
  51292. , s = t.getAttributes()
  51293. , l = e.defaultAttributeValues;
  51294. for (var c in s) {
  51295. var h = s[c];
  51296. if (h >= 0) {
  51297. var u = a[c];
  51298. if (void 0 !== u) {
  51299. var d = u.itemSize
  51300. , p = Ze.getAttributeBuffer(u);
  51301. if (u instanceof n.InterleavedBufferAttribute) {
  51302. var f = u.data
  51303. , g = f.stride
  51304. , m = u.offset;
  51305. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51306. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51307. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51308. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51309. } else
  51310. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51311. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51312. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51313. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51314. } else if (void 0 !== l) {
  51315. var v = l[c];
  51316. if (void 0 !== v)
  51317. switch (v.length) {
  51318. case 2:
  51319. Ge.vertexAttrib2fv(h, v);
  51320. break;
  51321. case 3:
  51322. Ge.vertexAttrib3fv(h, v);
  51323. break;
  51324. case 4:
  51325. Ge.vertexAttrib4fv(h, v);
  51326. break;
  51327. default:
  51328. Ge.vertexAttrib1fv(h, v)
  51329. }
  51330. }
  51331. }
  51332. }
  51333. Ye.disableUnusedAttributes()
  51334. }
  51335. function g(e, t) {
  51336. return Math.abs(t[0]) - Math.abs(e[0])
  51337. }
  51338. function m(e, t) {
  51339. 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
  51340. }
  51341. function v(e, t) {
  51342. 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
  51343. }
  51344. function A(e, t, i, n, r) {
  51345. var o, a;
  51346. i.transparent ? (o = de,
  51347. a = ++pe) : (o = he,
  51348. a = ++ue);
  51349. var s = o[a];
  51350. void 0 !== s ? (s.id = e.id,
  51351. s.object = e,
  51352. s.geometry = t,
  51353. s.material = i,
  51354. s.z = Ve.z,
  51355. s.group = r) : (s = {
  51356. id: e.id,
  51357. object: e,
  51358. geometry: t,
  51359. material: i,
  51360. z: Ve.z,
  51361. group: r
  51362. },
  51363. o.push(s))
  51364. }
  51365. function y(e, t) {
  51366. if (e.visible !== !1) {
  51367. if (e.layers.test(t.layers))
  51368. if (e instanceof n.Light)
  51369. ce.push(e);
  51370. else if (e instanceof n.Sprite)
  51371. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51372. else if (e instanceof n.LensFlare)
  51373. me.push(e);
  51374. else if (e instanceof n.ImmediateRenderObject)
  51375. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51376. Ve.applyProjection(Fe)),
  51377. A(e, null, e.material, Ve.z, null);
  51378. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51379. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51380. var i = e.material;
  51381. if (i.visible === !0) {
  51382. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51383. Ve.applyProjection(Fe));
  51384. var r = Ze.update(e);
  51385. if (i instanceof n.MultiMaterial)
  51386. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51387. var c = o[s]
  51388. , h = a[c.materialIndex];
  51389. h.visible === !0 && A(e, r, h, Ve.z, c)
  51390. }
  51391. else
  51392. A(e, r, i, Ve.z, null)
  51393. }
  51394. }
  51395. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51396. y(u[s], t)
  51397. }
  51398. }
  51399. function C(e, t, i, r) {
  51400. for (var o = 0, a = e.length; o < a; o++) {
  51401. var s = e[o]
  51402. , l = s.object
  51403. , c = s.geometry
  51404. , h = void 0 === r ? s.material : r
  51405. , u = s.group;
  51406. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51407. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51408. l instanceof n.ImmediateRenderObject) {
  51409. E(h);
  51410. var d = w(t, i, h, l);
  51411. Ee = "",
  51412. l.render(function(e) {
  51413. ve.renderBufferImmediate(e, d, h)
  51414. })
  51415. } else
  51416. ve.renderBufferDirect(t, i, c, h, l, u)
  51417. }
  51418. }
  51419. function I(e, t, i) {
  51420. var r = Xe.get(e)
  51421. , o = qe.getParameters(e, Ue, t, i)
  51422. , a = qe.getProgramCode(e, o)
  51423. , s = r.program
  51424. , l = !0;
  51425. if (void 0 === s)
  51426. e.addEventListener("dispose", c);
  51427. else if (s.code !== a)
  51428. p(e);
  51429. else {
  51430. if (void 0 !== o.shaderID)
  51431. return;
  51432. l = !1
  51433. }
  51434. if (l) {
  51435. if (o.shaderID) {
  51436. var h = n.ShaderLib[o.shaderID];
  51437. r.__webglShader = {
  51438. name: e.type,
  51439. uniforms: n.UniformsUtils.clone(h.uniforms),
  51440. vertexShader: h.vertexShader,
  51441. fragmentShader: h.fragmentShader
  51442. }
  51443. } else
  51444. r.__webglShader = {
  51445. name: e.type,
  51446. uniforms: e.uniforms,
  51447. vertexShader: e.vertexShader,
  51448. fragmentShader: e.fragmentShader
  51449. };
  51450. e.__webglShader = r.__webglShader,
  51451. s = qe.acquireProgram(e, o, a),
  51452. r.program = s,
  51453. e.program = s
  51454. }
  51455. var u = s.getAttributes();
  51456. if (e.morphTargets) {
  51457. e.numSupportedMorphTargets = 0;
  51458. for (var d = 0; d < ve.maxMorphTargets; d++)
  51459. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51460. }
  51461. if (e.morphNormals) {
  51462. e.numSupportedMorphNormals = 0;
  51463. for (var d = 0; d < ve.maxMorphNormals; d++)
  51464. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51465. }
  51466. r.uniformsList = [];
  51467. var f = r.__webglShader.uniforms
  51468. , g = r.program.getUniforms();
  51469. for (var m in f) {
  51470. var v = g[m];
  51471. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51472. }
  51473. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51474. f.ambientLightColor.value = Ue.ambient,
  51475. f.directionalLights.value = Ue.directional,
  51476. f.spotLights.value = Ue.spot,
  51477. f.pointLights.value = Ue.point,
  51478. f.hemisphereLights.value = Ue.hemi,
  51479. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51480. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51481. f.spotShadowMap.value = Ue.spotShadowMap,
  51482. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51483. f.pointShadowMap.value = Ue.pointShadowMap,
  51484. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51485. r.hasDynamicUniforms = !1;
  51486. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51487. var C = r.uniformsList[A][0];
  51488. if (C.dynamic === !0) {
  51489. r.hasDynamicUniforms = !0;
  51490. break
  51491. }
  51492. }
  51493. }
  51494. function E(e) {
  51495. b(e),
  51496. 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),
  51497. Ye.setDepthFunc(e.depthFunc),
  51498. Ye.setDepthTest(e.depthTest),
  51499. Ye.setDepthWrite(e.depthWrite),
  51500. Ye.setColorWrite(e.colorWrite),
  51501. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51502. }
  51503. function b(e) {
  51504. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51505. Ye.setFlipSided(e.side === n.BackSide)
  51506. }
  51507. function w(e, t, i, r) {
  51508. xe = 0;
  51509. var o = Xe.get(i);
  51510. void 0 === o.program && (i.needsUpdate = !0),
  51511. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51512. i.needsUpdate && (I(i, t, r),
  51513. i.needsUpdate = !1);
  51514. var a = !1
  51515. , s = !1
  51516. , l = !1
  51517. , c = o.program
  51518. , h = c.getUniforms()
  51519. , u = o.__webglShader.uniforms;
  51520. if (c.id !== Ae && (Ge.useProgram(c.program),
  51521. Ae = c.id,
  51522. a = !0,
  51523. s = !0,
  51524. l = !0),
  51525. i.id !== Ie && (Ie = i.id,
  51526. s = !0),
  51527. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51528. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51529. e !== be && (be = e,
  51530. s = !0,
  51531. l = !0),
  51532. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51533. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51534. (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),
  51535. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51536. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51537. i.skinning)
  51538. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51539. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51540. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51541. if (void 0 !== h.boneTexture) {
  51542. var d = B();
  51543. Ge.uniform1i(h.boneTexture, d),
  51544. ve.setTexture(r.skeleton.boneTexture, d)
  51545. }
  51546. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51547. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51548. } else
  51549. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51550. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51551. t && i.fog && R(u, t),
  51552. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51553. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51554. 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,
  51555. u.mFar.value = e.far,
  51556. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51557. V(o.uniformsList)),
  51558. N(h, r),
  51559. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51560. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51561. c
  51562. }
  51563. function _(e, t, i) {
  51564. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51565. var a = e[r][0]
  51566. , s = a.onUpdateCallback;
  51567. void 0 !== s && (s.bind(a)(t, i),
  51568. n.push(e[r]))
  51569. }
  51570. V(n)
  51571. }
  51572. function T(e, t) {
  51573. e.opacity.value = t.opacity,
  51574. e.diffuse.value = t.color,
  51575. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51576. e.map.value = t.map,
  51577. e.specularMap.value = t.specularMap,
  51578. e.alphaMap.value = t.alphaMap,
  51579. t.aoMap && (e.aoMap.value = t.aoMap,
  51580. e.aoMapIntensity.value = t.aoMapIntensity);
  51581. var i;
  51582. 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),
  51583. void 0 !== i) {
  51584. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51585. var r = i.offset
  51586. , o = i.repeat;
  51587. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51588. }
  51589. e.envMap.value = t.envMap,
  51590. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51591. e.reflectivity.value = t.reflectivity,
  51592. e.refractionRatio.value = t.refractionRatio
  51593. }
  51594. function x(e, t) {
  51595. e.diffuse.value = t.color,
  51596. e.opacity.value = t.opacity
  51597. }
  51598. function S(e, t) {
  51599. e.dashSize.value = t.dashSize,
  51600. e.totalSize.value = t.dashSize + t.gapSize,
  51601. e.scale.value = t.scale
  51602. }
  51603. function M(e, t) {
  51604. if (e.diffuse.value = t.color,
  51605. e.opacity.value = t.opacity,
  51606. e.size.value = t.size * Oe,
  51607. e.scale.value = te.clientHeight / 2,
  51608. e.map.value = t.map,
  51609. null !== t.map) {
  51610. var i = t.map.offset
  51611. , n = t.map.repeat;
  51612. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51613. }
  51614. }
  51615. function R(e, t) {
  51616. e.fogColor.value = t.color,
  51617. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51618. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51619. }
  51620. function P(e, t) {
  51621. t.lightMap && (e.lightMap.value = t.lightMap,
  51622. e.lightMapIntensity.value = t.lightMapIntensity),
  51623. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51624. }
  51625. function O(e, t) {
  51626. e.specular.value = t.specular,
  51627. e.shininess.value = Math.max(t.shininess, 1e-4),
  51628. t.lightMap && (e.lightMap.value = t.lightMap,
  51629. e.lightMapIntensity.value = t.lightMapIntensity),
  51630. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51631. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51632. e.bumpScale.value = t.bumpScale),
  51633. t.normalMap && (e.normalMap.value = t.normalMap,
  51634. e.normalScale.value.copy(t.normalScale)),
  51635. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51636. e.displacementScale.value = t.displacementScale,
  51637. e.displacementBias.value = t.displacementBias)
  51638. }
  51639. function L(e, t) {
  51640. e.roughness.value = t.roughness,
  51641. e.metalness.value = t.metalness,
  51642. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51643. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51644. t.lightMap && (e.lightMap.value = t.lightMap,
  51645. e.lightMapIntensity.value = t.lightMapIntensity),
  51646. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51647. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51648. e.bumpScale.value = t.bumpScale),
  51649. t.normalMap && (e.normalMap.value = t.normalMap,
  51650. e.normalScale.value.copy(t.normalScale)),
  51651. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51652. e.displacementScale.value = t.displacementScale,
  51653. e.displacementBias.value = t.displacementBias),
  51654. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51655. }
  51656. function D(e, t) {
  51657. e.ambientLightColor.needsUpdate = t,
  51658. e.directionalLights.needsUpdate = t,
  51659. e.pointLights.needsUpdate = t,
  51660. e.spotLights.needsUpdate = t,
  51661. e.hemisphereLights.needsUpdate = t
  51662. }
  51663. function N(e, t) {
  51664. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51665. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51666. }
  51667. function B() {
  51668. var e = xe;
  51669. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51670. xe += 1,
  51671. e
  51672. }
  51673. function F(e, t, i, r) {
  51674. var o, a;
  51675. if ("1i" === t)
  51676. Ge.uniform1i(i, r);
  51677. else if ("1f" === t)
  51678. Ge.uniform1f(i, r);
  51679. else if ("2f" === t)
  51680. Ge.uniform2f(i, r[0], r[1]);
  51681. else if ("3f" === t)
  51682. Ge.uniform3f(i, r[0], r[1], r[2]);
  51683. else if ("4f" === t)
  51684. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51685. else if ("1iv" === t)
  51686. Ge.uniform1iv(i, r);
  51687. else if ("3iv" === t)
  51688. Ge.uniform3iv(i, r);
  51689. else if ("1fv" === t)
  51690. Ge.uniform1fv(i, r);
  51691. else if ("2fv" === t)
  51692. Ge.uniform2fv(i, r);
  51693. else if ("3fv" === t)
  51694. Ge.uniform3fv(i, r);
  51695. else if ("4fv" === t)
  51696. Ge.uniform4fv(i, r);
  51697. else if ("Matrix2fv" === t)
  51698. Ge.uniformMatrix2fv(i, !1, r);
  51699. else if ("Matrix3fv" === t)
  51700. Ge.uniformMatrix3fv(i, !1, r);
  51701. else if ("Matrix4fv" === t)
  51702. Ge.uniformMatrix4fv(i, !1, r);
  51703. else if ("i" === t)
  51704. Ge.uniform1i(i, r);
  51705. else if ("f" === t)
  51706. Ge.uniform1f(i, r);
  51707. else if ("v2" === t)
  51708. Ge.uniform2f(i, r.x, r.y);
  51709. else if ("v3" === t)
  51710. Ge.uniform3f(i, r.x, r.y, r.z);
  51711. else if ("v4" === t)
  51712. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51713. else if ("c" === t)
  51714. Ge.uniform3f(i, r.r, r.g, r.b);
  51715. else if ("s" === t) {
  51716. var s = e.properties;
  51717. for (var l in s) {
  51718. var c = s[l]
  51719. , h = i[l]
  51720. , u = r[l];
  51721. F(c, c.type, h, u)
  51722. }
  51723. } else if ("sa" === t)
  51724. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51725. for (var l in s) {
  51726. var c = s[l]
  51727. , h = i[d][l]
  51728. , u = r[d][l];
  51729. F(c, c.type, h, u)
  51730. }
  51731. else if ("iv1" === t)
  51732. Ge.uniform1iv(i, r);
  51733. else if ("iv" === t)
  51734. Ge.uniform3iv(i, r);
  51735. else if ("fv1" === t)
  51736. Ge.uniform1fv(i, r);
  51737. else if ("fv" === t)
  51738. Ge.uniform3fv(i, r);
  51739. else if ("v2v" === t) {
  51740. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51741. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51742. f += 2)
  51743. e._array[f + 0] = r[d].x,
  51744. e._array[f + 1] = r[d].y;
  51745. Ge.uniform2fv(i, e._array)
  51746. } else if ("v3v" === t) {
  51747. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51748. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51749. m += 3)
  51750. e._array[m + 0] = r[d].x,
  51751. e._array[m + 1] = r[d].y,
  51752. e._array[m + 2] = r[d].z;
  51753. Ge.uniform3fv(i, e._array)
  51754. } else if ("v4v" === t) {
  51755. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51756. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51757. v += 4)
  51758. e._array[v + 0] = r[d].x,
  51759. e._array[v + 1] = r[d].y,
  51760. e._array[v + 2] = r[d].z,
  51761. e._array[v + 3] = r[d].w;
  51762. Ge.uniform4fv(i, e._array)
  51763. } else if ("m2" === t)
  51764. Ge.uniformMatrix2fv(i, !1, r.elements);
  51765. else if ("m3" === t)
  51766. Ge.uniformMatrix3fv(i, !1, r.elements);
  51767. else if ("m3v" === t) {
  51768. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51769. for (var d = 0, g = r.length; d < g; d++)
  51770. r[d].flattenToArrayOffset(e._array, 9 * d);
  51771. Ge.uniformMatrix3fv(i, !1, e._array)
  51772. } else if ("m4" === t)
  51773. Ge.uniformMatrix4fv(i, !1, r.elements);
  51774. else if ("m4v" === t) {
  51775. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51776. for (var d = 0, g = r.length; d < g; d++)
  51777. r[d].flattenToArrayOffset(e._array, 16 * d);
  51778. Ge.uniformMatrix4fv(i, !1, e._array)
  51779. } else if ("t" === t) {
  51780. if (o = r,
  51781. a = B(),
  51782. Ge.uniform1i(i, a),
  51783. !o)
  51784. return;
  51785. 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)
  51786. } else if ("tv" === t) {
  51787. void 0 === e._array && (e._array = []);
  51788. for (var d = 0, g = e.value.length; d < g; d++)
  51789. e._array[d] = B();
  51790. Ge.uniform1iv(i, e._array);
  51791. for (var d = 0, g = e.value.length; d < g; d++)
  51792. o = e.value[d],
  51793. a = e._array[d],
  51794. 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))
  51795. } else
  51796. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51797. }
  51798. function V(e) {
  51799. for (var t = 0, i = e.length; t < i; t++) {
  51800. var n = e[t][0];
  51801. if (n.needsUpdate !== !1) {
  51802. var r = n.type
  51803. , o = e[t][1]
  51804. , a = n.value;
  51805. F(n, r, o, a)
  51806. }
  51807. }
  51808. }
  51809. function U(e, t) {
  51810. 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;
  51811. for (Ue.shadowsPointLight = 0,
  51812. i = 0,
  51813. r = e.length; i < r; i++)
  51814. if (o = e[i],
  51815. a = o.color,
  51816. s = o.intensity,
  51817. l = o.distance,
  51818. o instanceof n.AmbientLight)
  51819. c += a.r * s,
  51820. h += a.g * s,
  51821. u += a.b * s;
  51822. else if (o instanceof n.DirectionalLight) {
  51823. var A = Ke.get(o);
  51824. A.color.copy(o.color).multiplyScalar(o.intensity),
  51825. A.direction.setFromMatrixPosition(o.matrixWorld),
  51826. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51827. A.direction.sub(Ve),
  51828. A.direction.transformDirection(d),
  51829. A.shadow = o.castShadow,
  51830. o.castShadow && (A.shadowBias = o.shadow.bias,
  51831. A.shadowRadius = o.shadow.radius,
  51832. A.shadowMapSize = o.shadow.mapSize,
  51833. Ue.shadows[v++] = o),
  51834. Ue.directionalShadowMap[p] = o.shadow.map,
  51835. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51836. Ue.directional[p++] = A
  51837. } else if (o instanceof n.SpotLight) {
  51838. var A = Ke.get(o);
  51839. A.position.setFromMatrixPosition(o.matrixWorld),
  51840. A.position.applyMatrix4(d),
  51841. A.color.copy(a).multiplyScalar(s),
  51842. A.distance = l,
  51843. A.direction.setFromMatrixPosition(o.matrixWorld),
  51844. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51845. A.direction.sub(Ve),
  51846. A.direction.transformDirection(d),
  51847. A.coneCos = Math.cos(o.angle),
  51848. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51849. A.decay = 0 === o.distance ? 0 : o.decay,
  51850. A.shadow = o.castShadow,
  51851. o.castShadow && (A.shadowBias = o.shadow.bias,
  51852. A.shadowRadius = o.shadow.radius,
  51853. A.shadowMapSize = o.shadow.mapSize,
  51854. Ue.shadows[v++] = o),
  51855. Ue.spotShadowMap[g] = o.shadow.map,
  51856. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51857. Ue.spot[g++] = A
  51858. } else if (o instanceof n.PointLight) {
  51859. var A = Ke.get(o);
  51860. A.position.setFromMatrixPosition(o.matrixWorld),
  51861. A.position.applyMatrix4(d),
  51862. A.color.copy(o.color).multiplyScalar(o.intensity),
  51863. A.distance = o.distance,
  51864. A.decay = 0 === o.distance ? 0 : o.decay,
  51865. A.shadow = o.castShadow,
  51866. o.castShadow && (A.shadowBias = o.shadow.bias,
  51867. A.shadowRadius = o.shadow.radius,
  51868. A.shadowMapSize = o.shadow.mapSize,
  51869. Ue.shadows[v++] = o),
  51870. Ue.pointShadowMap[f] = o.shadow.map,
  51871. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51872. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51873. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51874. Ue.point[f++] = A
  51875. } else if (o instanceof n.HemisphereLight) {
  51876. var A = Ke.get(o);
  51877. A.direction.setFromMatrixPosition(o.matrixWorld),
  51878. A.direction.transformDirection(d),
  51879. A.direction.normalize(),
  51880. A.skyColor.copy(o.color).multiplyScalar(s),
  51881. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51882. Ue.hemi[m++] = A
  51883. }
  51884. Ue.ambient[0] = c,
  51885. Ue.ambient[1] = h,
  51886. Ue.ambient[2] = u,
  51887. Ue.directional.length = p,
  51888. Ue.spot.length = g,
  51889. Ue.point.length = f,
  51890. Ue.hemi.length = m,
  51891. Ue.shadows.length = v,
  51892. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51893. }
  51894. function k(e, t, i) {
  51895. var r;
  51896. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51897. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51898. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51899. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51900. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51901. 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),
  51902. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51903. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51904. 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)),
  51905. r = We.get("EXT_texture_filter_anisotropic")) {
  51906. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51907. return;
  51908. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51909. return;
  51910. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51911. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51912. }
  51913. }
  51914. function H(e, t, i) {
  51915. void 0 === e.__webglInit && (e.__webglInit = !0,
  51916. t.addEventListener("dispose", s),
  51917. e.__webglTexture = Ge.createTexture(),
  51918. ke.textures++),
  51919. Ye.activeTexture(Ge.TEXTURE0 + i),
  51920. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51921. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51922. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51923. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51924. var r = G(t.image, je.maxTextureSize);
  51925. W(t) && z(r) === !1 && (r = j(r));
  51926. var o = z(r)
  51927. , a = ee(t.format)
  51928. , l = ee(t.type);
  51929. k(Ge.TEXTURE_2D, t, o);
  51930. var c, h = t.mipmaps;
  51931. if (t instanceof n.DataTexture)
  51932. if (h.length > 0 && o) {
  51933. for (var u = 0, d = h.length; u < d; u++)
  51934. c = h[u],
  51935. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51936. t.generateMipmaps = !1
  51937. } else
  51938. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51939. else if (t instanceof n.CompressedTexture)
  51940. for (var u = 0, d = h.length; u < d; u++)
  51941. c = h[u],
  51942. 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);
  51943. else if (h.length > 0 && o) {
  51944. for (var u = 0, d = h.length; u < d; u++)
  51945. c = h[u],
  51946. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51947. t.generateMipmaps = !1
  51948. } else
  51949. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51950. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51951. e.__version = t.version,
  51952. t.onUpdate && t.onUpdate(t)
  51953. }
  51954. function G(e, t) {
  51955. if (e.width > t || e.height > t) {
  51956. var i = t / Math.max(e.width, e.height)
  51957. , n = document.createElement("canvas");
  51958. n.width = Math.floor(e.width * i),
  51959. n.height = Math.floor(e.height * i);
  51960. var r = n.getContext("2d");
  51961. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51962. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51963. n
  51964. }
  51965. return e
  51966. }
  51967. function z(e) {
  51968. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51969. }
  51970. function W(e) {
  51971. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51972. }
  51973. function j(e) {
  51974. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51975. var t = document.createElement("canvas");
  51976. t.width = n.Math.nearestPowerOfTwo(e.width),
  51977. t.height = n.Math.nearestPowerOfTwo(e.height);
  51978. var i = t.getContext("2d");
  51979. return i.drawImage(e, 0, 0, t.width, t.height),
  51980. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51981. t
  51982. }
  51983. return e
  51984. }
  51985. function Y(e, t) {
  51986. var i = Xe.get(e);
  51987. if (6 === e.image.length)
  51988. if (e.version > 0 && i.__version !== e.version) {
  51989. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51990. i.__image__webglTextureCube = Ge.createTexture(),
  51991. ke.textures++),
  51992. Ye.activeTexture(Ge.TEXTURE0 + t),
  51993. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51994. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51995. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51996. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51997. var c = a[0]
  51998. , h = z(c)
  51999. , u = ee(e.format)
  52000. , d = ee(e.type);
  52001. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52002. for (var l = 0; l < 6; l++)
  52003. if (r)
  52004. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52005. p = f[g],
  52006. 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);
  52007. else
  52008. 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]);
  52009. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52010. i.__version = e.version,
  52011. e.onUpdate && e.onUpdate(e)
  52012. } else
  52013. Ye.activeTexture(Ge.TEXTURE0 + t),
  52014. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52015. }
  52016. function X(e, t) {
  52017. Ye.activeTexture(Ge.TEXTURE0 + t),
  52018. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52019. }
  52020. function Z(e, t, i, n) {
  52021. var r = ee(t.texture.format)
  52022. , o = ee(t.texture.type);
  52023. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52024. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52025. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52026. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52027. }
  52028. function q(e, t) {
  52029. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52030. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52031. 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),
  52032. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52033. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52034. }
  52035. function K(e) {
  52036. var t = Xe.get(e)
  52037. , i = e instanceof n.WebGLRenderTargetCube;
  52038. if (i) {
  52039. t.__webglDepthbuffer = [];
  52040. for (var r = 0; r < 6; r++)
  52041. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52042. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52043. q(t.__webglDepthbuffer[r], e)
  52044. } else
  52045. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52046. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52047. q(t.__webglDepthbuffer, e);
  52048. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52049. }
  52050. function Q(e) {
  52051. var t = Xe.get(e)
  52052. , i = Xe.get(e.texture);
  52053. e.addEventListener("dispose", l),
  52054. i.__webglTexture = Ge.createTexture(),
  52055. ke.textures++;
  52056. var r = e instanceof n.WebGLRenderTargetCube
  52057. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52058. if (r) {
  52059. t.__webglFramebuffer = [];
  52060. for (var a = 0; a < 6; a++)
  52061. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52062. } else
  52063. t.__webglFramebuffer = Ge.createFramebuffer();
  52064. if (r) {
  52065. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52066. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52067. for (var a = 0; a < 6; a++)
  52068. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52069. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52070. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52071. } else
  52072. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52073. k(Ge.TEXTURE_2D, e.texture, o),
  52074. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52075. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52076. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52077. e.depthBuffer && K(e)
  52078. }
  52079. function J(e) {
  52080. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52081. , i = Xe.get(e.texture).__webglTexture;
  52082. Ye.bindTexture(t, i),
  52083. Ge.generateMipmap(t),
  52084. Ye.bindTexture(t, null)
  52085. }
  52086. function $(e) {
  52087. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52088. }
  52089. function ee(e) {
  52090. var t;
  52091. if (e === n.RepeatWrapping)
  52092. return Ge.REPEAT;
  52093. if (e === n.ClampToEdgeWrapping)
  52094. return Ge.CLAMP_TO_EDGE;
  52095. if (e === n.MirroredRepeatWrapping)
  52096. return Ge.MIRRORED_REPEAT;
  52097. if (e === n.NearestFilter)
  52098. return Ge.NEAREST;
  52099. if (e === n.NearestMipMapNearestFilter)
  52100. return Ge.NEAREST_MIPMAP_NEAREST;
  52101. if (e === n.NearestMipMapLinearFilter)
  52102. return Ge.NEAREST_MIPMAP_LINEAR;
  52103. if (e === n.LinearFilter)
  52104. return Ge.LINEAR;
  52105. if (e === n.LinearMipMapNearestFilter)
  52106. return Ge.LINEAR_MIPMAP_NEAREST;
  52107. if (e === n.LinearMipMapLinearFilter)
  52108. return Ge.LINEAR_MIPMAP_LINEAR;
  52109. if (e === n.UnsignedByteType)
  52110. return Ge.UNSIGNED_BYTE;
  52111. if (e === n.UnsignedShort4444Type)
  52112. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52113. if (e === n.UnsignedShort5551Type)
  52114. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52115. if (e === n.UnsignedShort565Type)
  52116. return Ge.UNSIGNED_SHORT_5_6_5;
  52117. if (e === n.ByteType)
  52118. return Ge.BYTE;
  52119. if (e === n.ShortType)
  52120. return Ge.SHORT;
  52121. if (e === n.UnsignedShortType)
  52122. return Ge.UNSIGNED_SHORT;
  52123. if (e === n.IntType)
  52124. return Ge.INT;
  52125. if (e === n.UnsignedIntType)
  52126. return Ge.UNSIGNED_INT;
  52127. if (e === n.FloatType)
  52128. return Ge.FLOAT;
  52129. if (t = We.get("OES_texture_half_float"),
  52130. null !== t && e === n.HalfFloatType)
  52131. return t.HALF_FLOAT_OES;
  52132. if (e === n.AlphaFormat)
  52133. return Ge.ALPHA;
  52134. if (e === n.RGBFormat)
  52135. return Ge.RGB;
  52136. if (e === n.RGBAFormat)
  52137. return Ge.RGBA;
  52138. if (e === n.LuminanceFormat)
  52139. return Ge.LUMINANCE;
  52140. if (e === n.LuminanceAlphaFormat)
  52141. return Ge.LUMINANCE_ALPHA;
  52142. if (e === n.AddEquation)
  52143. return Ge.FUNC_ADD;
  52144. if (e === n.SubtractEquation)
  52145. return Ge.FUNC_SUBTRACT;
  52146. if (e === n.ReverseSubtractEquation)
  52147. return Ge.FUNC_REVERSE_SUBTRACT;
  52148. if (e === n.ZeroFactor)
  52149. return Ge.ZERO;
  52150. if (e === n.OneFactor)
  52151. return Ge.ONE;
  52152. if (e === n.SrcColorFactor)
  52153. return Ge.SRC_COLOR;
  52154. if (e === n.OneMinusSrcColorFactor)
  52155. return Ge.ONE_MINUS_SRC_COLOR;
  52156. if (e === n.SrcAlphaFactor)
  52157. return Ge.SRC_ALPHA;
  52158. if (e === n.OneMinusSrcAlphaFactor)
  52159. return Ge.ONE_MINUS_SRC_ALPHA;
  52160. if (e === n.DstAlphaFactor)
  52161. return Ge.DST_ALPHA;
  52162. if (e === n.OneMinusDstAlphaFactor)
  52163. return Ge.ONE_MINUS_DST_ALPHA;
  52164. if (e === n.DstColorFactor)
  52165. return Ge.DST_COLOR;
  52166. if (e === n.OneMinusDstColorFactor)
  52167. return Ge.ONE_MINUS_DST_COLOR;
  52168. if (e === n.SrcAlphaSaturateFactor)
  52169. return Ge.SRC_ALPHA_SATURATE;
  52170. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52171. null !== t) {
  52172. if (e === n.RGB_S3TC_DXT1_Format)
  52173. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52174. if (e === n.RGBA_S3TC_DXT1_Format)
  52175. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52176. if (e === n.RGBA_S3TC_DXT3_Format)
  52177. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52178. if (e === n.RGBA_S3TC_DXT5_Format)
  52179. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52180. }
  52181. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52182. null !== t) {
  52183. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52184. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52185. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52186. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52187. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52188. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52189. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52190. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52191. }
  52192. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52193. null !== t && e === n.RGB_ETC1_Format)
  52194. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52195. if (t = We.get("EXT_blend_minmax"),
  52196. null !== t) {
  52197. if (e === n.MinEquation)
  52198. return t.MIN_EXT;
  52199. if (e === n.MaxEquation)
  52200. return t.MAX_EXT
  52201. }
  52202. return 0
  52203. }
  52204. console.log("THREE.WebGLRenderer", n.REVISION),
  52205. e = e || {};
  52206. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52207. , ie = void 0 !== e.context ? e.context : null
  52208. , ne = void 0 !== e.alpha && e.alpha
  52209. , re = void 0 === e.depth || e.depth
  52210. , oe = void 0 === e.stencil || e.stencil
  52211. , ae = void 0 !== e.antialias && e.antialias
  52212. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52213. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52214. , ce = []
  52215. , he = []
  52216. , ue = -1
  52217. , de = []
  52218. , pe = -1
  52219. , fe = new Float32Array(8)
  52220. , ge = []
  52221. , me = [];
  52222. this.domElement = te,
  52223. this.context = null,
  52224. this.autoClear = !0,
  52225. this.autoClearColor = !0,
  52226. this.autoClearDepth = !0,
  52227. this.autoClearStencil = !0,
  52228. this.sortObjects = !0,
  52229. this.gammaFactor = 2,
  52230. this.gammaInput = !1,
  52231. this.gammaOutput = !1,
  52232. this.physicallyCorrectLights = !1,
  52233. this.toneMapping = n.LinearToneMapping,
  52234. this.toneMappingExposure = 1,
  52235. this.toneMappingWhitePoint = 1,
  52236. this.maxMorphTargets = 8,
  52237. this.maxMorphNormals = 4,
  52238. this.autoScaleCubemaps = !0;
  52239. var ve = this
  52240. , Ae = null
  52241. , ye = null
  52242. , Ce = null
  52243. , Ie = -1
  52244. , Ee = ""
  52245. , be = null
  52246. , we = new n.Vector4
  52247. , _e = null
  52248. , Te = new n.Vector4
  52249. , xe = 0
  52250. , Se = new n.Color(0)
  52251. , Me = 0
  52252. , Re = te.width
  52253. , Pe = te.height
  52254. , Oe = 1
  52255. , Le = new n.Vector4(0,0,Re,Pe)
  52256. , De = !1
  52257. , Ne = new n.Vector4(0,0,Re,Pe)
  52258. , Be = new n.Frustum
  52259. , Fe = new n.Matrix4
  52260. , Ve = new n.Vector3
  52261. , Ue = {
  52262. hash: "",
  52263. ambient: [0, 0, 0],
  52264. directional: [],
  52265. directionalShadowMap: [],
  52266. directionalShadowMatrix: [],
  52267. spot: [],
  52268. spotShadowMap: [],
  52269. spotShadowMatrix: [],
  52270. point: [],
  52271. pointShadowMap: [],
  52272. pointShadowMatrix: [],
  52273. hemi: [],
  52274. shadows: [],
  52275. shadowsPointLight: 0
  52276. }
  52277. , ke = {
  52278. geometries: 0,
  52279. textures: 0
  52280. }
  52281. , He = {
  52282. calls: 0,
  52283. vertices: 0,
  52284. faces: 0,
  52285. points: 0
  52286. };
  52287. this.info = {
  52288. render: He,
  52289. memory: ke,
  52290. programs: null
  52291. };
  52292. var Ge;
  52293. try {
  52294. var ze = {
  52295. alpha: ne,
  52296. depth: re,
  52297. stencil: oe,
  52298. antialias: ae,
  52299. premultipliedAlpha: se,
  52300. preserveDrawingBuffer: le
  52301. };
  52302. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52303. null === Ge)
  52304. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52305. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52306. return {
  52307. rangeMin: 1,
  52308. rangeMax: 1,
  52309. precision: 1
  52310. }
  52311. }
  52312. ),
  52313. te.addEventListener("webglcontextlost", a, !1)
  52314. } catch (e) {
  52315. console.error("THREE.WebGLRenderer: " + e)
  52316. }
  52317. var We = new n.WebGLExtensions(Ge);
  52318. We.get("OES_texture_float"),
  52319. We.get("OES_texture_float_linear"),
  52320. We.get("OES_texture_half_float"),
  52321. We.get("OES_texture_half_float_linear"),
  52322. We.get("OES_standard_derivatives"),
  52323. We.get("ANGLE_instanced_arrays"),
  52324. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52325. var je = new n.WebGLCapabilities(Ge,We,e)
  52326. , Ye = new n.WebGLState(Ge,We,ee)
  52327. , Xe = new n.WebGLProperties
  52328. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52329. , qe = new n.WebGLPrograms(this,je)
  52330. , Ke = new n.WebGLLights;
  52331. this.info.programs = qe.programs;
  52332. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52333. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52334. r(),
  52335. this.context = Ge,
  52336. this.capabilities = je,
  52337. this.extensions = We,
  52338. this.properties = Xe,
  52339. this.state = Ye;
  52340. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52341. this.shadowMap = $e;
  52342. var et = new n.SpritePlugin(this,ge)
  52343. , tt = new n.LensFlarePlugin(this,me);
  52344. this.getContext = function() {
  52345. return Ge
  52346. }
  52347. ,
  52348. this.getContextAttributes = function() {
  52349. return Ge.getContextAttributes()
  52350. }
  52351. ,
  52352. this.forceContextLoss = function() {
  52353. We.get("WEBGL_lose_context").loseContext()
  52354. }
  52355. ,
  52356. this.getMaxAnisotropy = function() {
  52357. var e;
  52358. return function() {
  52359. if (void 0 !== e)
  52360. return e;
  52361. var t = We.get("EXT_texture_filter_anisotropic");
  52362. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52363. }
  52364. }(),
  52365. this.getPrecision = function() {
  52366. return je.precision
  52367. }
  52368. ,
  52369. this.getPixelRatio = function() {
  52370. return Oe
  52371. }
  52372. ,
  52373. this.setPixelRatio = function(e) {
  52374. void 0 !== e && (Oe = e,
  52375. this.setSize(Ne.z, Ne.w, !1))
  52376. }
  52377. ,
  52378. this.getSize = function() {
  52379. return {
  52380. width: Re,
  52381. height: Pe
  52382. }
  52383. }
  52384. ,
  52385. this.setSize = function(e, t, i, devicePixelRatio) {
  52386. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52387. Re = e,
  52388. Pe = t,
  52389. te.width = e * Oe,
  52390. te.height = t * Oe,
  52391. i !== !1 && (te.style.width = e + "px",
  52392. te.style.height = t + "px"),
  52393. this.setViewport(0, 0, e, t)
  52394. }
  52395. ,
  52396. this.setViewport = function(e, t, i, n) {
  52397. Ye.viewport(Ne.set(e, t, i, n))
  52398. }
  52399. ,
  52400. this.setScissor = function(e, t, i, n) {
  52401. Ye.scissor(Le.set(e, t, i, n))
  52402. }
  52403. ,
  52404. this.setScissorTest = function(e) {
  52405. Ye.setScissorTest(De = e)
  52406. }
  52407. ,
  52408. this.getClearColor = function() {
  52409. return Se
  52410. }
  52411. ,
  52412. this.setClearColor = function(e, t) {
  52413. Se.set(e),
  52414. Me = void 0 !== t ? t : 1,
  52415. i(Se.r, Se.g, Se.b, Me)
  52416. }
  52417. ,
  52418. this.getClearAlpha = function() {
  52419. return Me
  52420. }
  52421. ,
  52422. this.setClearAlpha = function(e) {
  52423. Me = e,
  52424. i(Se.r, Se.g, Se.b, Me)
  52425. }
  52426. ,
  52427. this.clear = function(e, t, i) {
  52428. var n = 0;
  52429. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52430. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52431. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52432. Ge.clear(n)
  52433. }
  52434. ,
  52435. this.clearColor = function() {
  52436. this.clear(!0, !1, !1)
  52437. }
  52438. ,
  52439. this.clearDepth = function() {
  52440. this.clear(!1, !0, !1)
  52441. }
  52442. ,
  52443. this.clearStencil = function() {
  52444. this.clear(!1, !1, !0)
  52445. }
  52446. ,
  52447. this.clearTarget = function(e, t, i, n) {
  52448. this.setRenderTarget(e),
  52449. this.clear(t, i, n)
  52450. }
  52451. ,
  52452. this.resetGLState = o,
  52453. this.dispose = function() {
  52454. te.removeEventListener("webglcontextlost", a, !1)
  52455. }
  52456. ,
  52457. this.renderBufferImmediate = function(e, t, i) {
  52458. Ye.initAttributes();
  52459. var r = Xe.get(e);
  52460. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52461. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52462. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52463. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52464. var o = t.getAttributes();
  52465. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52466. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52467. Ye.enableAttribute(o.position),
  52468. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52469. e.hasNormals) {
  52470. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52471. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52472. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52473. var l = e.normalArray
  52474. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52475. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52476. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52477. l[a + 0] = c,
  52478. l[a + 1] = h,
  52479. l[a + 2] = u,
  52480. l[a + 3] = c,
  52481. l[a + 4] = h,
  52482. l[a + 5] = u,
  52483. l[a + 6] = c,
  52484. l[a + 7] = h,
  52485. l[a + 8] = u
  52486. }
  52487. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52488. Ye.enableAttribute(o.normal),
  52489. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52490. }
  52491. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52492. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52493. Ye.enableAttribute(o.uv),
  52494. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52495. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52496. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52497. Ye.enableAttribute(o.color),
  52498. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52499. Ye.disableUnusedAttributes(),
  52500. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52501. e.count = 0
  52502. }
  52503. ,
  52504. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52505. E(o);
  52506. var l = w(e, i, o, a)
  52507. , c = !1
  52508. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52509. h !== Ee && (Ee = h,
  52510. c = !0);
  52511. var u = a.morphTargetInfluences;
  52512. if (void 0 !== u) {
  52513. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52514. var v = u[p];
  52515. d.push([v, p])
  52516. }
  52517. d.sort(g),
  52518. d.length > 8 && (d.length = 8);
  52519. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52520. var v = d[p];
  52521. if (fe[p] = v[0],
  52522. 0 !== v[0]) {
  52523. var y = v[1];
  52524. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52525. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52526. } else
  52527. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52528. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52529. }
  52530. var C = l.getUniforms();
  52531. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52532. c = !0
  52533. }
  52534. var y = r.index
  52535. , I = r.attributes.position;
  52536. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52537. var b;
  52538. null !== y ? (b = Je,
  52539. b.setIndex(y)) : b = Qe,
  52540. c && (f(o, l, r),
  52541. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52542. var _ = 0
  52543. , T = 1 / 0;
  52544. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52545. var x = r.drawRange.start
  52546. , S = r.drawRange.count
  52547. , M = null !== s ? s.start : 0
  52548. , R = null !== s ? s.count : 1 / 0
  52549. , P = Math.max(_, x, M)
  52550. , O = Math.min(_ + T, x + S, M + R) - 1
  52551. , L = Math.max(0, O - P + 1);
  52552. if (a instanceof n.Mesh)
  52553. if (o.wireframe === !0)
  52554. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52555. b.setMode(Ge.LINES);
  52556. else
  52557. switch (a.drawMode) {
  52558. case n.TrianglesDrawMode:
  52559. b.setMode(Ge.TRIANGLES);
  52560. break;
  52561. case n.TriangleStripDrawMode:
  52562. b.setMode(Ge.TRIANGLE_STRIP);
  52563. break;
  52564. case n.TriangleFanDrawMode:
  52565. b.setMode(Ge.TRIANGLE_FAN)
  52566. }
  52567. else if (a instanceof n.Line) {
  52568. var D = o.linewidth;
  52569. void 0 === D && (D = 1),
  52570. Ye.setLineWidth(D * t()),
  52571. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52572. } else
  52573. a instanceof n.Points && b.setMode(Ge.POINTS);
  52574. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52575. }
  52576. ,
  52577. this.render = function(e, t, i, r) {
  52578. if (t instanceof n.Camera == !1)
  52579. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52580. var o = e.fog;
  52581. if (Ee = "",
  52582. Ie = -1,
  52583. be = null,
  52584. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52585. null === t.parent && t.updateMatrixWorld(),
  52586. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52587. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52588. Be.setFromMatrix(Fe),
  52589. ce.length = 0,
  52590. ue = -1,
  52591. pe = -1,
  52592. ge.length = 0,
  52593. me.length = 0,
  52594. y(e, t),
  52595. he.length = ue + 1,
  52596. de.length = pe + 1,
  52597. ve.sortObjects === !0 && (he.sort(m),
  52598. de.sort(v)),
  52599. U(ce, t),
  52600. $e.render(e, t),
  52601. He.calls = 0,
  52602. He.vertices = 0,
  52603. He.faces = 0,
  52604. He.points = 0,
  52605. void 0 === i && (i = null),
  52606. this.setRenderTarget(i),
  52607. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52608. e.overrideMaterial) {
  52609. var a = e.overrideMaterial;
  52610. C(he, t, o, a),
  52611. C(de, t, o, a)
  52612. } else
  52613. Ye.setBlending(n.NoBlending),
  52614. C(he, t, o),
  52615. C(de, t, o);
  52616. if (et.render(e, t),
  52617. tt.render(e, t, Te),
  52618. i) {
  52619. var s = i.texture;
  52620. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52621. }
  52622. Ye.setDepthTest(!0),
  52623. Ye.setDepthWrite(!0),
  52624. Ye.setColorWrite(!0)
  52625. }
  52626. ,
  52627. this.setFaceCulling = function(e, t) {
  52628. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52629. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52630. Ye.enable(Ge.CULL_FACE))
  52631. }
  52632. ,
  52633. this.setTexture = function(e, t) {
  52634. var i = Xe.get(e);
  52635. if (e.version > 0 && i.__version !== e.version) {
  52636. var n = e.image;
  52637. 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)
  52638. }
  52639. Ye.activeTexture(Ge.TEXTURE0 + t),
  52640. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52641. }
  52642. ,
  52643. this.getCurrentRenderTarget = function() {
  52644. return ye
  52645. }
  52646. ,
  52647. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52648. const renderTargetProperties = Xe.get( renderTarget );
  52649. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52650. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52651. },
  52652. this.setFramebuffer = function ( value ) {//add
  52653. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52654. Ce = value;
  52655. },
  52656. this.setRenderTarget = function(e) {
  52657. ye = e,
  52658. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52659. var t, i = e instanceof n.WebGLRenderTargetCube;
  52660. if (e) {
  52661. var r = Xe.get(e);
  52662. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52663. we.copy(e.scissor),
  52664. _e = e.scissorTest,
  52665. Te.copy(e.viewport)
  52666. } else
  52667. t = null,
  52668. we.copy(Le).multiplyScalar(Oe),
  52669. _e = De,
  52670. Te.copy(Ne).multiplyScalar(Oe);
  52671. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52672. Ce = t),
  52673. Ye.scissor(we),
  52674. Ye.setScissorTest(_e),
  52675. Ye.viewport(Te),
  52676. i) {
  52677. var o = Xe.get(e.texture);
  52678. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52679. }
  52680. }
  52681. ,
  52682. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52683. if (e instanceof n.WebGLRenderTarget == !1)
  52684. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52685. var s = Xe.get(e).__webglFramebuffer;
  52686. if (s) {
  52687. var l = !1;
  52688. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52689. l = !0);
  52690. try {
  52691. var c = e.texture;
  52692. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52693. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52694. 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")))
  52695. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52696. 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.")
  52697. } finally {
  52698. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52699. }
  52700. }
  52701. }
  52702. }
  52703. ,
  52704. n.WebGLRenderTarget = function(e, t, i) {
  52705. this.uuid = n.Math.generateUUID(),
  52706. this.width = e,
  52707. this.height = t,
  52708. this.scissor = new n.Vector4(0,0,e,t),
  52709. this.scissorTest = !1,
  52710. this.viewport = new n.Vector4(0,0,e,t),
  52711. i = i || {},
  52712. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52713. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52714. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52715. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52716. }
  52717. ,
  52718. n.WebGLRenderTarget.prototype = {
  52719. constructor: n.WebGLRenderTarget,
  52720. setSize: function(e, t) {
  52721. this.width === e && this.height === t || (this.width = e,
  52722. this.height = t,
  52723. this.dispose()),
  52724. this.viewport.set(0, 0, e, t),
  52725. this.scissor.set(0, 0, e, t)
  52726. },
  52727. clone: function() {
  52728. return (new this.constructor).copy(this)
  52729. },
  52730. copy: function(e) {
  52731. return this.width = e.width,
  52732. this.height = e.height,
  52733. this.viewport.copy(e.viewport),
  52734. this.texture = e.texture.clone(),
  52735. this.depthBuffer = e.depthBuffer,
  52736. this.stencilBuffer = e.stencilBuffer,
  52737. this
  52738. },
  52739. dispose: function() {
  52740. this.dispatchEvent({
  52741. type: "dispose"
  52742. })
  52743. }
  52744. },
  52745. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52746. n.WebGLRenderTargetCube = function(e, t, i) {
  52747. n.WebGLRenderTarget.call(this, e, t, i),
  52748. this.activeCubeFace = 0,
  52749. this.activeMipMapLevel = 0
  52750. }
  52751. ,
  52752. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52753. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52754. n.WebGLBufferRenderer = function(e, t, i) {
  52755. function r(e) {
  52756. s = e
  52757. }
  52758. function o(t, n) {
  52759. e.drawArrays(s, t, n),
  52760. i.calls++,
  52761. i.vertices += n,
  52762. s === e.TRIANGLES && (i.faces += n / 3)
  52763. }
  52764. function a(r) {
  52765. var o = t.get("ANGLE_instanced_arrays");
  52766. if (null === o)
  52767. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52768. var a = r.attributes.position
  52769. , l = 0;
  52770. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52771. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52772. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52773. i.calls++,
  52774. i.vertices += l * r.maxInstancedCount,
  52775. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52776. }
  52777. var s;
  52778. this.setMode = r,
  52779. this.render = o,
  52780. this.renderInstances = a
  52781. }
  52782. ,
  52783. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52784. function n(e) {
  52785. s = e
  52786. }
  52787. function r(i) {
  52788. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52789. c = 4) : (l = e.UNSIGNED_SHORT,
  52790. c = 2)
  52791. }
  52792. function o(t, n) {
  52793. e.drawElements(s, n, l, t * c),
  52794. i.calls++,
  52795. i.vertices += n,
  52796. s === e.TRIANGLES && (i.faces += n / 3)
  52797. }
  52798. function a(n, r, o) {
  52799. var a = t.get("ANGLE_instanced_arrays");
  52800. 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),
  52801. i.calls++,
  52802. i.vertices += o * n.maxInstancedCount,
  52803. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52804. }
  52805. var s, l, c;
  52806. this.setMode = n,
  52807. this.setIndex = r,
  52808. this.render = o,
  52809. this.renderInstances = a
  52810. }
  52811. ,
  52812. n.WebGLExtensions = function(e) {
  52813. var t = {};
  52814. this.get = function(i) {
  52815. if (void 0 !== t[i])
  52816. return t[i];
  52817. var n;
  52818. switch (i) {
  52819. case "EXT_texture_filter_anisotropic":
  52820. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52821. break;
  52822. case "WEBGL_compressed_texture_s3tc":
  52823. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52824. break;
  52825. case "WEBGL_compressed_texture_pvrtc":
  52826. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52827. break;
  52828. case "WEBGL_compressed_texture_etc1":
  52829. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52830. break;
  52831. default:
  52832. n = e.getExtension(i)
  52833. }
  52834. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52835. t[i] = n,
  52836. n
  52837. }
  52838. }
  52839. ,
  52840. n.WebGLCapabilities = function(e, t, i) {
  52841. function n(t) {
  52842. if ("highp" === t) {
  52843. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52844. return "highp";
  52845. t = "mediump"
  52846. }
  52847. 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"
  52848. }
  52849. this.getMaxPrecision = n,
  52850. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52851. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52852. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52853. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52854. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52855. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52856. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52857. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52858. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52859. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52860. this.vertexTextures = this.maxVertexTextures > 0,
  52861. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52862. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52863. var r = n(this.precision);
  52864. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52865. this.precision = r),
  52866. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52867. }
  52868. ,
  52869. n.WebGLGeometries = function(e, t, i) {
  52870. function r(e) {
  52871. var t = e.geometry;
  52872. if (void 0 !== h[t.id])
  52873. return h[t.id];
  52874. t.addEventListener("dispose", o);
  52875. var r;
  52876. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52877. r = t._bufferGeometry),
  52878. h[t.id] = r,
  52879. i.memory.geometries++,
  52880. r
  52881. }
  52882. function o(e) {
  52883. var n = e.target
  52884. , r = h[n.id];
  52885. null !== r.index && s(r.index),
  52886. l(r.attributes),
  52887. n.removeEventListener("dispose", o),
  52888. delete h[n.id];
  52889. var a = t.get(n);
  52890. a.wireframe && s(a.wireframe),
  52891. t.delete(n);
  52892. var c = t.get(r);
  52893. c.wireframe && s(c.wireframe),
  52894. t.delete(r),
  52895. i.memory.geometries--
  52896. }
  52897. function a(e) {
  52898. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52899. }
  52900. function s(t) {
  52901. var i = a(t);
  52902. void 0 !== i && (e.deleteBuffer(i),
  52903. c(t))
  52904. }
  52905. function l(e) {
  52906. for (var t in e)
  52907. s(e[t])
  52908. }
  52909. function c(e) {
  52910. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52911. }
  52912. var h = {};
  52913. this.get = r
  52914. }
  52915. ,
  52916. n.WebGLLights = function() {
  52917. var e = {};
  52918. this.get = function(t) {
  52919. if (void 0 !== e[t.id])
  52920. return e[t.id];
  52921. var i;
  52922. switch (t.type) {
  52923. case "DirectionalLight":
  52924. i = {
  52925. direction: new n.Vector3,
  52926. color: new n.Color,
  52927. shadow: !1,
  52928. shadowBias: 0,
  52929. shadowRadius: 1,
  52930. shadowMapSize: new n.Vector2
  52931. };
  52932. break;
  52933. case "SpotLight":
  52934. i = {
  52935. position: new n.Vector3,
  52936. direction: new n.Vector3,
  52937. color: new n.Color,
  52938. distance: 0,
  52939. coneCos: 0,
  52940. penumbraCos: 0,
  52941. decay: 0,
  52942. shadow: !1,
  52943. shadowBias: 0,
  52944. shadowRadius: 1,
  52945. shadowMapSize: new n.Vector2
  52946. };
  52947. break;
  52948. case "PointLight":
  52949. i = {
  52950. position: new n.Vector3,
  52951. color: new n.Color,
  52952. distance: 0,
  52953. decay: 0,
  52954. shadow: !1,
  52955. shadowBias: 0,
  52956. shadowRadius: 1,
  52957. shadowMapSize: new n.Vector2
  52958. };
  52959. break;
  52960. case "HemisphereLight":
  52961. i = {
  52962. direction: new n.Vector3,
  52963. skyColor: new n.Color,
  52964. groundColor: new n.Color
  52965. }
  52966. }
  52967. return e[t.id] = i,
  52968. i
  52969. }
  52970. }
  52971. ,
  52972. n.WebGLObjects = function(e, t, i) {
  52973. function r(t) {
  52974. var i = u.get(t);
  52975. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52976. var r = i.index
  52977. , a = i.attributes;
  52978. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52979. for (var s in a)
  52980. o(a[s], e.ARRAY_BUFFER);
  52981. var l = i.morphAttributes;
  52982. for (var s in l)
  52983. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52984. o(c[h], e.ARRAY_BUFFER);
  52985. return i
  52986. }
  52987. function o(e, i) {
  52988. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52989. , o = t.get(r);
  52990. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52991. }
  52992. function a(t, i, n) {
  52993. t.__webglBuffer = e.createBuffer(),
  52994. e.bindBuffer(n, t.__webglBuffer);
  52995. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52996. e.bufferData(n, i.array, r),
  52997. t.version = i.version
  52998. }
  52999. function s(t, i, n) {
  53000. e.bindBuffer(n, t.__webglBuffer),
  53001. 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)),
  53002. i.updateRange.count = 0),
  53003. t.version = i.version
  53004. }
  53005. function l(e) {
  53006. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53007. }
  53008. function c(i) {
  53009. var r = t.get(i);
  53010. if (void 0 !== r.wireframe)
  53011. return r.wireframe;
  53012. var a = []
  53013. , s = i.index
  53014. , l = i.attributes
  53015. , c = l.position;
  53016. if (null !== s)
  53017. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53018. var g = d[p + 0]
  53019. , m = d[p + 1]
  53020. , v = d[p + 2];
  53021. h(u, g, m) && a.push(g, m),
  53022. h(u, m, v) && a.push(m, v),
  53023. h(u, v, g) && a.push(v, g)
  53024. }
  53025. else
  53026. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53027. var g = p + 0
  53028. , m = p + 1
  53029. , v = p + 2;
  53030. a.push(g, m, m, v, v, g)
  53031. }
  53032. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53033. , y = new n.BufferAttribute(new A(a),1);
  53034. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53035. r.wireframe = y,
  53036. y
  53037. }
  53038. function h(e, t, i) {
  53039. if (t > i) {
  53040. var n = t;
  53041. t = i,
  53042. i = n
  53043. }
  53044. var r = e[t];
  53045. return void 0 === r ? (e[t] = [i],
  53046. !0) : r.indexOf(i) === -1 && (r.push(i),
  53047. !0)
  53048. }
  53049. var u = new n.WebGLGeometries(e,t,i);
  53050. this.getAttributeBuffer = l,
  53051. this.getWireframeAttribute = c,
  53052. this.update = r
  53053. }
  53054. ,
  53055. n.WebGLProgram = function() {
  53056. function e(e) {
  53057. switch (e) {
  53058. case n.LinearEncoding:
  53059. return ["Linear", "( value )"];
  53060. case n.sRGBEncoding:
  53061. return ["sRGB", "( value )"];
  53062. case n.RGBEEncoding:
  53063. return ["RGBE", "( value )"];
  53064. case n.RGBM7Encoding:
  53065. return ["RGBM", "( value, 7.0 )"];
  53066. case n.RGBM16Encoding:
  53067. return ["RGBM", "( value, 16.0 )"];
  53068. case n.RGBDEncoding:
  53069. return ["RGBD", "( value, 256.0 )"];
  53070. case n.GammaEncoding:
  53071. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53072. default:
  53073. throw new Error("unsupported encoding: " + e)
  53074. }
  53075. }
  53076. function t(t, i) {
  53077. var n = e(i);
  53078. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53079. }
  53080. function i(t, i) {
  53081. var n = e(i);
  53082. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53083. }
  53084. function r(e, t) {
  53085. var i;
  53086. switch (t) {
  53087. case n.LinearToneMapping:
  53088. i = "Linear";
  53089. break;
  53090. case n.ReinhardToneMapping:
  53091. i = "Reinhard";
  53092. break;
  53093. case n.Uncharted2ToneMapping:
  53094. i = "Uncharted2";
  53095. break;
  53096. case n.CineonToneMapping:
  53097. i = "OptimizedCineon";
  53098. break;
  53099. default:
  53100. throw new Error("unsupported toneMapping: " + t)
  53101. }
  53102. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53103. }
  53104. function o(e, t, i) {
  53105. e = e || {};
  53106. 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" : ""];
  53107. return n.filter(c).join("\n")
  53108. }
  53109. function a(e) {
  53110. var t = [];
  53111. for (var i in e) {
  53112. var n = e[i];
  53113. n !== !1 && t.push("#define " + i + " " + n)
  53114. }
  53115. return t.join("\n")
  53116. }
  53117. function s(e, t, i) {
  53118. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53119. var a = e.getActiveUniform(t, o)
  53120. , s = a.name
  53121. , l = e.getUniformLocation(t, s)
  53122. , c = f.exec(s);
  53123. if (c) {
  53124. var h = c[1]
  53125. , u = c[2]
  53126. , d = n[h];
  53127. d || (d = n[h] = {}),
  53128. d[u] = l
  53129. } else if (c = g.exec(s)) {
  53130. var p = c[1]
  53131. , v = c[2]
  53132. , A = c[3]
  53133. , y = n[p];
  53134. y || (y = n[p] = []);
  53135. var C = y[v];
  53136. C || (C = y[v] = {}),
  53137. C[A] = l
  53138. } else if (c = m.exec(s)) {
  53139. var p = c[1];
  53140. n[p] = l
  53141. } else
  53142. n[s] = l
  53143. }
  53144. return n
  53145. }
  53146. function l(e, t, i) {
  53147. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53148. var a = e.getActiveAttrib(t, o)
  53149. , s = a.name;
  53150. n[s] = e.getAttribLocation(t, s)
  53151. }
  53152. return n
  53153. }
  53154. function c(e) {
  53155. return "" !== e
  53156. }
  53157. function h(e, t) {
  53158. 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)
  53159. }
  53160. function u(e) {
  53161. function t(e, t) {
  53162. var i = n.ShaderChunk[t];
  53163. if (void 0 === i)
  53164. throw new Error("Can not resolve #include <" + t + ">");
  53165. return u(i)
  53166. }
  53167. var i = /#include +<([\w\d.]+)>/g;
  53168. return e.replace(i, t)
  53169. }
  53170. function d(e) {
  53171. function t(e, t, i, n) {
  53172. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53173. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53174. return r
  53175. }
  53176. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53177. return e.replace(i, t)
  53178. }
  53179. var p = 0
  53180. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53181. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53182. , m = /^([\w\d_]+)\[0\]$/;
  53183. return function(e, f, g, m) {
  53184. var v = e.context
  53185. , A = g.extensions
  53186. , y = g.defines
  53187. , C = g.__webglShader.vertexShader
  53188. , I = g.__webglShader.fragmentShader
  53189. , E = "SHADOWMAP_TYPE_BASIC";
  53190. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53191. var b = "ENVMAP_TYPE_CUBE"
  53192. , w = "ENVMAP_MODE_REFLECTION"
  53193. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53194. if (m.envMap) {
  53195. switch (g.envMap.mapping) {
  53196. case n.CubeReflectionMapping:
  53197. case n.CubeRefractionMapping:
  53198. b = "ENVMAP_TYPE_CUBE";
  53199. break;
  53200. case n.CubeUVReflectionMapping:
  53201. case n.CubeUVRefractionMapping:
  53202. b = "ENVMAP_TYPE_CUBE_UV";
  53203. break;
  53204. case n.EquirectangularReflectionMapping:
  53205. case n.EquirectangularRefractionMapping:
  53206. b = "ENVMAP_TYPE_EQUIREC";
  53207. break;
  53208. case n.SphericalReflectionMapping:
  53209. b = "ENVMAP_TYPE_SPHERE"
  53210. }
  53211. switch (g.envMap.mapping) {
  53212. case n.CubeRefractionMapping:
  53213. case n.EquirectangularRefractionMapping:
  53214. w = "ENVMAP_MODE_REFRACTION"
  53215. }
  53216. switch (g.combine) {
  53217. case n.MultiplyOperation:
  53218. _ = "ENVMAP_BLENDING_MULTIPLY";
  53219. break;
  53220. case n.MixOperation:
  53221. _ = "ENVMAP_BLENDING_MIX";
  53222. break;
  53223. case n.AddOperation:
  53224. _ = "ENVMAP_BLENDING_ADD"
  53225. }
  53226. }
  53227. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53228. g instanceof n.RawShaderMaterial ? (T = "",
  53229. 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"),
  53230. 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")),
  53231. C = u(C, m),
  53232. C = h(C, m),
  53233. I = u(I, m),
  53234. I = h(I, m),
  53235. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53236. I = d(I));
  53237. var O = T + C
  53238. , L = x + I
  53239. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53240. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53241. v.attachShader(P, D),
  53242. v.attachShader(P, N),
  53243. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53244. v.linkProgram(P);
  53245. var B = v.getProgramInfoLog(P)
  53246. , F = v.getShaderInfoLog(D)
  53247. , V = v.getShaderInfoLog(N)
  53248. , U = !0
  53249. , k = !0;
  53250. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53251. 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),
  53252. k && (this.diagnostics = {
  53253. runnable: U,
  53254. material: g,
  53255. programLog: B,
  53256. vertexShader: {
  53257. log: F,
  53258. prefix: T
  53259. },
  53260. fragmentShader: {
  53261. log: V,
  53262. prefix: x
  53263. }
  53264. }),
  53265. v.deleteShader(D),
  53266. v.deleteShader(N);
  53267. var H;
  53268. this.getUniforms = function() {
  53269. return void 0 === H && (H = s(v, P)),
  53270. H
  53271. }
  53272. ;
  53273. var G;
  53274. return this.getAttributes = function() {
  53275. return void 0 === G && (G = l(v, P)),
  53276. G
  53277. }
  53278. ,
  53279. this.destroy = function() {
  53280. v.deleteProgram(P),
  53281. this.program = void 0
  53282. }
  53283. ,
  53284. Object.defineProperties(this, {
  53285. uniforms: {
  53286. get: function() {
  53287. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53288. this.getUniforms()
  53289. }
  53290. },
  53291. attributes: {
  53292. get: function() {
  53293. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53294. this.getAttributes()
  53295. }
  53296. }
  53297. }),
  53298. this.id = p++,
  53299. this.code = f,
  53300. this.usedTimes = 1,
  53301. this.program = P,
  53302. this.vertexShader = D,
  53303. this.fragmentShader = N,
  53304. this
  53305. }
  53306. }(),
  53307. n.WebGLPrograms = function(e, t) {
  53308. function i(e) {
  53309. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53310. return 1024;
  53311. var i = t.maxVertexUniforms
  53312. , r = Math.floor((i - 20) / 4)
  53313. , o = r;
  53314. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53315. 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)")),
  53316. o
  53317. }
  53318. function r(e, t) {
  53319. var i;
  53320. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53321. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53322. i
  53323. }
  53324. var o = []
  53325. , a = {
  53326. MeshDepthMaterial: "depth",
  53327. MeshNormalMaterial: "normal",
  53328. MeshBasicMaterial: "basic",
  53329. MeshLambertMaterial: "lambert",
  53330. MeshPhongMaterial: "phong",
  53331. MeshStandardMaterial: "standard",
  53332. LineBasicMaterial: "basic",
  53333. LineDashedMaterial: "dashed",
  53334. PointsMaterial: "points"
  53335. }
  53336. , 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"];
  53337. this.getParameters = function(o, s, l, c) {
  53338. var h = a[o.type]
  53339. , u = i(c)
  53340. , d = e.getPrecision();
  53341. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53342. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53343. var p = {
  53344. shaderID: h,
  53345. precision: d,
  53346. supportsVertexTextures: t.vertexTextures,
  53347. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53348. map: !!o.map,
  53349. mapEncoding: r(o.map, e.gammaInput),
  53350. envMap: !!o.envMap,
  53351. envMapMode: o.envMap && o.envMap.mapping,
  53352. envMapEncoding: r(o.envMap, e.gammaInput),
  53353. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53354. lightMap: !!o.lightMap,
  53355. aoMap: !!o.aoMap,
  53356. emissiveMap: !!o.emissiveMap,
  53357. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53358. bumpMap: !!o.bumpMap,
  53359. normalMap: !!o.normalMap,
  53360. displacementMap: !!o.displacementMap,
  53361. roughnessMap: !!o.roughnessMap,
  53362. metalnessMap: !!o.metalnessMap,
  53363. specularMap: !!o.specularMap,
  53364. alphaMap: !!o.alphaMap,
  53365. combine: o.combine,
  53366. vertexColors: o.vertexColors,
  53367. fog: l,
  53368. useFog: o.fog,
  53369. fogExp: l instanceof n.FogExp2,
  53370. flatShading: o.shading === n.FlatShading,
  53371. sizeAttenuation: o.sizeAttenuation,
  53372. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53373. skinning: o.skinning,
  53374. maxBones: u,
  53375. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53376. morphTargets: o.morphTargets,
  53377. morphNormals: o.morphNormals,
  53378. maxMorphTargets: e.maxMorphTargets,
  53379. maxMorphNormals: e.maxMorphNormals,
  53380. numDirLights: s.directional.length,
  53381. numPointLights: s.point.length,
  53382. numSpotLights: s.spot.length,
  53383. numHemiLights: s.hemi.length,
  53384. pointLightShadows: s.shadowsPointLight,
  53385. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53386. shadowMapType: e.shadowMap.type,
  53387. toneMapping: e.toneMapping,
  53388. physicallyCorrectLights: e.physicallyCorrectLights,
  53389. premultipliedAlpha: o.premultipliedAlpha,
  53390. alphaTest: o.alphaTest,
  53391. doubleSided: o.side === n.DoubleSide,
  53392. flipSided: o.side === n.BackSide
  53393. };
  53394. return p
  53395. }
  53396. ,
  53397. this.getProgramCode = function(e, t) {
  53398. var i = [];
  53399. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53400. i.push(e.vertexShader)),
  53401. void 0 !== e.defines)
  53402. for (var n in e.defines)
  53403. i.push(n),
  53404. i.push(e.defines[n]);
  53405. for (var r = 0; r < s.length; r++) {
  53406. var o = s[r];
  53407. i.push(o),
  53408. i.push(t[o])
  53409. }
  53410. return i.join()
  53411. }
  53412. ,
  53413. this.acquireProgram = function(t, i, r) {
  53414. for (var a, s = 0, l = o.length; s < l; s++) {
  53415. var c = o[s];
  53416. if (c.code === r) {
  53417. a = c,
  53418. ++a.usedTimes;
  53419. break
  53420. }
  53421. }
  53422. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53423. o.push(a)),
  53424. a
  53425. }
  53426. ,
  53427. this.releaseProgram = function(e) {
  53428. if (0 === --e.usedTimes) {
  53429. var t = o.indexOf(e);
  53430. o[t] = o[o.length - 1],
  53431. o.pop(),
  53432. e.destroy()
  53433. }
  53434. }
  53435. ,
  53436. this.programs = o
  53437. }
  53438. ,
  53439. n.WebGLProperties = function() {
  53440. var e = {};
  53441. this.get = function(t) {
  53442. var i = t.uuid
  53443. , n = e[i];
  53444. return void 0 === n && (n = {},
  53445. e[i] = n),
  53446. n
  53447. }
  53448. ,
  53449. this.delete = function(t) {
  53450. delete e[t.uuid]
  53451. }
  53452. ,
  53453. this.clear = function() {
  53454. e = {}
  53455. }
  53456. }
  53457. ,
  53458. n.WebGLShader = function() {
  53459. function e(e) {
  53460. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53461. t[i] = i + 1 + ": " + t[i];
  53462. return t.join("\n")
  53463. }
  53464. return function(t, i, n) {
  53465. var r = t.createShader(i);
  53466. return t.shaderSource(r, n),
  53467. t.compileShader(r),
  53468. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53469. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53470. r
  53471. }
  53472. }(),
  53473. n.WebGLShadowMap = function(e, t, i) {
  53474. function r(e, t, i, r) {
  53475. var o = e.geometry
  53476. , a = null
  53477. , s = v
  53478. , l = e.customDepthMaterial;
  53479. if (i && (s = A,
  53480. l = e.customDistanceMaterial),
  53481. l)
  53482. a = l;
  53483. else {
  53484. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53485. , h = e instanceof n.SkinnedMesh && t.skinning
  53486. , u = 0;
  53487. c && (u |= f),
  53488. h && (u |= g),
  53489. a = s[u]
  53490. }
  53491. return a.visible = t.visible,
  53492. a.wireframe = t.wireframe,
  53493. a.wireframeLinewidth = t.wireframeLinewidth,
  53494. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53495. a
  53496. }
  53497. function o(e, t, i) {
  53498. if (e.visible !== !1) {
  53499. 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)) {
  53500. var r = e.material;
  53501. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53502. p.push(e))
  53503. }
  53504. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53505. o(a[s], t, i)
  53506. }
  53507. }
  53508. 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) {
  53509. var x = 0 !== (T & f)
  53510. , S = 0 !== (T & g)
  53511. , M = new n.ShaderMaterial({
  53512. uniforms: b,
  53513. vertexShader: E.vertexShader,
  53514. fragmentShader: E.fragmentShader,
  53515. morphTargets: x,
  53516. skinning: S
  53517. });
  53518. v[T] = M;
  53519. var R = new n.ShaderMaterial({
  53520. defines: {
  53521. USE_SHADOWMAP: ""
  53522. },
  53523. uniforms: _,
  53524. vertexShader: w.vertexShader,
  53525. fragmentShader: w.fragmentShader,
  53526. morphTargets: x,
  53527. skinning: S
  53528. });
  53529. A[T] = R
  53530. }
  53531. var P = this;
  53532. this.enabled = !1,
  53533. this.autoUpdate = !0,
  53534. this.needsUpdate = !1,
  53535. this.type = n.PCFShadowMap,
  53536. this.cullFace = n.CullFaceFront,
  53537. this.render = function(f, g) {
  53538. var m, v, A = t.shadows;
  53539. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53540. s.clearColor(1, 1, 1, 1),
  53541. s.disable(a.BLEND),
  53542. s.enable(a.CULL_FACE),
  53543. a.frontFace(a.CCW),
  53544. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53545. s.setDepthTest(!0),
  53546. s.setScissorTest(!1);
  53547. for (var E = 0, b = A.length; E < b; E++) {
  53548. var w = A[E]
  53549. , _ = w.shadow
  53550. , T = _.camera;
  53551. if (h.copy(_.mapSize),
  53552. w instanceof n.PointLight) {
  53553. m = 6,
  53554. v = !0;
  53555. var x = h.x
  53556. , S = h.y;
  53557. I[0].set(2 * x, S, x, S),
  53558. I[1].set(0, S, x, S),
  53559. I[2].set(3 * x, S, x, S),
  53560. I[3].set(x, S, x, S),
  53561. I[4].set(3 * x, 0, x, S),
  53562. I[5].set(x, 0, x, S),
  53563. h.x *= 4,
  53564. h.y *= 2
  53565. } else
  53566. m = 1,
  53567. v = !1;
  53568. if (null === _.map) {
  53569. var M = {
  53570. minFilter: n.NearestFilter,
  53571. magFilter: n.NearestFilter,
  53572. format: n.RGBAFormat
  53573. };
  53574. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53575. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53576. T.updateProjectionMatrix()
  53577. }
  53578. var R = _.map
  53579. , O = _.matrix;
  53580. d.setFromMatrixPosition(w.matrixWorld),
  53581. T.position.copy(d),
  53582. e.setRenderTarget(R),
  53583. e.clear();
  53584. for (var L = 0; L < m; L++) {
  53585. if (v) {
  53586. u.copy(T.position),
  53587. u.add(y[L]),
  53588. T.up.copy(C[L]),
  53589. T.lookAt(u);
  53590. var D = I[L];
  53591. s.viewport(D)
  53592. } else
  53593. u.setFromMatrixPosition(w.target.matrixWorld),
  53594. T.lookAt(u);
  53595. T.updateMatrixWorld(),
  53596. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53597. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53598. O.multiply(T.projectionMatrix),
  53599. O.multiply(T.matrixWorldInverse),
  53600. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53601. l.setFromMatrix(c),
  53602. p.length = 0,
  53603. o(f, g, T);
  53604. for (var N = 0, B = p.length; N < B; N++) {
  53605. var F = p[N]
  53606. , V = i.update(F)
  53607. , U = F.material;
  53608. if (U instanceof n.MultiMaterial)
  53609. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53610. var W = k[G]
  53611. , j = H[W.materialIndex];
  53612. if (j.visible === !0) {
  53613. var Y = r(F, j, v, d);
  53614. e.renderBufferDirect(T, null, V, Y, F, W)
  53615. }
  53616. }
  53617. else {
  53618. var Y = r(F, U, v, d);
  53619. e.renderBufferDirect(T, null, V, Y, F, null)
  53620. }
  53621. }
  53622. }
  53623. }
  53624. var X = e.getClearColor()
  53625. , Z = e.getClearAlpha();
  53626. e.setClearColor(X, Z),
  53627. s.enable(a.BLEND),
  53628. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53629. P.needsUpdate = !1
  53630. }
  53631. }
  53632. }
  53633. ,
  53634. n.WebGLState = function(e, t, i) {
  53635. var r = this
  53636. , o = new n.Vector4
  53637. , a = new Uint8Array(16)
  53638. , s = new Uint8Array(16)
  53639. , l = new Uint8Array(16)
  53640. , c = {}
  53641. , h = null
  53642. , u = null
  53643. , d = null
  53644. , p = null
  53645. , f = null
  53646. , g = null
  53647. , m = null
  53648. , v = null
  53649. , A = !1
  53650. , y = null
  53651. , C = null
  53652. , I = null
  53653. , E = null
  53654. , b = null
  53655. , w = null
  53656. , _ = null
  53657. , T = null
  53658. , x = null
  53659. , S = null
  53660. , M = null
  53661. , R = null
  53662. , P = null
  53663. , O = null
  53664. , L = null
  53665. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53666. , N = void 0
  53667. , B = {}
  53668. , F = new n.Vector4
  53669. , V = null
  53670. , U = null
  53671. , k = new n.Vector4
  53672. , H = new n.Vector4
  53673. , G = e.createTexture();
  53674. e.bindTexture(e.TEXTURE_2D, G),
  53675. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53676. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53677. this.init = function() {
  53678. this.clearColor(0, 0, 0, 1),
  53679. this.clearDepth(1),
  53680. this.clearStencil(0),
  53681. this.enable(e.DEPTH_TEST),
  53682. e.depthFunc(e.LEQUAL),
  53683. e.frontFace(e.CCW),
  53684. e.cullFace(e.BACK),
  53685. this.enable(e.CULL_FACE),
  53686. this.enable(e.BLEND),
  53687. e.blendEquation(e.FUNC_ADD),
  53688. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53689. }
  53690. ,
  53691. this.initAttributes = function() {
  53692. for (var e = 0, t = a.length; e < t; e++)
  53693. a[e] = 0
  53694. }
  53695. ,
  53696. this.enableAttribute = function(i) {
  53697. if (a[i] = 1,
  53698. 0 === s[i] && (e.enableVertexAttribArray(i),
  53699. s[i] = 1),
  53700. 0 !== l[i]) {
  53701. var n = t.get("ANGLE_instanced_arrays");
  53702. n.vertexAttribDivisorANGLE(i, 0),
  53703. l[i] = 0
  53704. }
  53705. }
  53706. ,
  53707. this.enableAttributeAndDivisor = function(t, i, n) {
  53708. a[t] = 1,
  53709. 0 === s[t] && (e.enableVertexAttribArray(t),
  53710. s[t] = 1),
  53711. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53712. l[t] = i)
  53713. }
  53714. ,
  53715. this.disableUnusedAttributes = function() {
  53716. for (var t = 0, i = s.length; t < i; t++)
  53717. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53718. s[t] = 0)
  53719. }
  53720. ,
  53721. this.enable = function(t) {
  53722. c[t] !== !0 && (e.enable(t),
  53723. c[t] = !0)
  53724. }
  53725. ,
  53726. this.disable = function(t) {
  53727. c[t] !== !1 && (e.disable(t),
  53728. c[t] = !1)
  53729. }
  53730. ,
  53731. this.getCompressedTextureFormats = function() {
  53732. if (null === h && (h = [],
  53733. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53734. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53735. h.push(i[n]);
  53736. return h
  53737. }
  53738. ,
  53739. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53740. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53741. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53742. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53743. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53744. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53745. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53746. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53747. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53748. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53749. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53750. u = t,
  53751. A = h),
  53752. t === n.CustomBlending ? (s = s || r,
  53753. l = l || o,
  53754. c = c || a,
  53755. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53756. d = r,
  53757. g = s),
  53758. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53759. p = o,
  53760. f = a,
  53761. m = l,
  53762. v = c)) : (d = null,
  53763. p = null,
  53764. f = null,
  53765. g = null,
  53766. m = null,
  53767. v = null)
  53768. }
  53769. ,
  53770. this.setDepthFunc = function(t) {
  53771. if (y !== t) {
  53772. if (t)
  53773. switch (t) {
  53774. case n.NeverDepth:
  53775. e.depthFunc(e.NEVER);
  53776. break;
  53777. case n.AlwaysDepth:
  53778. e.depthFunc(e.ALWAYS);
  53779. break;
  53780. case n.LessDepth:
  53781. e.depthFunc(e.LESS);
  53782. break;
  53783. case n.LessEqualDepth:
  53784. e.depthFunc(e.LEQUAL);
  53785. break;
  53786. case n.EqualDepth:
  53787. e.depthFunc(e.EQUAL);
  53788. break;
  53789. case n.GreaterEqualDepth:
  53790. e.depthFunc(e.GEQUAL);
  53791. break;
  53792. case n.GreaterDepth:
  53793. e.depthFunc(e.GREATER);
  53794. break;
  53795. case n.NotEqualDepth:
  53796. e.depthFunc(e.NOTEQUAL);
  53797. break;
  53798. default:
  53799. e.depthFunc(e.LEQUAL)
  53800. }
  53801. else
  53802. e.depthFunc(e.LEQUAL);
  53803. y = t
  53804. }
  53805. }
  53806. ,
  53807. this.setDepthTest = function(t) {
  53808. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53809. }
  53810. ,
  53811. this.setDepthWrite = function(t) {
  53812. C !== t && (e.depthMask(t),
  53813. C = t)
  53814. }
  53815. ,
  53816. this.setColorWrite = function(t) {
  53817. I !== t && (e.colorMask(t, t, t, t),
  53818. I = t)
  53819. }
  53820. ,
  53821. this.setStencilFunc = function(t, i, n) {
  53822. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53823. b = t,
  53824. w = i,
  53825. _ = n)
  53826. }
  53827. ,
  53828. this.setStencilOp = function(t, i, n) {
  53829. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53830. T = t,
  53831. x = i,
  53832. S = n)
  53833. }
  53834. ,
  53835. this.setStencilTest = function(t) {
  53836. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53837. }
  53838. ,
  53839. this.setStencilWrite = function(t) {
  53840. E !== t && (e.stencilMask(t),
  53841. E = t)
  53842. }
  53843. ,
  53844. this.setFlipSided = function(t) {
  53845. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53846. M = t)
  53847. }
  53848. ,
  53849. this.setLineWidth = function(t) {
  53850. t !== R && (e.lineWidth(t),
  53851. R = t)
  53852. }
  53853. ,
  53854. this.setPolygonOffset = function(t, i, n) {
  53855. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53856. !t || P === i && O === n || (e.polygonOffset(i, n),
  53857. P = i,
  53858. O = n)
  53859. }
  53860. ,
  53861. this.getScissorTest = function() {
  53862. return L
  53863. }
  53864. ,
  53865. this.setScissorTest = function(t) {
  53866. L = t,
  53867. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53868. }
  53869. ,
  53870. this.activeTexture = function(t) {
  53871. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53872. N !== t && (e.activeTexture(t),
  53873. N = t)
  53874. }
  53875. ,
  53876. this.bindTexture = function(t, i) {
  53877. void 0 === N && r.activeTexture();
  53878. var n = B[N];
  53879. void 0 === n && (n = {
  53880. type: void 0,
  53881. texture: void 0
  53882. },
  53883. B[N] = n),
  53884. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53885. n.type = t,
  53886. n.texture = i)
  53887. }
  53888. ,
  53889. this.compressedTexImage2D = function() {
  53890. try {
  53891. e.compressedTexImage2D.apply(e, arguments)
  53892. } catch (e) {
  53893. console.error(e)
  53894. }
  53895. }
  53896. ,
  53897. this.texImage2D = function() {
  53898. try {
  53899. e.texImage2D.apply(e, arguments)
  53900. } catch (e) {
  53901. console.error(e)
  53902. }
  53903. }
  53904. ,
  53905. this.clearColor = function(t, i, n, r) {
  53906. o.set(t, i, n, r),
  53907. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53908. F.copy(o))
  53909. }
  53910. ,
  53911. this.clearDepth = function(t) {
  53912. V !== t && (e.clearDepth(t),
  53913. V = t)
  53914. }
  53915. ,
  53916. this.clearStencil = function(t) {
  53917. U !== t && (e.clearStencil(t),
  53918. U = t)
  53919. }
  53920. ,
  53921. this.scissor = function(t) {
  53922. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53923. k.copy(t))
  53924. }
  53925. ,
  53926. this.viewport = function(t) {
  53927. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53928. H.copy(t))
  53929. }
  53930. ,
  53931. this.reset = function() {
  53932. for (var t = 0; t < s.length; t++)
  53933. 1 === s[t] && (e.disableVertexAttribArray(t),
  53934. s[t] = 0);
  53935. c = {},
  53936. h = null,
  53937. N = void 0,
  53938. B = {},
  53939. u = null,
  53940. I = null,
  53941. C = null,
  53942. E = null,
  53943. M = null
  53944. }
  53945. }
  53946. ,
  53947. n.LensFlarePlugin = function(e, t) {
  53948. function i() {
  53949. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53950. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53951. o = p.createBuffer(),
  53952. a = p.createBuffer(),
  53953. p.bindBuffer(p.ARRAY_BUFFER, o),
  53954. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53955. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53956. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53957. u = p.createTexture(),
  53958. d = p.createTexture(),
  53959. f.bindTexture(p.TEXTURE_2D, u),
  53960. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53961. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53962. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53963. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53964. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53965. f.bindTexture(p.TEXTURE_2D, d),
  53966. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53967. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53968. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53969. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53970. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53971. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53972. var i;
  53973. i = h ? {
  53974. 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"),
  53975. 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")
  53976. } : {
  53977. 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"),
  53978. 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")
  53979. },
  53980. s = r(i),
  53981. l = {
  53982. vertex: p.getAttribLocation(s, "position"),
  53983. uv: p.getAttribLocation(s, "uv")
  53984. },
  53985. c = {
  53986. renderType: p.getUniformLocation(s, "renderType"),
  53987. map: p.getUniformLocation(s, "map"),
  53988. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53989. opacity: p.getUniformLocation(s, "opacity"),
  53990. color: p.getUniformLocation(s, "color"),
  53991. scale: p.getUniformLocation(s, "scale"),
  53992. rotation: p.getUniformLocation(s, "rotation"),
  53993. screenPosition: p.getUniformLocation(s, "screenPosition")
  53994. }
  53995. }
  53996. function r(t) {
  53997. var i = p.createProgram()
  53998. , n = p.createShader(p.FRAGMENT_SHADER)
  53999. , r = p.createShader(p.VERTEX_SHADER)
  54000. , o = "precision " + e.getPrecision() + " float;\n";
  54001. return p.shaderSource(n, o + t.fragmentShader),
  54002. p.shaderSource(r, o + t.vertexShader),
  54003. p.compileShader(n),
  54004. p.compileShader(r),
  54005. p.attachShader(i, n),
  54006. p.attachShader(i, r),
  54007. p.linkProgram(i),
  54008. i
  54009. }
  54010. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54011. this.render = function(r, g, m) {
  54012. if (0 !== t.length) {
  54013. var v = new n.Vector3
  54014. , A = m.w / m.z
  54015. , y = .5 * m.z
  54016. , C = .5 * m.w
  54017. , I = 16 / m.w
  54018. , E = new n.Vector2(I * A,I)
  54019. , b = new n.Vector3(1,1,0)
  54020. , w = new n.Vector2(1,1);
  54021. void 0 === s && i(),
  54022. p.useProgram(s),
  54023. f.initAttributes(),
  54024. f.enableAttribute(l.vertex),
  54025. f.enableAttribute(l.uv),
  54026. f.disableUnusedAttributes(),
  54027. p.uniform1i(c.occlusionMap, 0),
  54028. p.uniform1i(c.map, 1),
  54029. p.bindBuffer(p.ARRAY_BUFFER, o),
  54030. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54031. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54032. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54033. f.disable(p.CULL_FACE),
  54034. f.setDepthWrite(!1);
  54035. for (var _ = 0, T = t.length; _ < T; _++) {
  54036. I = 16 / m.w,
  54037. E.set(I * A, I);
  54038. var x = t[_];
  54039. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54040. v.applyMatrix4(g.matrixWorldInverse),
  54041. v.applyProjection(g.projectionMatrix),
  54042. b.copy(v),
  54043. w.x = b.x * y + y,
  54044. w.y = b.y * C + C,
  54045. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54046. f.activeTexture(p.TEXTURE0),
  54047. f.bindTexture(p.TEXTURE_2D, null),
  54048. f.activeTexture(p.TEXTURE1),
  54049. f.bindTexture(p.TEXTURE_2D, u),
  54050. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54051. p.uniform1i(c.renderType, 0),
  54052. p.uniform2f(c.scale, E.x, E.y),
  54053. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54054. f.disable(p.BLEND),
  54055. f.enable(p.DEPTH_TEST),
  54056. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54057. f.activeTexture(p.TEXTURE0),
  54058. f.bindTexture(p.TEXTURE_2D, d),
  54059. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54060. p.uniform1i(c.renderType, 1),
  54061. f.disable(p.DEPTH_TEST),
  54062. f.activeTexture(p.TEXTURE1),
  54063. f.bindTexture(p.TEXTURE_2D, u),
  54064. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54065. x.positionScreen.copy(b),
  54066. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54067. p.uniform1i(c.renderType, 2),
  54068. f.enable(p.BLEND);
  54069. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54070. var R = x.lensFlares[S];
  54071. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54072. b.y = R.y,
  54073. b.z = R.z,
  54074. I = R.size * R.scale / m.w,
  54075. E.x = I * A,
  54076. E.y = I,
  54077. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54078. p.uniform2f(c.scale, E.x, E.y),
  54079. p.uniform1f(c.rotation, R.rotation),
  54080. p.uniform1f(c.opacity, R.opacity),
  54081. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54082. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54083. e.setTexture(R.texture, 1),
  54084. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54085. }
  54086. }
  54087. }
  54088. f.enable(p.CULL_FACE),
  54089. f.enable(p.DEPTH_TEST),
  54090. f.setDepthWrite(!0),
  54091. e.resetGLState()
  54092. }
  54093. }
  54094. }
  54095. ,
  54096. n.SpritePlugin = function(e, t) {
  54097. function i() {
  54098. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54099. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54100. a = d.createBuffer(),
  54101. s = d.createBuffer(),
  54102. d.bindBuffer(d.ARRAY_BUFFER, a),
  54103. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54104. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54105. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54106. l = r(),
  54107. c = {
  54108. position: d.getAttribLocation(l, "position"),
  54109. uv: d.getAttribLocation(l, "uv")
  54110. },
  54111. h = {
  54112. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54113. uvScale: d.getUniformLocation(l, "uvScale"),
  54114. rotation: d.getUniformLocation(l, "rotation"),
  54115. scale: d.getUniformLocation(l, "scale"),
  54116. color: d.getUniformLocation(l, "color"),
  54117. map: d.getUniformLocation(l, "map"),
  54118. opacity: d.getUniformLocation(l, "opacity"),
  54119. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54120. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54121. fogType: d.getUniformLocation(l, "fogType"),
  54122. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54123. fogNear: d.getUniformLocation(l, "fogNear"),
  54124. fogFar: d.getUniformLocation(l, "fogFar"),
  54125. fogColor: d.getUniformLocation(l, "fogColor"),
  54126. alphaTest: d.getUniformLocation(l, "alphaTest")
  54127. };
  54128. var i = document.createElement("canvas");
  54129. i.width = 8,
  54130. i.height = 8;
  54131. var o = i.getContext("2d");
  54132. o.fillStyle = "white",
  54133. o.fillRect(0, 0, 8, 8),
  54134. u = new n.Texture(i),
  54135. u.needsUpdate = !0
  54136. }
  54137. function r() {
  54138. var t = d.createProgram()
  54139. , i = d.createShader(d.VERTEX_SHADER)
  54140. , n = d.createShader(d.FRAGMENT_SHADER);
  54141. 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")),
  54142. 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")),
  54143. d.compileShader(i),
  54144. d.compileShader(n),
  54145. d.attachShader(t, i),
  54146. d.attachShader(t, n),
  54147. d.linkProgram(t),
  54148. t
  54149. }
  54150. function o(e, t) {
  54151. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54152. }
  54153. 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;
  54154. this.render = function(r, v) {
  54155. if (0 !== t.length) {
  54156. void 0 === l && i(),
  54157. d.useProgram(l),
  54158. p.initAttributes(),
  54159. p.enableAttribute(c.position),
  54160. p.enableAttribute(c.uv),
  54161. p.disableUnusedAttributes(),
  54162. p.disable(d.CULL_FACE),
  54163. p.enable(d.BLEND),
  54164. d.bindBuffer(d.ARRAY_BUFFER, a),
  54165. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54166. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54167. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54168. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54169. p.activeTexture(d.TEXTURE0),
  54170. d.uniform1i(h.map, 0);
  54171. var A = 0
  54172. , y = 0
  54173. , C = r.fog;
  54174. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54175. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54176. d.uniform1f(h.fogFar, C.far),
  54177. d.uniform1i(h.fogType, 1),
  54178. A = 1,
  54179. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54180. d.uniform1i(h.fogType, 2),
  54181. A = 2,
  54182. y = 2)) : (d.uniform1i(h.fogType, 0),
  54183. A = 0,
  54184. y = 0);
  54185. for (var I = 0, E = t.length; I < E; I++) {
  54186. var b = t[I];
  54187. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54188. b.z = -b.modelViewMatrix.elements[14]
  54189. }
  54190. t.sort(o);
  54191. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54192. var b = t[I]
  54193. , _ = b.material;
  54194. d.uniform1f(h.alphaTest, _.alphaTest),
  54195. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54196. b.matrixWorld.decompose(f, g, m),
  54197. w[0] = m.x,
  54198. w[1] = m.y;
  54199. var T = 0;
  54200. r.fog && _.fog && (T = y),
  54201. A !== T && (d.uniform1i(h.fogType, T),
  54202. A = T),
  54203. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54204. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54205. d.uniform2f(h.uvScale, 1, 1)),
  54206. d.uniform1f(h.opacity, _.opacity),
  54207. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54208. d.uniform1f(h.rotation, _.rotation),
  54209. d.uniform2fv(h.scale, w),
  54210. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54211. p.setDepthTest(_.depthTest),
  54212. p.setDepthWrite(_.depthWrite),
  54213. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54214. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54215. }
  54216. p.enable(d.CULL_FACE),
  54217. e.resetGLState()
  54218. }
  54219. }
  54220. }
  54221. ,
  54222. Object.defineProperties(n.Box2.prototype, {
  54223. empty: {
  54224. value: function() {
  54225. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54226. this.isEmpty()
  54227. }
  54228. },
  54229. isIntersectionBox: {
  54230. value: function(e) {
  54231. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54232. this.intersectsBox(e)
  54233. }
  54234. }
  54235. }),
  54236. Object.defineProperties(n.Box3.prototype, {
  54237. empty: {
  54238. value: function() {
  54239. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54240. this.isEmpty()
  54241. }
  54242. },
  54243. isIntersectionBox: {
  54244. value: function(e) {
  54245. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54246. this.intersectsBox(e)
  54247. }
  54248. },
  54249. isIntersectionSphere: {
  54250. value: function(e) {
  54251. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54252. this.intersectsSphere(e)
  54253. }
  54254. }
  54255. }),
  54256. Object.defineProperties(n.Matrix3.prototype, {
  54257. multiplyVector3: {
  54258. value: function(e) {
  54259. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54260. e.applyMatrix3(this)
  54261. }
  54262. },
  54263. multiplyVector3Array: {
  54264. value: function(e) {
  54265. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54266. this.applyToVector3Array(e)
  54267. }
  54268. }
  54269. }),
  54270. Object.defineProperties(n.Matrix4.prototype, {
  54271. extractPosition: {
  54272. value: function(e) {
  54273. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54274. this.copyPosition(e)
  54275. }
  54276. },
  54277. setRotationFromQuaternion: {
  54278. value: function(e) {
  54279. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54280. this.makeRotationFromQuaternion(e)
  54281. }
  54282. },
  54283. multiplyVector3: {
  54284. value: function(e) {
  54285. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54286. e.applyProjection(this)
  54287. }
  54288. },
  54289. multiplyVector4: {
  54290. value: function(e) {
  54291. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54292. e.applyMatrix4(this)
  54293. }
  54294. },
  54295. multiplyVector3Array: {
  54296. value: function(e) {
  54297. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54298. this.applyToVector3Array(e)
  54299. }
  54300. },
  54301. rotateAxis: {
  54302. value: function(e) {
  54303. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54304. e.transformDirection(this)
  54305. }
  54306. },
  54307. crossVector: {
  54308. value: function(e) {
  54309. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54310. e.applyMatrix4(this)
  54311. }
  54312. },
  54313. translate: {
  54314. value: function(e) {
  54315. console.error("THREE.Matrix4: .translate() has been removed.")
  54316. }
  54317. },
  54318. rotateX: {
  54319. value: function(e) {
  54320. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54321. }
  54322. },
  54323. rotateY: {
  54324. value: function(e) {
  54325. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54326. }
  54327. },
  54328. rotateZ: {
  54329. value: function(e) {
  54330. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54331. }
  54332. },
  54333. rotateByAxis: {
  54334. value: function(e, t) {
  54335. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54336. }
  54337. }
  54338. }),
  54339. Object.defineProperties(n.Plane.prototype, {
  54340. isIntersectionLine: {
  54341. value: function(e) {
  54342. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54343. this.intersectsLine(e)
  54344. }
  54345. }
  54346. }),
  54347. Object.defineProperties(n.Quaternion.prototype, {
  54348. multiplyVector3: {
  54349. value: function(e) {
  54350. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54351. e.applyQuaternion(this)
  54352. }
  54353. }
  54354. }),
  54355. Object.defineProperties(n.Ray.prototype, {
  54356. isIntersectionBox: {
  54357. value: function(e) {
  54358. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54359. this.intersectsBox(e)
  54360. }
  54361. },
  54362. isIntersectionPlane: {
  54363. value: function(e) {
  54364. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54365. this.intersectsPlane(e)
  54366. }
  54367. },
  54368. isIntersectionSphere: {
  54369. value: function(e) {
  54370. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54371. this.intersectsSphere(e)
  54372. }
  54373. }
  54374. }),
  54375. Object.defineProperties(n.Vector3.prototype, {
  54376. setEulerFromRotationMatrix: {
  54377. value: function() {
  54378. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54379. }
  54380. },
  54381. setEulerFromQuaternion: {
  54382. value: function() {
  54383. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54384. }
  54385. },
  54386. getPositionFromMatrix: {
  54387. value: function(e) {
  54388. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54389. this.setFromMatrixPosition(e)
  54390. }
  54391. },
  54392. getScaleFromMatrix: {
  54393. value: function(e) {
  54394. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54395. this.setFromMatrixScale(e)
  54396. }
  54397. },
  54398. getColumnFromMatrix: {
  54399. value: function(e, t) {
  54400. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54401. this.setFromMatrixColumn(e, t)
  54402. }
  54403. }
  54404. }),
  54405. n.Face4 = function(e, t, i, r, o, a, s) {
  54406. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54407. new n.Face3(e,t,i,o,a,s)
  54408. }
  54409. ,
  54410. n.Vertex = function(e, t, i) {
  54411. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54412. new n.Vector3(e,t,i)
  54413. }
  54414. ,
  54415. Object.defineProperties(n.Object3D.prototype, {
  54416. eulerOrder: {
  54417. get: function() {
  54418. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54419. this.rotation.order
  54420. },
  54421. set: function(e) {
  54422. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54423. this.rotation.order = e
  54424. }
  54425. },
  54426. getChildByName: {
  54427. value: function(e) {
  54428. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54429. this.getObjectByName(e)
  54430. }
  54431. },
  54432. renderDepth: {
  54433. set: function(e) {
  54434. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54435. }
  54436. },
  54437. translate: {
  54438. value: function(e, t) {
  54439. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54440. this.translateOnAxis(t, e)
  54441. }
  54442. },
  54443. useQuaternion: {
  54444. get: function() {
  54445. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54446. },
  54447. set: function(e) {
  54448. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54449. }
  54450. }
  54451. }),
  54452. Object.defineProperties(n, {
  54453. PointCloud: {
  54454. value: function(e, t) {
  54455. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54456. new n.Points(e,t)
  54457. }
  54458. },
  54459. ParticleSystem: {
  54460. value: function(e, t) {
  54461. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54462. new n.Points(e,t)
  54463. }
  54464. }
  54465. }),
  54466. Object.defineProperties(n.Light.prototype, {
  54467. onlyShadow: {
  54468. set: function(e) {
  54469. console.warn("THREE.Light: .onlyShadow has been removed.")
  54470. }
  54471. },
  54472. shadowCameraFov: {
  54473. set: function(e) {
  54474. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54475. this.shadow.camera.fov = e
  54476. }
  54477. },
  54478. shadowCameraLeft: {
  54479. set: function(e) {
  54480. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54481. this.shadow.camera.left = e
  54482. }
  54483. },
  54484. shadowCameraRight: {
  54485. set: function(e) {
  54486. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54487. this.shadow.camera.right = e
  54488. }
  54489. },
  54490. shadowCameraTop: {
  54491. set: function(e) {
  54492. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54493. this.shadow.camera.top = e
  54494. }
  54495. },
  54496. shadowCameraBottom: {
  54497. set: function(e) {
  54498. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54499. this.shadow.camera.bottom = e
  54500. }
  54501. },
  54502. shadowCameraNear: {
  54503. set: function(e) {
  54504. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54505. this.shadow.camera.near = e
  54506. }
  54507. },
  54508. shadowCameraFar: {
  54509. set: function(e) {
  54510. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54511. this.shadow.camera.far = e
  54512. }
  54513. },
  54514. shadowCameraVisible: {
  54515. set: function(e) {
  54516. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54517. }
  54518. },
  54519. shadowBias: {
  54520. set: function(e) {
  54521. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54522. this.shadow.bias = e
  54523. }
  54524. },
  54525. shadowDarkness: {
  54526. set: function(e) {
  54527. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54528. }
  54529. },
  54530. shadowMapWidth: {
  54531. set: function(e) {
  54532. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54533. this.shadow.mapSize.width = e
  54534. }
  54535. },
  54536. shadowMapHeight: {
  54537. set: function(e) {
  54538. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54539. this.shadow.mapSize.height = e
  54540. }
  54541. }
  54542. }),
  54543. Object.defineProperties(n.BufferAttribute.prototype, {
  54544. length: {
  54545. get: function() {
  54546. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54547. this.array.length
  54548. }
  54549. }
  54550. }),
  54551. Object.defineProperties(n.BufferGeometry.prototype, {
  54552. drawcalls: {
  54553. get: function() {
  54554. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54555. this.groups
  54556. }
  54557. },
  54558. offsets: {
  54559. get: function() {
  54560. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54561. this.groups
  54562. }
  54563. },
  54564. addIndex: {
  54565. value: function(e) {
  54566. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54567. this.setIndex(e)
  54568. }
  54569. },
  54570. addDrawCall: {
  54571. value: function(e, t, i) {
  54572. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54573. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54574. this.addGroup(e, t)
  54575. }
  54576. },
  54577. clearDrawCalls: {
  54578. value: function() {
  54579. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54580. this.clearGroups()
  54581. }
  54582. },
  54583. computeTangents: {
  54584. value: function() {
  54585. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54586. }
  54587. },
  54588. computeOffsets: {
  54589. value: function() {
  54590. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54591. }
  54592. }
  54593. }),
  54594. Object.defineProperties(n.Material.prototype, {
  54595. wrapAround: {
  54596. get: function() {
  54597. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54598. },
  54599. set: function(e) {
  54600. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54601. }
  54602. },
  54603. wrapRGB: {
  54604. get: function() {
  54605. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54606. new n.Color
  54607. }
  54608. }
  54609. }),
  54610. Object.defineProperties(n, {
  54611. PointCloudMaterial: {
  54612. value: function(e) {
  54613. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54614. new n.PointsMaterial(e)
  54615. }
  54616. },
  54617. ParticleBasicMaterial: {
  54618. value: function(e) {
  54619. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54620. new n.PointsMaterial(e)
  54621. }
  54622. },
  54623. ParticleSystemMaterial: {
  54624. value: function(e) {
  54625. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54626. new n.PointsMaterial(e)
  54627. }
  54628. }
  54629. }),
  54630. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54631. metal: {
  54632. get: function() {
  54633. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54634. !1
  54635. },
  54636. set: function(e) {
  54637. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54638. }
  54639. }
  54640. }),
  54641. Object.defineProperties(n.ShaderMaterial.prototype, {
  54642. derivatives: {
  54643. get: function() {
  54644. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54645. this.extensions.derivatives
  54646. },
  54647. set: function(e) {
  54648. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54649. this.extensions.derivatives = e
  54650. }
  54651. }
  54652. }),
  54653. Object.defineProperties(n.WebGLRenderer.prototype, {
  54654. supportsFloatTextures: {
  54655. value: function() {
  54656. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54657. this.extensions.get("OES_texture_float")
  54658. }
  54659. },
  54660. supportsHalfFloatTextures: {
  54661. value: function() {
  54662. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54663. this.extensions.get("OES_texture_half_float")
  54664. }
  54665. },
  54666. supportsStandardDerivatives: {
  54667. value: function() {
  54668. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54669. this.extensions.get("OES_standard_derivatives")
  54670. }
  54671. },
  54672. supportsCompressedTextureS3TC: {
  54673. value: function() {
  54674. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54675. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54676. }
  54677. },
  54678. supportsCompressedTexturePVRTC: {
  54679. value: function() {
  54680. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54681. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54682. }
  54683. },
  54684. supportsBlendMinMax: {
  54685. value: function() {
  54686. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54687. this.extensions.get("EXT_blend_minmax")
  54688. }
  54689. },
  54690. supportsVertexTextures: {
  54691. value: function() {
  54692. return this.capabilities.vertexTextures
  54693. }
  54694. },
  54695. supportsInstancedArrays: {
  54696. value: function() {
  54697. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54698. this.extensions.get("ANGLE_instanced_arrays")
  54699. }
  54700. },
  54701. enableScissorTest: {
  54702. value: function(e) {
  54703. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54704. this.setScissorTest(e)
  54705. }
  54706. },
  54707. initMaterial: {
  54708. value: function() {
  54709. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54710. }
  54711. },
  54712. addPrePlugin: {
  54713. value: function() {
  54714. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54715. }
  54716. },
  54717. addPostPlugin: {
  54718. value: function() {
  54719. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54720. }
  54721. },
  54722. updateShadowMap: {
  54723. value: function() {
  54724. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54725. }
  54726. },
  54727. shadowMapEnabled: {
  54728. get: function() {
  54729. return this.shadowMap.enabled
  54730. },
  54731. set: function(e) {
  54732. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54733. this.shadowMap.enabled = e
  54734. }
  54735. },
  54736. shadowMapType: {
  54737. get: function() {
  54738. return this.shadowMap.type
  54739. },
  54740. set: function(e) {
  54741. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54742. this.shadowMap.type = e
  54743. }
  54744. },
  54745. shadowMapCullFace: {
  54746. get: function() {
  54747. return this.shadowMap.cullFace
  54748. },
  54749. set: function(e) {
  54750. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54751. this.shadowMap.cullFace = e
  54752. }
  54753. }
  54754. }),
  54755. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54756. wrapS: {
  54757. get: function() {
  54758. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54759. this.texture.wrapS
  54760. },
  54761. set: function(e) {
  54762. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54763. this.texture.wrapS = e
  54764. }
  54765. },
  54766. wrapT: {
  54767. get: function() {
  54768. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54769. this.texture.wrapT
  54770. },
  54771. set: function(e) {
  54772. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54773. this.texture.wrapT = e
  54774. }
  54775. },
  54776. magFilter: {
  54777. get: function() {
  54778. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54779. this.texture.magFilter
  54780. },
  54781. set: function(e) {
  54782. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54783. this.texture.magFilter = e
  54784. }
  54785. },
  54786. minFilter: {
  54787. get: function() {
  54788. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54789. this.texture.minFilter
  54790. },
  54791. set: function(e) {
  54792. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54793. this.texture.minFilter = e
  54794. }
  54795. },
  54796. anisotropy: {
  54797. get: function() {
  54798. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54799. this.texture.anisotropy
  54800. },
  54801. set: function(e) {
  54802. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54803. this.texture.anisotropy = e
  54804. }
  54805. },
  54806. offset: {
  54807. get: function() {
  54808. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54809. this.texture.offset
  54810. },
  54811. set: function(e) {
  54812. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54813. this.texture.offset = e
  54814. }
  54815. },
  54816. repeat: {
  54817. get: function() {
  54818. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54819. this.texture.repeat
  54820. },
  54821. set: function(e) {
  54822. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54823. this.texture.repeat = e
  54824. }
  54825. },
  54826. format: {
  54827. get: function() {
  54828. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54829. this.texture.format
  54830. },
  54831. set: function(e) {
  54832. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54833. this.texture.format = e
  54834. }
  54835. },
  54836. type: {
  54837. get: function() {
  54838. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54839. this.texture.type
  54840. },
  54841. set: function(e) {
  54842. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54843. this.texture.type = e
  54844. }
  54845. },
  54846. generateMipmaps: {
  54847. get: function() {
  54848. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54849. this.texture.generateMipmaps
  54850. },
  54851. set: function(e) {
  54852. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54853. this.texture.generateMipmaps = e
  54854. }
  54855. }
  54856. }),
  54857. n.GeometryUtils = {
  54858. merge: function(e, t, i) {
  54859. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54860. var r;
  54861. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54862. r = t.matrix,
  54863. t = t.geometry),
  54864. e.merge(t, r, i)
  54865. },
  54866. center: function(e) {
  54867. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54868. e.center()
  54869. }
  54870. },
  54871. n.ImageUtils = {
  54872. crossOrigin: void 0,
  54873. loadTexture: function(e, t, i, r) {
  54874. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54875. var o = new n.TextureLoader;
  54876. o.setCrossOrigin(this.crossOrigin);
  54877. var a = o.load(e, i, void 0, r);
  54878. return t && (a.mapping = t),
  54879. a
  54880. },
  54881. loadTextureCube: function(e, t, i, r) {
  54882. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54883. var o = new n.CubeTextureLoader;
  54884. o.setCrossOrigin(this.crossOrigin);
  54885. var a = o.load(e, i, void 0, r);
  54886. return t && (a.mapping = t),
  54887. a
  54888. },
  54889. loadCompressedTexture: function() {
  54890. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54891. },
  54892. loadCompressedTextureCube: function() {
  54893. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54894. }
  54895. },
  54896. n.Projector = function() {
  54897. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54898. this.projectVector = function(e, t) {
  54899. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54900. e.project(t)
  54901. }
  54902. ,
  54903. this.unprojectVector = function(e, t) {
  54904. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54905. e.unproject(t)
  54906. }
  54907. ,
  54908. this.pickingRay = function(e, t) {
  54909. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54910. }
  54911. }
  54912. ,
  54913. n.CanvasRenderer = function() {
  54914. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54915. this.domElement = document.createElement("canvas"),
  54916. this.clear = function() {}
  54917. ,
  54918. this.render = function() {}
  54919. ,
  54920. this.setClearColor = function() {}
  54921. ,
  54922. this.setSize = function() {}
  54923. }
  54924. ,
  54925. n.MeshFaceMaterial = n.MultiMaterial,
  54926. n.CurveUtils = {
  54927. tangentQuadraticBezier: function(e, t, i, n) {
  54928. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54929. },
  54930. tangentCubicBezier: function(e, t, i, n, r) {
  54931. 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
  54932. },
  54933. tangentSpline: function(e, t, i, n, r) {
  54934. var o = 6 * e * e - 6 * e
  54935. , a = 3 * e * e - 4 * e + 1
  54936. , s = -6 * e * e + 6 * e
  54937. , l = 3 * e * e - 2 * e;
  54938. return o + a + s + l
  54939. },
  54940. interpolate: function(e, t, i, n, r) {
  54941. var o = .5 * (i - e)
  54942. , a = .5 * (n - t)
  54943. , s = r * r
  54944. , l = r * s;
  54945. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54946. }
  54947. },
  54948. n.SceneUtils = {
  54949. createMultiMaterialObject: function(e, t) {
  54950. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54951. i.add(new n.Mesh(e,t[r]));
  54952. return i
  54953. },
  54954. detach: function(e, t, i) {
  54955. e.applyMatrix(t.matrixWorld),
  54956. t.remove(e),
  54957. i.add(e)
  54958. },
  54959. attach: function(e, t, i) {
  54960. var r = new n.Matrix4;
  54961. r.getInverse(i.matrixWorld),
  54962. e.applyMatrix(r),
  54963. t.remove(e),
  54964. i.add(e)
  54965. }
  54966. },
  54967. n.ShapeUtils = {
  54968. area: function(e) {
  54969. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54970. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54971. return .5 * i
  54972. },
  54973. triangulate: function() {
  54974. function e(e, t, i, n, r, o) {
  54975. var a, s, l, c, h, u, d, p, f;
  54976. if (s = e[o[t]].x,
  54977. l = e[o[t]].y,
  54978. c = e[o[i]].x,
  54979. h = e[o[i]].y,
  54980. u = e[o[n]].x,
  54981. d = e[o[n]].y,
  54982. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54983. return !1;
  54984. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54985. for (g = u - c,
  54986. m = d - h,
  54987. v = s - u,
  54988. A = l - d,
  54989. y = c - s,
  54990. C = h - l,
  54991. a = 0; a < r; a++)
  54992. if (p = e[o[a]].x,
  54993. f = e[o[a]].y,
  54994. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54995. E = f - l,
  54996. b = p - c,
  54997. w = f - h,
  54998. _ = p - u,
  54999. T = f - d,
  55000. M = g * w - m * b,
  55001. x = y * E - C * I,
  55002. S = v * T - A * _,
  55003. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55004. return !1;
  55005. return !0
  55006. }
  55007. return function(t, i) {
  55008. var r = t.length;
  55009. if (r < 3)
  55010. return null;
  55011. var o, a, s, l = [], c = [], h = [];
  55012. if (n.ShapeUtils.area(t) > 0)
  55013. for (a = 0; a < r; a++)
  55014. c[a] = a;
  55015. else
  55016. for (a = 0; a < r; a++)
  55017. c[a] = r - 1 - a;
  55018. var u = r
  55019. , d = 2 * u;
  55020. for (a = u - 1; u > 2; ) {
  55021. if (d-- <= 0)
  55022. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55023. i ? h : l;
  55024. if (o = a,
  55025. u <= o && (o = 0),
  55026. a = o + 1,
  55027. u <= a && (a = 0),
  55028. s = a + 1,
  55029. u <= s && (s = 0),
  55030. e(t, o, a, s, u, c)) {
  55031. var p, f, g, m, v;
  55032. for (p = c[o],
  55033. f = c[a],
  55034. g = c[s],
  55035. l.push([t[p], t[f], t[g]]),
  55036. h.push([c[o], c[a], c[s]]),
  55037. m = a,
  55038. v = a + 1; v < u; m++,
  55039. v++)
  55040. c[m] = c[v];
  55041. u--,
  55042. d = 2 * u
  55043. }
  55044. }
  55045. return i ? h : l
  55046. }
  55047. }(),
  55048. triangulateShape: function(e, t) {
  55049. function i(e, t, i) {
  55050. 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
  55051. }
  55052. function r(e, t, n, r, o) {
  55053. var a = t.x - e.x
  55054. , s = t.y - e.y
  55055. , l = r.x - n.x
  55056. , c = r.y - n.y
  55057. , h = e.x - n.x
  55058. , u = e.y - n.y
  55059. , d = s * l - a * c
  55060. , p = s * h - a * u;
  55061. if (Math.abs(d) > Number.EPSILON) {
  55062. var f;
  55063. if (d > 0) {
  55064. if (p < 0 || p > d)
  55065. return [];
  55066. if (f = c * h - l * u,
  55067. f < 0 || f > d)
  55068. return []
  55069. } else {
  55070. if (p > 0 || p < d)
  55071. return [];
  55072. if (f = c * h - l * u,
  55073. f > 0 || f < d)
  55074. return []
  55075. }
  55076. if (0 === f)
  55077. return !o || 0 !== p && p !== d ? [e] : [];
  55078. if (f === d)
  55079. return !o || 0 !== p && p !== d ? [t] : [];
  55080. if (0 === p)
  55081. return [n];
  55082. if (p === d)
  55083. return [r];
  55084. var g = f / d;
  55085. return [{
  55086. x: e.x + g * a,
  55087. y: e.y + g * s
  55088. }]
  55089. }
  55090. if (0 !== p || c * h !== l * u)
  55091. return [];
  55092. var m = 0 === a && 0 === s
  55093. , v = 0 === l && 0 === c;
  55094. if (m && v)
  55095. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55096. if (m)
  55097. return i(n, r, e) ? [e] : [];
  55098. if (v)
  55099. return i(e, t, n) ? [n] : [];
  55100. var A, y, C, I, E, b, w, _;
  55101. return 0 !== a ? (e.x < t.x ? (A = e,
  55102. C = e.x,
  55103. y = t,
  55104. I = t.x) : (A = t,
  55105. C = t.x,
  55106. y = e,
  55107. I = e.x),
  55108. n.x < r.x ? (E = n,
  55109. w = n.x,
  55110. b = r,
  55111. _ = r.x) : (E = r,
  55112. w = r.x,
  55113. b = n,
  55114. _ = n.x)) : (e.y < t.y ? (A = e,
  55115. C = e.y,
  55116. y = t,
  55117. I = t.y) : (A = t,
  55118. C = t.y,
  55119. y = e,
  55120. I = e.y),
  55121. n.y < r.y ? (E = n,
  55122. w = n.y,
  55123. b = r,
  55124. _ = r.y) : (E = r,
  55125. w = r.y,
  55126. b = n,
  55127. _ = n.y)),
  55128. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55129. }
  55130. function o(e, t, i, n) {
  55131. var r = t.x - e.x
  55132. , o = t.y - e.y
  55133. , a = i.x - e.x
  55134. , s = i.y - e.y
  55135. , l = n.x - e.x
  55136. , c = n.y - e.y
  55137. , h = r * s - o * a
  55138. , u = r * c - o * l;
  55139. if (Math.abs(h) > Number.EPSILON) {
  55140. var d = l * s - c * a;
  55141. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55142. }
  55143. return u > 0
  55144. }
  55145. function a(e, t) {
  55146. function i(e, t) {
  55147. var i = A.length - 1
  55148. , n = e - 1;
  55149. n < 0 && (n = i);
  55150. var r = e + 1;
  55151. r > i && (r = 0);
  55152. var a = o(A[e], A[n], A[r], s[t]);
  55153. if (!a)
  55154. return !1;
  55155. var l = s.length - 1
  55156. , c = t - 1;
  55157. c < 0 && (c = l);
  55158. var h = t + 1;
  55159. return h > l && (h = 0),
  55160. a = o(s[t], s[c], s[h], A[e]),
  55161. !!a
  55162. }
  55163. function n(e, t) {
  55164. var i, n, o;
  55165. for (i = 0; i < A.length; i++)
  55166. if (n = i + 1,
  55167. n %= A.length,
  55168. o = r(e, t, A[i], A[n], !0),
  55169. o.length > 0)
  55170. return !0;
  55171. return !1
  55172. }
  55173. function a(e, i) {
  55174. var n, o, a, s, l;
  55175. for (n = 0; n < y.length; n++)
  55176. for (o = t[y[n]],
  55177. a = 0; a < o.length; a++)
  55178. if (s = a + 1,
  55179. s %= o.length,
  55180. l = r(e, i, o[a], o[s], !0),
  55181. l.length > 0)
  55182. return !0;
  55183. return !1
  55184. }
  55185. 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++)
  55186. y.push(I);
  55187. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55188. if (w--,
  55189. w < 0) {
  55190. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55191. break
  55192. }
  55193. for (c = b; c < A.length; c++) {
  55194. h = A[c],
  55195. l = -1;
  55196. for (var I = 0; I < y.length; I++)
  55197. if (d = y[I],
  55198. p = h.x + ":" + h.y + ":" + d,
  55199. void 0 === C[p]) {
  55200. s = t[d];
  55201. for (var _ = 0; _ < s.length; _++)
  55202. if (u = s[_],
  55203. i(c, _) && !n(h, u) && !a(h, u)) {
  55204. l = _,
  55205. y.splice(I, 1),
  55206. f = A.slice(0, c + 1),
  55207. g = A.slice(c),
  55208. m = s.slice(l),
  55209. v = s.slice(0, l + 1),
  55210. A = f.concat(m).concat(v).concat(g),
  55211. b = c;
  55212. break
  55213. }
  55214. if (l >= 0)
  55215. break;
  55216. C[p] = !0
  55217. }
  55218. if (l >= 0)
  55219. break
  55220. }
  55221. }
  55222. return A
  55223. }
  55224. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55225. Array.prototype.push.apply(f, t[g]);
  55226. for (s = 0,
  55227. l = f.length; s < l; s++)
  55228. u = f[s].x + ":" + f[s].y,
  55229. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55230. p[u] = s;
  55231. var v = a(e, t)
  55232. , A = n.ShapeUtils.triangulate(v, !1);
  55233. for (s = 0,
  55234. l = A.length; s < l; s++)
  55235. for (h = A[s],
  55236. c = 0; c < 3; c++)
  55237. u = h[c].x + ":" + h[c].y,
  55238. d = p[u],
  55239. void 0 !== d && (h[c] = d);
  55240. return A.concat()
  55241. },
  55242. isClockWise: function(e) {
  55243. return n.ShapeUtils.area(e) < 0
  55244. },
  55245. b2: function() {
  55246. function e(e, t) {
  55247. var i = 1 - e;
  55248. return i * i * t
  55249. }
  55250. function t(e, t) {
  55251. return 2 * (1 - e) * e * t
  55252. }
  55253. function i(e, t) {
  55254. return e * e * t
  55255. }
  55256. return function(n, r, o, a) {
  55257. return e(n, r) + t(n, o) + i(n, a)
  55258. }
  55259. }(),
  55260. b3: function() {
  55261. function e(e, t) {
  55262. var i = 1 - e;
  55263. return i * i * i * t
  55264. }
  55265. function t(e, t) {
  55266. var i = 1 - e;
  55267. return 3 * i * i * e * t
  55268. }
  55269. function i(e, t) {
  55270. var i = 1 - e;
  55271. return 3 * i * e * e * t
  55272. }
  55273. function n(e, t) {
  55274. return e * e * e * t
  55275. }
  55276. return function(r, o, a, s, l) {
  55277. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55278. }
  55279. }()
  55280. },
  55281. n.Curve = function() {}
  55282. ,
  55283. n.Curve.prototype = {
  55284. constructor: n.Curve,
  55285. getPoint: function(e) {
  55286. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55287. null
  55288. },
  55289. getPointAt: function(e) {
  55290. var t = this.getUtoTmapping(e);
  55291. return this.getPoint(t)
  55292. },
  55293. getPoints: function(e) {
  55294. e || (e = 5);
  55295. var t, i = [];
  55296. for (t = 0; t <= e; t++)
  55297. i.push(this.getPoint(t / e));
  55298. return i
  55299. },
  55300. getSpacedPoints: function(e) {
  55301. e || (e = 5);
  55302. var t, i = [];
  55303. for (t = 0; t <= e; t++)
  55304. i.push(this.getPointAt(t / e));
  55305. return i
  55306. },
  55307. getLength: function() {
  55308. var e = this.getLengths();
  55309. return e[e.length - 1]
  55310. },
  55311. getLengths: function(e) {
  55312. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55313. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55314. return this.cacheArcLengths;
  55315. this.needsUpdate = !1;
  55316. var t, i, n = [], r = this.getPoint(0), o = 0;
  55317. for (n.push(0),
  55318. i = 1; i <= e; i++)
  55319. t = this.getPoint(i / e),
  55320. o += t.distanceTo(r),
  55321. n.push(o),
  55322. r = t;
  55323. return this.cacheArcLengths = n,
  55324. n
  55325. },
  55326. updateArcLengths: function() {
  55327. this.needsUpdate = !0,
  55328. this.getLengths()
  55329. },
  55330. getUtoTmapping: function(e, t) {
  55331. var i, n = this.getLengths(), r = 0, o = n.length;
  55332. i = t ? t : e * n[o - 1];
  55333. for (var a, s = 0, l = o - 1; s <= l; )
  55334. if (r = Math.floor(s + (l - s) / 2),
  55335. a = n[r] - i,
  55336. a < 0)
  55337. s = r + 1;
  55338. else {
  55339. if (!(a > 0)) {
  55340. l = r;
  55341. break
  55342. }
  55343. l = r - 1
  55344. }
  55345. if (r = l,
  55346. n[r] === i) {
  55347. var c = r / (o - 1);
  55348. return c
  55349. }
  55350. var h = n[r]
  55351. , u = n[r + 1]
  55352. , d = u - h
  55353. , p = (i - h) / d
  55354. , c = (r + p) / (o - 1);
  55355. return c
  55356. },
  55357. getTangent: function(e) {
  55358. var t = 1e-4
  55359. , i = e - t
  55360. , n = e + t;
  55361. i < 0 && (i = 0),
  55362. n > 1 && (n = 1);
  55363. var r = this.getPoint(i)
  55364. , o = this.getPoint(n)
  55365. , a = o.clone().sub(r);
  55366. return a.normalize()
  55367. },
  55368. getTangentAt: function(e) {
  55369. var t = this.getUtoTmapping(e);
  55370. return this.getTangent(t)
  55371. }
  55372. },
  55373. n.Curve.create = function(e, t) {
  55374. return e.prototype = Object.create(n.Curve.prototype),
  55375. e.prototype.constructor = e,
  55376. e.prototype.getPoint = t,
  55377. e
  55378. }
  55379. ,
  55380. n.CurvePath = function() {
  55381. this.curves = [],
  55382. this.autoClose = !1
  55383. }
  55384. ,
  55385. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55386. n.CurvePath.prototype.constructor = n.CurvePath,
  55387. n.CurvePath.prototype.add = function(e) {
  55388. this.curves.push(e)
  55389. }
  55390. ,
  55391. n.CurvePath.prototype.closePath = function() {
  55392. var e = this.curves[0].getPoint(0)
  55393. , t = this.curves[this.curves.length - 1].getPoint(1);
  55394. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55395. }
  55396. ,
  55397. n.CurvePath.prototype.getPoint = function(e) {
  55398. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55399. if (i[n] >= t) {
  55400. var r = i[n] - t
  55401. , o = this.curves[n]
  55402. , a = 1 - r / o.getLength();
  55403. return o.getPointAt(a)
  55404. }
  55405. n++
  55406. }
  55407. return null
  55408. }
  55409. ,
  55410. n.CurvePath.prototype.getLength = function() {
  55411. var e = this.getCurveLengths();
  55412. return e[e.length - 1]
  55413. }
  55414. ,
  55415. n.CurvePath.prototype.getCurveLengths = function() {
  55416. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55417. return this.cacheLengths;
  55418. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55419. t += this.curves[i].getLength(),
  55420. e.push(t);
  55421. return this.cacheLengths = e,
  55422. e
  55423. }
  55424. ,
  55425. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55426. var t = this.getPoints(e);
  55427. return this.createGeometry(t)
  55428. }
  55429. ,
  55430. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55431. var t = this.getSpacedPoints(e);
  55432. return this.createGeometry(t)
  55433. }
  55434. ,
  55435. n.CurvePath.prototype.createGeometry = function(e) {
  55436. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55437. var o = e[i];
  55438. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55439. }
  55440. return t
  55441. }
  55442. ,
  55443. n.Font = function(e) {
  55444. this.data = e
  55445. }
  55446. ,
  55447. n.Font.prototype = {
  55448. constructor: n.Font,
  55449. generateShapes: function(e, t, i) {
  55450. function r(e) {
  55451. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55452. var c = o(i[l], n, r);
  55453. r += c.offset,
  55454. s.push(c.path)
  55455. }
  55456. return s
  55457. }
  55458. function o(e, t, r) {
  55459. var o = a.glyphs[e] || a.glyphs["?"];
  55460. if (o) {
  55461. 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;
  55462. if (o.o)
  55463. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55464. var _ = E[b++];
  55465. switch (_) {
  55466. case "m":
  55467. s = E[b++] * t + r,
  55468. l = E[b++] * t,
  55469. A.moveTo(s, l);
  55470. break;
  55471. case "l":
  55472. s = E[b++] * t + r,
  55473. l = E[b++] * t,
  55474. A.lineTo(s, l);
  55475. break;
  55476. case "q":
  55477. if (c = E[b++] * t + r,
  55478. h = E[b++] * t,
  55479. p = E[b++] * t + r,
  55480. f = E[b++] * t,
  55481. A.quadraticCurveTo(p, f, c, h),
  55482. v = y[y.length - 1]) {
  55483. u = v.x,
  55484. d = v.y;
  55485. for (var T = 1; T <= i; T++) {
  55486. var x = T / i;
  55487. C(x, u, p, c),
  55488. C(x, d, f, h)
  55489. }
  55490. }
  55491. break;
  55492. case "b":
  55493. if (c = E[b++] * t + r,
  55494. h = E[b++] * t,
  55495. p = E[b++] * t + r,
  55496. f = E[b++] * t,
  55497. g = E[b++] * t + r,
  55498. m = E[b++] * t,
  55499. A.bezierCurveTo(p, f, g, m, c, h),
  55500. v = y[y.length - 1]) {
  55501. u = v.x,
  55502. d = v.y;
  55503. for (var T = 1; T <= i; T++) {
  55504. var x = T / i;
  55505. I(x, u, p, g, c),
  55506. I(x, d, f, m, h)
  55507. }
  55508. }
  55509. }
  55510. }
  55511. return {
  55512. offset: o.ha * t,
  55513. path: A
  55514. }
  55515. }
  55516. }
  55517. void 0 === t && (t = 100),
  55518. void 0 === i && (i = 4);
  55519. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55520. Array.prototype.push.apply(l, s[c].toShapes());
  55521. return l
  55522. }
  55523. },
  55524. n.Path = function(e) {
  55525. n.CurvePath.call(this),
  55526. this.actions = [],
  55527. e && this.fromPoints(e)
  55528. }
  55529. ,
  55530. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55531. n.Path.prototype.constructor = n.Path,
  55532. n.Path.prototype.fromPoints = function(e) {
  55533. this.moveTo(e[0].x, e[0].y);
  55534. for (var t = 1, i = e.length; t < i; t++)
  55535. this.lineTo(e[t].x, e[t].y)
  55536. }
  55537. ,
  55538. n.Path.prototype.moveTo = function(e, t) {
  55539. this.actions.push({
  55540. action: "moveTo",
  55541. args: [e, t]
  55542. })
  55543. }
  55544. ,
  55545. n.Path.prototype.lineTo = function(e, t) {
  55546. var i = this.actions[this.actions.length - 1].args
  55547. , r = i[i.length - 2]
  55548. , o = i[i.length - 1]
  55549. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55550. this.curves.push(a),
  55551. this.actions.push({
  55552. action: "lineTo",
  55553. args: [e, t]
  55554. })
  55555. }
  55556. ,
  55557. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55558. var o = this.actions[this.actions.length - 1].args
  55559. , a = o[o.length - 2]
  55560. , s = o[o.length - 1]
  55561. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55562. this.curves.push(l),
  55563. this.actions.push({
  55564. action: "quadraticCurveTo",
  55565. args: [e, t, i, r]
  55566. })
  55567. }
  55568. ,
  55569. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55570. var s = this.actions[this.actions.length - 1].args
  55571. , l = s[s.length - 2]
  55572. , c = s[s.length - 1]
  55573. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55574. this.curves.push(h),
  55575. this.actions.push({
  55576. action: "bezierCurveTo",
  55577. args: [e, t, i, r, o, a]
  55578. })
  55579. }
  55580. ,
  55581. n.Path.prototype.splineThru = function(e) {
  55582. var t = Array.prototype.slice.call(arguments)
  55583. , i = this.actions[this.actions.length - 1].args
  55584. , r = i[i.length - 2]
  55585. , o = i[i.length - 1]
  55586. , a = [new n.Vector2(r,o)];
  55587. Array.prototype.push.apply(a, e);
  55588. var s = new n.SplineCurve(a);
  55589. this.curves.push(s),
  55590. this.actions.push({
  55591. action: "splineThru",
  55592. args: t
  55593. })
  55594. }
  55595. ,
  55596. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55597. var a = this.actions[this.actions.length - 1].args
  55598. , s = a[a.length - 2]
  55599. , l = a[a.length - 1];
  55600. this.absarc(e + s, t + l, i, n, r, o)
  55601. }
  55602. ,
  55603. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55604. this.absellipse(e, t, i, i, n, r, o)
  55605. }
  55606. ,
  55607. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55608. var l = this.actions[this.actions.length - 1].args
  55609. , c = l[l.length - 2]
  55610. , h = l[l.length - 1];
  55611. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55612. }
  55613. ,
  55614. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55615. var c = [e, t, i, r, o, a, s, l || 0]
  55616. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55617. this.curves.push(h);
  55618. var u = h.getPoint(1);
  55619. c.push(u.x),
  55620. c.push(u.y),
  55621. this.actions.push({
  55622. action: "ellipse",
  55623. args: c
  55624. })
  55625. }
  55626. ,
  55627. n.Path.prototype.getSpacedPoints = function(e) {
  55628. e || (e = 40);
  55629. for (var t = [], i = 0; i < e; i++)
  55630. t.push(this.getPoint(i / e));
  55631. return this.autoClose && t.push(t[0]),
  55632. t
  55633. }
  55634. ,
  55635. n.Path.prototype.getPoints = function(e) {
  55636. e = e || 12;
  55637. 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++) {
  55638. var A = this.actions[m]
  55639. , y = A.action
  55640. , C = A.args;
  55641. switch (y) {
  55642. case "moveTo":
  55643. g.push(new n.Vector2(C[0],C[1]));
  55644. break;
  55645. case "lineTo":
  55646. g.push(new n.Vector2(C[0],C[1]));
  55647. break;
  55648. case "quadraticCurveTo":
  55649. t = C[2],
  55650. i = C[3],
  55651. a = C[0],
  55652. s = C[1],
  55653. g.length > 0 ? (h = g[g.length - 1],
  55654. l = h.x,
  55655. c = h.y) : (h = this.actions[m - 1].args,
  55656. l = h[h.length - 2],
  55657. c = h[h.length - 1]);
  55658. for (var I = 1; I <= e; I++) {
  55659. var E = I / e;
  55660. u = p(E, l, a, t),
  55661. d = p(E, c, s, i),
  55662. g.push(new n.Vector2(u,d))
  55663. }
  55664. break;
  55665. case "bezierCurveTo":
  55666. t = C[4],
  55667. i = C[5],
  55668. a = C[0],
  55669. s = C[1],
  55670. r = C[2],
  55671. o = C[3],
  55672. g.length > 0 ? (h = g[g.length - 1],
  55673. l = h.x,
  55674. c = h.y) : (h = this.actions[m - 1].args,
  55675. l = h[h.length - 2],
  55676. c = h[h.length - 1]);
  55677. for (var I = 1; I <= e; I++) {
  55678. var E = I / e;
  55679. u = f(E, l, a, r, t),
  55680. d = f(E, c, s, o, i),
  55681. g.push(new n.Vector2(u,d))
  55682. }
  55683. break;
  55684. case "splineThru":
  55685. h = this.actions[m - 1].args;
  55686. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55687. , w = [b]
  55688. , _ = e * C[0].length;
  55689. w = w.concat(C[0]);
  55690. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55691. g.push(T.getPointAt(I / _));
  55692. break;
  55693. case "arc":
  55694. 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++) {
  55695. var E = I / N;
  55696. L || (E = 1 - E),
  55697. x = P + E * D,
  55698. u = S + R * Math.cos(x),
  55699. d = M + R * Math.sin(x),
  55700. g.push(new n.Vector2(u,d))
  55701. }
  55702. break;
  55703. case "ellipse":
  55704. 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;
  55705. 0 !== k && (B = Math.cos(k),
  55706. F = Math.sin(k));
  55707. for (var I = 1; I <= N; I++) {
  55708. var E = I / N;
  55709. if (L || (E = 1 - E),
  55710. x = P + E * D,
  55711. u = S + V * Math.cos(x),
  55712. d = M + U * Math.sin(x),
  55713. 0 !== k) {
  55714. var H = u
  55715. , G = d;
  55716. u = (H - S) * B - (G - M) * F + S,
  55717. d = (H - S) * F + (G - M) * B + M
  55718. }
  55719. g.push(new n.Vector2(u,d))
  55720. }
  55721. }
  55722. }
  55723. var z = g[g.length - 1];
  55724. 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),
  55725. this.autoClose && g.push(g[0]),
  55726. g
  55727. }
  55728. ,
  55729. n.Path.prototype.toShapes = function(e, t) {
  55730. function i(e) {
  55731. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55732. var a = e[r]
  55733. , s = a.args
  55734. , l = a.action;
  55735. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55736. i = new n.Path),
  55737. i[l].apply(i, s)
  55738. }
  55739. return 0 !== i.actions.length && t.push(i),
  55740. t
  55741. }
  55742. function r(e) {
  55743. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55744. var o = e[i]
  55745. , a = new n.Shape;
  55746. a.actions = o.actions,
  55747. a.curves = o.curves,
  55748. t.push(a)
  55749. }
  55750. return t
  55751. }
  55752. function o(e, t) {
  55753. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55754. var a = t[r]
  55755. , s = t[o]
  55756. , l = s.x - a.x
  55757. , c = s.y - a.y;
  55758. if (Math.abs(c) > Number.EPSILON) {
  55759. if (c < 0 && (a = t[o],
  55760. l = -l,
  55761. s = t[r],
  55762. c = -c),
  55763. e.y < a.y || e.y > s.y)
  55764. continue;
  55765. if (e.y === a.y) {
  55766. if (e.x === a.x)
  55767. return !0
  55768. } else {
  55769. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55770. if (0 === h)
  55771. return !0;
  55772. if (h < 0)
  55773. continue;
  55774. n = !n
  55775. }
  55776. } else {
  55777. if (e.y !== a.y)
  55778. continue;
  55779. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55780. return !0
  55781. }
  55782. }
  55783. return n
  55784. }
  55785. var a = n.ShapeUtils.isClockWise
  55786. , s = i(this.actions);
  55787. if (0 === s.length)
  55788. return [];
  55789. if (t === !0)
  55790. return r(s);
  55791. var l, c, h, u = [];
  55792. if (1 === s.length)
  55793. return c = s[0],
  55794. h = new n.Shape,
  55795. h.actions = c.actions,
  55796. h.curves = c.curves,
  55797. u.push(h),
  55798. u;
  55799. var d = !a(s[0].getPoints());
  55800. d = e ? !d : d;
  55801. var p, f = [], g = [], m = [], v = 0;
  55802. g[v] = void 0,
  55803. m[v] = [];
  55804. for (var A = 0, y = s.length; A < y; A++)
  55805. c = s[A],
  55806. p = c.getPoints(),
  55807. l = a(p),
  55808. l = e ? !l : l,
  55809. l ? (!d && g[v] && v++,
  55810. g[v] = {
  55811. s: new n.Shape,
  55812. p: p
  55813. },
  55814. g[v].s.actions = c.actions,
  55815. g[v].s.curves = c.curves,
  55816. d && v++,
  55817. m[v] = []) : m[v].push({
  55818. h: c,
  55819. p: p[0]
  55820. });
  55821. if (!g[0])
  55822. return r(s);
  55823. if (g.length > 1) {
  55824. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55825. f[E] = [];
  55826. for (var E = 0, b = g.length; E < b; E++)
  55827. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55828. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55829. o(T.p, g[S].p) && (E !== S && I.push({
  55830. froms: E,
  55831. tos: S,
  55832. hole: _
  55833. }),
  55834. x ? (x = !1,
  55835. f[S].push(T)) : C = !0);
  55836. x && f[E].push(T)
  55837. }
  55838. I.length > 0 && (C || (m = f))
  55839. }
  55840. for (var M, A = 0, R = g.length; A < R; A++) {
  55841. h = g[A].s,
  55842. u.push(h),
  55843. M = m[A];
  55844. for (var P = 0, O = M.length; P < O; P++)
  55845. h.holes.push(M[P].h)
  55846. }
  55847. return u
  55848. }
  55849. ,
  55850. n.Shape = function() {
  55851. n.Path.apply(this, arguments),
  55852. this.holes = []
  55853. }
  55854. ,
  55855. n.Shape.prototype = Object.create(n.Path.prototype),
  55856. n.Shape.prototype.constructor = n.Shape,
  55857. n.Shape.prototype.extrude = function(e) {
  55858. return new n.ExtrudeGeometry(this,e)
  55859. }
  55860. ,
  55861. n.Shape.prototype.makeGeometry = function(e) {
  55862. return new n.ShapeGeometry(this,e)
  55863. }
  55864. ,
  55865. n.Shape.prototype.getPointsHoles = function(e) {
  55866. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55867. t[i] = this.holes[i].getPoints(e);
  55868. return t
  55869. }
  55870. ,
  55871. n.Shape.prototype.extractAllPoints = function(e) {
  55872. return {
  55873. shape: this.getPoints(e),
  55874. holes: this.getPointsHoles(e)
  55875. }
  55876. }
  55877. ,
  55878. n.Shape.prototype.extractPoints = function(e) {
  55879. return this.extractAllPoints(e)
  55880. }
  55881. ,
  55882. n.LineCurve = function(e, t) {
  55883. this.v1 = e,
  55884. this.v2 = t
  55885. }
  55886. ,
  55887. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55888. n.LineCurve.prototype.constructor = n.LineCurve,
  55889. n.LineCurve.prototype.getPoint = function(e) {
  55890. var t = this.v2.clone().sub(this.v1);
  55891. return t.multiplyScalar(e).add(this.v1),
  55892. t
  55893. }
  55894. ,
  55895. n.LineCurve.prototype.getPointAt = function(e) {
  55896. return this.getPoint(e)
  55897. }
  55898. ,
  55899. n.LineCurve.prototype.getTangent = function(e) {
  55900. var t = this.v2.clone().sub(this.v1);
  55901. return t.normalize()
  55902. }
  55903. ,
  55904. n.QuadraticBezierCurve = function(e, t, i) {
  55905. this.v0 = e,
  55906. this.v1 = t,
  55907. this.v2 = i
  55908. }
  55909. ,
  55910. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55911. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55912. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55913. var t = n.ShapeUtils.b2;
  55914. 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))
  55915. }
  55916. ,
  55917. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55918. var t = n.CurveUtils.tangentQuadraticBezier;
  55919. 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()
  55920. }
  55921. ,
  55922. n.CubicBezierCurve = function(e, t, i, n) {
  55923. this.v0 = e,
  55924. this.v1 = t,
  55925. this.v2 = i,
  55926. this.v3 = n
  55927. }
  55928. ,
  55929. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55930. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55931. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55932. var t = n.ShapeUtils.b3;
  55933. 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))
  55934. }
  55935. ,
  55936. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55937. var t = n.CurveUtils.tangentCubicBezier;
  55938. 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()
  55939. }
  55940. ,
  55941. n.SplineCurve = function(e) {
  55942. this.points = void 0 == e ? [] : e
  55943. }
  55944. ,
  55945. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55946. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55947. n.SplineCurve.prototype.getPoint = function(e) {
  55948. var t = this.points
  55949. , i = (t.length - 1) * e
  55950. , r = Math.floor(i)
  55951. , o = i - r
  55952. , a = t[0 === r ? r : r - 1]
  55953. , s = t[r]
  55954. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55955. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55956. , h = n.CurveUtils.interpolate;
  55957. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55958. }
  55959. ,
  55960. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55961. this.aX = e,
  55962. this.aY = t,
  55963. this.xRadius = i,
  55964. this.yRadius = n,
  55965. this.aStartAngle = r,
  55966. this.aEndAngle = o,
  55967. this.aClockwise = a,
  55968. this.aRotation = s || 0
  55969. }
  55970. ,
  55971. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55972. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55973. n.EllipseCurve.prototype.getPoint = function(e) {
  55974. var t = this.aEndAngle - this.aStartAngle;
  55975. t < 0 && (t += 2 * Math.PI),
  55976. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55977. var i;
  55978. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55979. var r = this.aX + this.xRadius * Math.cos(i)
  55980. , o = this.aY + this.yRadius * Math.sin(i);
  55981. if (0 !== this.aRotation) {
  55982. var a = Math.cos(this.aRotation)
  55983. , s = Math.sin(this.aRotation)
  55984. , l = r
  55985. , c = o;
  55986. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55987. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55988. }
  55989. return new n.Vector2(r,o)
  55990. }
  55991. ,
  55992. n.ArcCurve = function(e, t, i, r, o, a) {
  55993. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55994. }
  55995. ,
  55996. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55997. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55998. n.LineCurve3 = n.Curve.create(function(e, t) {
  55999. this.v1 = e,
  56000. this.v2 = t
  56001. }, function(e) {
  56002. var t = new n.Vector3;
  56003. return t.subVectors(this.v2, this.v1),
  56004. t.multiplyScalar(e),
  56005. t.add(this.v1),
  56006. t
  56007. }),
  56008. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56009. this.v0 = e,
  56010. this.v1 = t,
  56011. this.v2 = i
  56012. }, function(e) {
  56013. var t = n.ShapeUtils.b2;
  56014. 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))
  56015. }),
  56016. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56017. this.v0 = e,
  56018. this.v1 = t,
  56019. this.v2 = i,
  56020. this.v3 = n
  56021. }, function(e) {
  56022. var t = n.ShapeUtils.b3;
  56023. 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))
  56024. }),
  56025. n.SplineCurve3 = n.Curve.create(function(e) {
  56026. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56027. this.points = void 0 == e ? [] : e
  56028. }, function(e) {
  56029. var t = this.points
  56030. , i = (t.length - 1) * e
  56031. , r = Math.floor(i)
  56032. , o = i - r
  56033. , a = t[0 == r ? r : r - 1]
  56034. , s = t[r]
  56035. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56036. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56037. , h = n.CurveUtils.interpolate;
  56038. 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))
  56039. }),
  56040. n.CatmullRomCurve3 = function() {
  56041. function e() {}
  56042. var t = new n.Vector3
  56043. , i = new e
  56044. , r = new e
  56045. , o = new e;
  56046. return e.prototype.init = function(e, t, i, n) {
  56047. this.c0 = e,
  56048. this.c1 = i,
  56049. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56050. this.c3 = 2 * e - 2 * t + i + n
  56051. }
  56052. ,
  56053. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56054. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56055. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56056. s *= o,
  56057. l *= o,
  56058. this.init(t, i, s, l)
  56059. }
  56060. ,
  56061. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56062. this.init(t, i, r * (i - e), r * (n - t))
  56063. }
  56064. ,
  56065. e.prototype.calc = function(e) {
  56066. var t = e * e
  56067. , i = t * e;
  56068. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56069. }
  56070. ,
  56071. n.Curve.create(function(e) {
  56072. this.points = e || [],
  56073. this.closed = !1
  56074. }, function(e) {
  56075. var a, s, l, c, h = this.points;
  56076. c = h.length,
  56077. c < 2 && console.log("duh, you need at least 2 points"),
  56078. a = (c - (this.closed ? 0 : 1)) * e,
  56079. s = Math.floor(a),
  56080. l = a - s,
  56081. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56082. l = 1);
  56083. var u, d, p, f;
  56084. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56085. u = t),
  56086. d = h[s % c],
  56087. p = h[(s + 1) % c],
  56088. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56089. f = t),
  56090. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56091. var g = "chordal" === this.type ? .5 : .25
  56092. , m = Math.pow(u.distanceToSquared(d), g)
  56093. , v = Math.pow(d.distanceToSquared(p), g)
  56094. , A = Math.pow(p.distanceToSquared(f), g);
  56095. v < 1e-4 && (v = 1),
  56096. m < 1e-4 && (m = v),
  56097. A < 1e-4 && (A = v),
  56098. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56099. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56100. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56101. } else if ("catmullrom" === this.type) {
  56102. var y = void 0 !== this.tension ? this.tension : .5;
  56103. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56104. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56105. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56106. }
  56107. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56108. return C
  56109. })
  56110. }(),
  56111. n.ClosedSplineCurve3 = function(e) {
  56112. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56113. n.CatmullRomCurve3.call(this, e),
  56114. this.type = "catmullrom",
  56115. this.closed = !0
  56116. }
  56117. ,
  56118. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56119. n.BoxGeometry = function(e, t, i, r, o, a) {
  56120. n.Geometry.call(this),
  56121. this.type = "BoxGeometry",
  56122. this.parameters = {
  56123. width: e,
  56124. height: t,
  56125. depth: i,
  56126. widthSegments: r,
  56127. heightSegments: o,
  56128. depthSegments: a
  56129. },
  56130. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56131. this.mergeVertices()
  56132. }
  56133. ,
  56134. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56135. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56136. n.CubeGeometry = n.BoxGeometry,
  56137. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56138. function s(e, t, i) {
  56139. var n = 0;
  56140. return n += e * t * 2,
  56141. n += e * i * 2,
  56142. n += i * t * 2,
  56143. 4 * n
  56144. }
  56145. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56146. 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++)
  56147. for (var L = O * b - _, D = 0; D < x; D++) {
  56148. var N = D * E - w;
  56149. P[e] = N * r,
  56150. P[t] = L * o,
  56151. P[i] = T,
  56152. p[m] = P.x,
  56153. p[m + 1] = P.y,
  56154. p[m + 2] = P.z,
  56155. P[e] = 0,
  56156. P[t] = 0,
  56157. P[i] = l > 0 ? 1 : -1,
  56158. f[m] = P.x,
  56159. f[m + 1] = P.y,
  56160. f[m + 2] = P.z,
  56161. g[v] = D / h,
  56162. g[v + 1] = 1 - O / u,
  56163. m += 3,
  56164. v += 2,
  56165. M += 1
  56166. }
  56167. for (O = 0; O < u; O++)
  56168. for (D = 0; D < h; D++) {
  56169. var B = y + D + x * O
  56170. , F = y + D + x * (O + 1)
  56171. , V = y + (D + 1) + x * (O + 1)
  56172. , U = y + (D + 1) + x * O;
  56173. d[A] = B,
  56174. d[A + 1] = F,
  56175. d[A + 2] = U,
  56176. d[A + 3] = F,
  56177. d[A + 4] = V,
  56178. d[A + 5] = U,
  56179. A += 6,
  56180. R += 6
  56181. }
  56182. c.addGroup(C, R, I),
  56183. C += R,
  56184. y += M
  56185. }
  56186. n.BufferGeometry.call(this),
  56187. this.type = "BoxBufferGeometry",
  56188. this.parameters = {
  56189. width: e,
  56190. height: t,
  56191. depth: i,
  56192. widthSegments: r,
  56193. heightSegments: o,
  56194. depthSegments: a
  56195. };
  56196. var c = this;
  56197. r = Math.floor(r) || 1,
  56198. o = Math.floor(o) || 1,
  56199. a = Math.floor(a) || 1;
  56200. var h = s(r, o, a)
  56201. , u = h / 4 * 6
  56202. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56203. , p = new Float32Array(3 * h)
  56204. , f = new Float32Array(3 * h)
  56205. , g = new Float32Array(2 * h)
  56206. , m = 0
  56207. , v = 0
  56208. , A = 0
  56209. , y = 0
  56210. , C = 0;
  56211. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56212. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56213. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56214. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56215. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56216. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56217. this.setIndex(new n.BufferAttribute(d,1)),
  56218. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56219. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56220. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56221. }
  56222. ,
  56223. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56224. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56225. n.CircleGeometry = function(e, t, i, r) {
  56226. n.Geometry.call(this),
  56227. this.type = "CircleGeometry",
  56228. this.parameters = {
  56229. radius: e,
  56230. segments: t,
  56231. thetaStart: i,
  56232. thetaLength: r
  56233. },
  56234. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56235. }
  56236. ,
  56237. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56238. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56239. n.CircleBufferGeometry = function(e, t, i, r) {
  56240. n.BufferGeometry.call(this),
  56241. this.type = "CircleBufferGeometry",
  56242. this.parameters = {
  56243. radius: e,
  56244. segments: t,
  56245. thetaStart: i,
  56246. thetaLength: r
  56247. },
  56248. e = e || 50,
  56249. t = void 0 !== t ? Math.max(3, t) : 8,
  56250. i = void 0 !== i ? i : 0,
  56251. r = void 0 !== r ? r : 2 * Math.PI;
  56252. var o = t + 2
  56253. , a = new Float32Array(3 * o)
  56254. , s = new Float32Array(3 * o)
  56255. , l = new Float32Array(2 * o);
  56256. s[2] = 1,
  56257. l[0] = .5,
  56258. l[1] = .5;
  56259. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56260. h += 3,
  56261. u += 2) {
  56262. var d = i + c / t * r;
  56263. a[h] = e * Math.cos(d),
  56264. a[h + 1] = e * Math.sin(d),
  56265. s[h + 2] = 1,
  56266. l[u] = (a[h] / e + 1) / 2,
  56267. l[u + 1] = (a[h + 1] / e + 1) / 2
  56268. }
  56269. for (var p = [], h = 1; h <= t; h++)
  56270. p.push(h, h + 1, 0);
  56271. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56272. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56273. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56274. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56275. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56276. }
  56277. ,
  56278. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56279. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56280. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56281. function c() {
  56282. var e = (r + 1) * (o + 1);
  56283. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56284. e
  56285. }
  56286. function h() {
  56287. var e = r * o * 2 * 3;
  56288. return a === !1 && (e += 2 * r * 3),
  56289. e
  56290. }
  56291. function u() {
  56292. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56293. for (c = 0; c <= o; c++) {
  56294. var p = []
  56295. , f = c / o
  56296. , b = f * (t - e) + e;
  56297. for (a = 0; a <= r; a++) {
  56298. var w = a / r;
  56299. u.x = b * Math.sin(w * l + s),
  56300. u.y = -f * i + E,
  56301. u.z = b * Math.cos(w * l + s),
  56302. m.setXYZ(y, u.x, u.y, u.z),
  56303. h.copy(u),
  56304. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56305. h.z = Math.cos(w * l + s)),
  56306. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56307. v.setXYZ(y, h.x, h.y, h.z),
  56308. A.setXY(y, w, 1 - f),
  56309. p.push(y),
  56310. y++
  56311. }
  56312. I.push(p)
  56313. }
  56314. for (a = 0; a < r; a++)
  56315. for (c = 0; c < o; c++) {
  56316. var _ = I[c][a]
  56317. , T = I[c + 1][a]
  56318. , x = I[c + 1][a + 1]
  56319. , S = I[c][a + 1];
  56320. g.setX(C, _),
  56321. C++,
  56322. g.setX(C, T),
  56323. C++,
  56324. g.setX(C, S),
  56325. C++,
  56326. g.setX(C, T),
  56327. C++,
  56328. g.setX(C, x),
  56329. C++,
  56330. g.setX(C, S),
  56331. C++
  56332. }
  56333. }
  56334. function d(i) {
  56335. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56336. for (a = y,
  56337. o = 1; o <= r; o++)
  56338. m.setXYZ(y, 0, E * p, 0),
  56339. v.setXYZ(y, 0, p, 0),
  56340. i === !0 ? (h.x = o / r,
  56341. h.y = 0) : (h.x = (o - 1) / r,
  56342. h.y = 1),
  56343. A.setXY(y, h.x, h.y),
  56344. y++;
  56345. for (c = y,
  56346. o = 0; o <= r; o++) {
  56347. var f = o / r;
  56348. u.x = d * Math.sin(f * l + s),
  56349. u.y = E * p,
  56350. u.z = d * Math.cos(f * l + s),
  56351. m.setXYZ(y, u.x, u.y, u.z),
  56352. v.setXYZ(y, 0, p, 0),
  56353. A.setXY(y, f, i === !0 ? 1 : 0),
  56354. y++
  56355. }
  56356. for (o = 0; o < r; o++) {
  56357. var I = a + o
  56358. , b = c + o;
  56359. i === !0 ? (g.setX(C, b),
  56360. C++,
  56361. g.setX(C, b + 1),
  56362. C++,
  56363. g.setX(C, I),
  56364. C++) : (g.setX(C, b + 1),
  56365. C++,
  56366. g.setX(C, b),
  56367. C++,
  56368. g.setX(C, I),
  56369. C++)
  56370. }
  56371. }
  56372. n.BufferGeometry.call(this),
  56373. this.type = "CylinderBufferGeometry",
  56374. this.parameters = {
  56375. radiusTop: e,
  56376. radiusBottom: t,
  56377. height: i,
  56378. radialSegments: r,
  56379. heightSegments: o,
  56380. openEnded: a,
  56381. thetaStart: s,
  56382. thetaLength: l
  56383. },
  56384. e = void 0 !== e ? e : 20,
  56385. t = void 0 !== t ? t : 20,
  56386. i = void 0 !== i ? i : 100,
  56387. r = Math.floor(r) || 8,
  56388. o = Math.floor(o) || 1,
  56389. a = void 0 !== a && a,
  56390. s = void 0 !== s ? s : 0,
  56391. l = void 0 !== l ? l : 2 * Math.PI;
  56392. var p = c()
  56393. , f = h()
  56394. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56395. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56396. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56397. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56398. , y = 0
  56399. , C = 0
  56400. , I = []
  56401. , E = i / 2;
  56402. u(),
  56403. a === !1 && (e > 0 && d(!0),
  56404. t > 0 && d(!1)),
  56405. this.setIndex(g),
  56406. this.addAttribute("position", m),
  56407. this.addAttribute("normal", v),
  56408. this.addAttribute("uv", A)
  56409. }
  56410. ,
  56411. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56412. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56413. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56414. n.Geometry.call(this),
  56415. this.type = "CylinderGeometry",
  56416. this.parameters = {
  56417. radiusTop: e,
  56418. radiusBottom: t,
  56419. height: i,
  56420. radialSegments: r,
  56421. heightSegments: o,
  56422. openEnded: a,
  56423. thetaStart: s,
  56424. thetaLength: l
  56425. },
  56426. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56427. this.mergeVertices()
  56428. }
  56429. ,
  56430. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56431. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56432. n.EdgesGeometry = function(e, t) {
  56433. function i(e, t) {
  56434. return e - t
  56435. }
  56436. n.BufferGeometry.call(this),
  56437. t = void 0 !== t ? t : 1;
  56438. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56439. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56440. r.fromBufferGeometry(e)) : r = e.clone(),
  56441. r.mergeVertices(),
  56442. r.computeFaceNormals();
  56443. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56444. for (var p = h[u], f = 0; f < 3; f++) {
  56445. a[0] = p[l[f]],
  56446. a[1] = p[l[(f + 1) % 3]],
  56447. a.sort(i);
  56448. var g = a.toString();
  56449. void 0 === s[g] ? s[g] = {
  56450. vert1: a[0],
  56451. vert2: a[1],
  56452. face1: u,
  56453. face2: void 0
  56454. } : s[g].face2 = u
  56455. }
  56456. var m = [];
  56457. for (var g in s) {
  56458. var v = s[g];
  56459. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56460. var A = c[v.vert1];
  56461. m.push(A.x),
  56462. m.push(A.y),
  56463. m.push(A.z),
  56464. A = c[v.vert2],
  56465. m.push(A.x),
  56466. m.push(A.y),
  56467. m.push(A.z)
  56468. }
  56469. }
  56470. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56471. }
  56472. ,
  56473. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56474. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56475. n.ExtrudeGeometry = function(e, t) {
  56476. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56477. this.type = "ExtrudeGeometry",
  56478. e = Array.isArray(e) ? e : [e],
  56479. this.addShapeList(e, t),
  56480. void this.computeFaceNormals())
  56481. }
  56482. ;
  56483. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56484. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56485. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56486. for (var i = e.length, n = 0; n < i; n++) {
  56487. var r = e[n];
  56488. this.addShape(r, t)
  56489. }
  56490. }
  56491. ,
  56492. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56493. function i(e, t, i) {
  56494. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56495. t.clone().multiplyScalar(i).add(e)
  56496. }
  56497. function r(e, t, i) {
  56498. 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;
  56499. if (Math.abs(d) > Number.EPSILON) {
  56500. var p = Math.sqrt(u)
  56501. , f = Math.sqrt(c * c + h * h)
  56502. , g = t.x - l / p
  56503. , m = t.y + s / p
  56504. , v = i.x - h / f
  56505. , A = i.y + c / f
  56506. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56507. r = g + s * y - e.x,
  56508. o = m + l * y - e.y;
  56509. var C = r * r + o * o;
  56510. if (C <= 2)
  56511. return new n.Vector2(r,o);
  56512. a = Math.sqrt(C / 2)
  56513. } else {
  56514. var I = !1;
  56515. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56516. I ? (r = -l,
  56517. o = s,
  56518. a = Math.sqrt(u)) : (r = s,
  56519. o = l,
  56520. a = Math.sqrt(u / 2))
  56521. }
  56522. return new n.Vector2(r / a,o / a)
  56523. }
  56524. function o() {
  56525. if (C) {
  56526. var e = 0
  56527. , t = z * e;
  56528. for (Y = 0; Y < W; Y++)
  56529. G = N[Y],
  56530. c(G[2] + t, G[1] + t, G[0] + t);
  56531. for (e = E + 2 * y,
  56532. t = z * e,
  56533. Y = 0; Y < W; Y++)
  56534. G = N[Y],
  56535. c(G[0] + t, G[1] + t, G[2] + t)
  56536. } else {
  56537. for (Y = 0; Y < W; Y++)
  56538. G = N[Y],
  56539. c(G[2], G[1], G[0]);
  56540. for (Y = 0; Y < W; Y++)
  56541. G = N[Y],
  56542. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56543. }
  56544. }
  56545. function a() {
  56546. var e = 0;
  56547. for (s(B, e),
  56548. e += B.length,
  56549. x = 0,
  56550. S = L.length; x < S; x++)
  56551. T = L[x],
  56552. s(T, e),
  56553. e += T.length
  56554. }
  56555. function s(e, t) {
  56556. var i, n;
  56557. for (Y = e.length; --Y >= 0; ) {
  56558. i = Y,
  56559. n = Y - 1,
  56560. n < 0 && (n = e.length - 1);
  56561. var r = 0
  56562. , o = E + 2 * y;
  56563. for (r = 0; r < o; r++) {
  56564. var a = z * r
  56565. , s = z * (r + 1)
  56566. , l = t + i + a
  56567. , c = t + n + a
  56568. , u = t + n + s
  56569. , d = t + i + s;
  56570. h(l, c, u, d, e, r, o, i, n)
  56571. }
  56572. }
  56573. }
  56574. function l(e, t, i) {
  56575. M.vertices.push(new n.Vector3(e,t,i))
  56576. }
  56577. function c(e, t, i) {
  56578. e += R,
  56579. t += R,
  56580. i += R,
  56581. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56582. var r = _.generateTopUV(M, e, t, i);
  56583. M.faceVertexUvs[0].push(r)
  56584. }
  56585. function h(e, t, i, r, o, a, s, l, c) {
  56586. e += R,
  56587. t += R,
  56588. i += R,
  56589. r += R,
  56590. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56591. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56592. var h = _.generateSideWallUV(M, e, t, i, r);
  56593. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56594. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56595. }
  56596. 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;
  56597. b && (u = b.getSpacedPoints(E),
  56598. w = !0,
  56599. C = !1,
  56600. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56601. p = new n.Vector3,
  56602. f = new n.Vector3,
  56603. g = new n.Vector3),
  56604. C || (y = 0,
  56605. v = 0,
  56606. A = 0);
  56607. 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);
  56608. if (D) {
  56609. for (O = O.reverse(),
  56610. x = 0,
  56611. S = L.length; x < S; x++)
  56612. T = L[x],
  56613. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56614. D = !1
  56615. }
  56616. var N = n.ShapeUtils.triangulateShape(O, L)
  56617. , B = O;
  56618. for (x = 0,
  56619. S = L.length; x < S; x++)
  56620. T = L[x],
  56621. O = O.concat(T);
  56622. 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++,
  56623. Z++,
  56624. q++)
  56625. Z === X && (Z = 0),
  56626. q === X && (q = 0),
  56627. j[Y] = r(B[Y], B[Z], B[q]);
  56628. var K, Q = [], J = j.concat();
  56629. for (x = 0,
  56630. S = L.length; x < S; x++) {
  56631. for (T = L[x],
  56632. K = [],
  56633. Y = 0,
  56634. X = T.length,
  56635. Z = X - 1,
  56636. q = Y + 1; Y < X; Y++,
  56637. Z++,
  56638. q++)
  56639. Z === X && (Z = 0),
  56640. q === X && (q = 0),
  56641. K[Y] = r(T[Y], T[Z], T[q]);
  56642. Q.push(K),
  56643. J = J.concat(K)
  56644. }
  56645. for (F = 0; F < y; F++) {
  56646. for (U = F / y,
  56647. k = v * (1 - U),
  56648. V = A * Math.sin(U * Math.PI / 2),
  56649. Y = 0,
  56650. X = B.length; Y < X; Y++)
  56651. H = i(B[Y], j[Y], V),
  56652. l(H.x, H.y, -k);
  56653. for (x = 0,
  56654. S = L.length; x < S; x++)
  56655. for (T = L[x],
  56656. K = Q[x],
  56657. Y = 0,
  56658. X = T.length; Y < X; Y++)
  56659. H = i(T[Y], K[Y], V),
  56660. l(H.x, H.y, -k)
  56661. }
  56662. for (V = A,
  56663. Y = 0; Y < z; Y++)
  56664. H = C ? i(O[Y], J[Y], V) : O[Y],
  56665. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56666. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56667. g.copy(u[0]).add(f).add(p),
  56668. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56669. var $;
  56670. for ($ = 1; $ <= E; $++)
  56671. for (Y = 0; Y < z; Y++)
  56672. H = C ? i(O[Y], J[Y], V) : O[Y],
  56673. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56674. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56675. g.copy(u[$]).add(f).add(p),
  56676. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56677. for (F = y - 1; F >= 0; F--) {
  56678. for (U = F / y,
  56679. k = v * (1 - U),
  56680. V = A * Math.sin(U * Math.PI / 2),
  56681. Y = 0,
  56682. X = B.length; Y < X; Y++)
  56683. H = i(B[Y], j[Y], V),
  56684. l(H.x, H.y, m + k);
  56685. for (x = 0,
  56686. S = L.length; x < S; x++)
  56687. for (T = L[x],
  56688. K = Q[x],
  56689. Y = 0,
  56690. X = T.length; Y < X; Y++)
  56691. H = i(T[Y], K[Y], V),
  56692. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56693. }
  56694. o(),
  56695. a()
  56696. }
  56697. ,
  56698. n.ExtrudeGeometry.WorldUVGenerator = {
  56699. generateTopUV: function(e, t, i, r) {
  56700. var o = e.vertices
  56701. , a = o[t]
  56702. , s = o[i]
  56703. , l = o[r];
  56704. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56705. },
  56706. generateSideWallUV: function(e, t, i, r, o) {
  56707. var a = e.vertices
  56708. , s = a[t]
  56709. , l = a[i]
  56710. , c = a[r]
  56711. , h = a[o];
  56712. 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)]
  56713. }
  56714. },
  56715. n.ShapeGeometry = function(e, t) {
  56716. n.Geometry.call(this),
  56717. this.type = "ShapeGeometry",
  56718. Array.isArray(e) === !1 && (e = [e]),
  56719. this.addShapeList(e, t),
  56720. this.computeFaceNormals()
  56721. }
  56722. ,
  56723. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56724. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56725. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56726. for (var i = 0, n = e.length; i < n; i++)
  56727. this.addShape(e[i], t);
  56728. return this
  56729. }
  56730. ,
  56731. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56732. void 0 === t && (t = {});
  56733. 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);
  56734. if (p) {
  56735. for (u = u.reverse(),
  56736. i = 0,
  56737. r = d.length; i < r; i++)
  56738. o = d[i],
  56739. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56740. p = !1
  56741. }
  56742. var f = n.ShapeUtils.triangulateShape(u, d);
  56743. for (i = 0,
  56744. r = d.length; i < r; i++)
  56745. o = d[i],
  56746. u = u.concat(o);
  56747. var g, m, v = u.length, A = f.length;
  56748. for (i = 0; i < v; i++)
  56749. g = u[i],
  56750. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56751. for (i = 0; i < A; i++) {
  56752. m = f[i];
  56753. var y = m[0] + c
  56754. , C = m[1] + c
  56755. , I = m[2] + c;
  56756. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56757. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56758. }
  56759. }
  56760. ,
  56761. n.LatheBufferGeometry = function(e, t, i, r) {
  56762. n.BufferGeometry.call(this),
  56763. this.type = "LatheBufferGeometry",
  56764. this.parameters = {
  56765. points: e,
  56766. segments: t,
  56767. phiStart: i,
  56768. phiLength: r
  56769. },
  56770. t = Math.floor(t) || 12,
  56771. i = i || 0,
  56772. r = r || 2 * Math.PI,
  56773. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56774. 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),
  56775. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56776. for (a = 0; a <= t; a++) {
  56777. var A = i + a * g * r
  56778. , y = Math.sin(A)
  56779. , C = Math.cos(A);
  56780. for (s = 0; s <= e.length - 1; s++)
  56781. m.x = e[s].x * y,
  56782. m.y = e[s].y,
  56783. m.z = e[s].x * C,
  56784. u.setXYZ(p, m.x, m.y, m.z),
  56785. v.x = a / t,
  56786. v.y = s / (e.length - 1),
  56787. d.setXY(p, v.x, v.y),
  56788. p++
  56789. }
  56790. for (a = 0; a < t; a++)
  56791. for (s = 0; s < e.length - 1; s++) {
  56792. o = s + a * e.length;
  56793. var I = o
  56794. , E = o + e.length
  56795. , b = o + e.length + 1
  56796. , w = o + 1;
  56797. h.setX(f, I),
  56798. f++,
  56799. h.setX(f, E),
  56800. f++,
  56801. h.setX(f, w),
  56802. f++,
  56803. h.setX(f, E),
  56804. f++,
  56805. h.setX(f, b),
  56806. f++,
  56807. h.setX(f, w),
  56808. f++
  56809. }
  56810. if (this.setIndex(h),
  56811. this.addAttribute("position", u),
  56812. this.addAttribute("uv", d),
  56813. this.computeVertexNormals(),
  56814. r === 2 * Math.PI) {
  56815. var _ = this.attributes.normal.array
  56816. , T = new n.Vector3
  56817. , x = new n.Vector3
  56818. , S = new n.Vector3;
  56819. for (o = t * e.length * 3,
  56820. a = 0,
  56821. s = 0; a < e.length; a++,
  56822. s += 3)
  56823. T.x = _[s + 0],
  56824. T.y = _[s + 1],
  56825. T.z = _[s + 2],
  56826. x.x = _[o + s + 0],
  56827. x.y = _[o + s + 1],
  56828. x.z = _[o + s + 2],
  56829. S.addVectors(T, x).normalize(),
  56830. _[s + 0] = _[o + s + 0] = S.x,
  56831. _[s + 1] = _[o + s + 1] = S.y,
  56832. _[s + 2] = _[o + s + 2] = S.z
  56833. }
  56834. }
  56835. ,
  56836. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56837. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56838. n.LatheGeometry = function(e, t, i, r) {
  56839. n.Geometry.call(this),
  56840. this.type = "LatheGeometry",
  56841. this.parameters = {
  56842. points: e,
  56843. segments: t,
  56844. phiStart: i,
  56845. phiLength: r
  56846. },
  56847. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56848. this.mergeVertices()
  56849. }
  56850. ,
  56851. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56852. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56853. n.PlaneGeometry = function(e, t, i, r) {
  56854. n.Geometry.call(this),
  56855. this.type = "PlaneGeometry",
  56856. this.parameters = {
  56857. width: e,
  56858. height: t,
  56859. widthSegments: i,
  56860. heightSegments: r
  56861. },
  56862. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56863. }
  56864. ,
  56865. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56866. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56867. n.PlaneBufferGeometry = function(e, t, i, r) {
  56868. n.BufferGeometry.call(this),
  56869. this.type = "PlaneBufferGeometry",
  56870. this.parameters = {
  56871. width: e,
  56872. height: t,
  56873. widthSegments: i,
  56874. heightSegments: r
  56875. };
  56876. 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++)
  56877. for (var y = A * d - a, C = 0; C < c; C++) {
  56878. var I = C * u - o;
  56879. p[m] = I,
  56880. p[m + 1] = -y,
  56881. f[m + 2] = 1,
  56882. g[v] = C / s,
  56883. g[v + 1] = 1 - A / l,
  56884. m += 3,
  56885. v += 2
  56886. }
  56887. m = 0;
  56888. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56889. for (var C = 0; C < s; C++) {
  56890. var b = C + c * A
  56891. , w = C + c * (A + 1)
  56892. , _ = C + 1 + c * (A + 1)
  56893. , T = C + 1 + c * A;
  56894. E[m] = b,
  56895. E[m + 1] = w,
  56896. E[m + 2] = T,
  56897. E[m + 3] = w,
  56898. E[m + 4] = _,
  56899. E[m + 5] = T,
  56900. m += 6
  56901. }
  56902. this.setIndex(new n.BufferAttribute(E,1)),
  56903. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56904. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56905. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56906. }
  56907. ,
  56908. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56909. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56910. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56911. n.BufferGeometry.call(this),
  56912. this.type = "RingBufferGeometry",
  56913. this.parameters = {
  56914. innerRadius: e,
  56915. outerRadius: t,
  56916. thetaSegments: i,
  56917. phiSegments: r,
  56918. thetaStart: o,
  56919. thetaLength: a
  56920. },
  56921. e = e || 20,
  56922. t = t || 50,
  56923. o = void 0 !== o ? o : 0,
  56924. a = void 0 !== a ? a : 2 * Math.PI,
  56925. i = void 0 !== i ? Math.max(3, i) : 8,
  56926. r = void 0 !== r ? Math.max(1, r) : 1;
  56927. 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;
  56928. for (l = 0; l <= r; l++) {
  56929. for (c = 0; c <= i; c++)
  56930. s = o + c / i * a,
  56931. C.x = A * Math.cos(s),
  56932. C.y = A * Math.sin(s),
  56933. p.setXYZ(m, C.x, C.y, C.z),
  56934. f.setXYZ(m, 0, 0, 1),
  56935. I.x = (C.x / t + 1) / 2,
  56936. I.y = (C.y / t + 1) / 2,
  56937. g.setXY(m, I.x, I.y),
  56938. m++;
  56939. A += y
  56940. }
  56941. for (l = 0; l < r; l++) {
  56942. var E = l * (i + 1);
  56943. for (c = 0; c < i; c++) {
  56944. s = c + E;
  56945. var b = s
  56946. , w = s + i + 1
  56947. , _ = s + i + 2
  56948. , T = s + 1;
  56949. d.setX(v, b),
  56950. v++,
  56951. d.setX(v, w),
  56952. v++,
  56953. d.setX(v, _),
  56954. v++,
  56955. d.setX(v, b),
  56956. v++,
  56957. d.setX(v, _),
  56958. v++,
  56959. d.setX(v, T),
  56960. v++
  56961. }
  56962. }
  56963. this.setIndex(d),
  56964. this.addAttribute("position", p),
  56965. this.addAttribute("normal", f),
  56966. this.addAttribute("uv", g)
  56967. }
  56968. ,
  56969. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56970. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56971. n.RingGeometry = function(e, t, i, r, o, a) {
  56972. n.Geometry.call(this),
  56973. this.type = "RingGeometry",
  56974. this.parameters = {
  56975. innerRadius: e,
  56976. outerRadius: t,
  56977. thetaSegments: i,
  56978. phiSegments: r,
  56979. thetaStart: o,
  56980. thetaLength: a
  56981. },
  56982. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56983. }
  56984. ,
  56985. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56986. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56987. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56988. n.Geometry.call(this),
  56989. this.type = "SphereGeometry",
  56990. this.parameters = {
  56991. radius: e,
  56992. widthSegments: t,
  56993. heightSegments: i,
  56994. phiStart: r,
  56995. phiLength: o,
  56996. thetaStart: a,
  56997. thetaLength: s
  56998. },
  56999. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57000. }
  57001. ,
  57002. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57003. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57004. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57005. n.BufferGeometry.call(this),
  57006. this.type = "SphereBufferGeometry",
  57007. this.parameters = {
  57008. radius: e,
  57009. widthSegments: t,
  57010. heightSegments: i,
  57011. phiStart: r,
  57012. phiLength: o,
  57013. thetaStart: a,
  57014. thetaLength: s
  57015. },
  57016. e = e || 50,
  57017. t = Math.max(3, Math.floor(t) || 8),
  57018. i = Math.max(2, Math.floor(i) || 6),
  57019. r = void 0 !== r ? r : 0,
  57020. o = void 0 !== o ? o : 2 * Math.PI,
  57021. a = void 0 !== a ? a : 0,
  57022. s = void 0 !== s ? s : Math.PI;
  57023. 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++) {
  57024. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57025. var C = y / t
  57026. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57027. , E = e * Math.cos(a + A * s)
  57028. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57029. g.set(I, E, b).normalize(),
  57030. h.setXYZ(p, I, E, b),
  57031. u.setXYZ(p, g.x, g.y, g.z),
  57032. d.setXY(p, C, 1 - A),
  57033. v.push(p),
  57034. p++
  57035. }
  57036. f.push(v)
  57037. }
  57038. for (var w = [], m = 0; m < i; m++)
  57039. for (var y = 0; y < t; y++) {
  57040. var _ = f[m][y + 1]
  57041. , T = f[m][y]
  57042. , x = f[m + 1][y]
  57043. , S = f[m + 1][y + 1];
  57044. (0 !== m || a > 0) && w.push(_, T, S),
  57045. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57046. }
  57047. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57048. this.addAttribute("position", h),
  57049. this.addAttribute("normal", u),
  57050. this.addAttribute("uv", d),
  57051. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57052. }
  57053. ,
  57054. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57055. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57056. n.TextGeometry = function(e, t) {
  57057. t = t || {};
  57058. var i = t.font;
  57059. if (i instanceof n.Font == !1)
  57060. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57061. new n.Geometry;
  57062. var r = i.generateShapes(e, t.size, t.curveSegments);
  57063. t.amount = void 0 !== t.height ? t.height : 50,
  57064. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57065. void 0 === t.bevelSize && (t.bevelSize = 8),
  57066. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57067. n.ExtrudeGeometry.call(this, r, t),
  57068. this.type = "TextGeometry"
  57069. }
  57070. ,
  57071. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57072. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57073. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57074. n.BufferGeometry.call(this),
  57075. this.type = "TorusBufferGeometry",
  57076. this.parameters = {
  57077. radius: e,
  57078. tube: t,
  57079. radialSegments: i,
  57080. tubularSegments: r,
  57081. arc: o
  57082. },
  57083. e = e || 100,
  57084. t = t || 40,
  57085. i = Math.floor(i) || 8,
  57086. r = Math.floor(r) || 6,
  57087. o = o || 2 * Math.PI;
  57088. 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;
  57089. for (a = 0; a <= i; a++)
  57090. for (s = 0; s <= r; s++) {
  57091. var C = s / r * o
  57092. , I = a / i * Math.PI * 2;
  57093. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57094. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57095. A.z = t * Math.sin(I),
  57096. u[f] = A.x,
  57097. u[f + 1] = A.y,
  57098. u[f + 2] = A.z,
  57099. v.x = e * Math.cos(C),
  57100. v.y = e * Math.sin(C),
  57101. y.subVectors(A, v).normalize(),
  57102. d[f] = y.x,
  57103. d[f + 1] = y.y,
  57104. d[f + 2] = y.z,
  57105. p[g] = s / r,
  57106. p[g + 1] = a / i,
  57107. f += 3,
  57108. g += 2
  57109. }
  57110. for (a = 1; a <= i; a++)
  57111. for (s = 1; s <= r; s++) {
  57112. var E = (r + 1) * a + s - 1
  57113. , b = (r + 1) * (a - 1) + s - 1
  57114. , w = (r + 1) * (a - 1) + s
  57115. , _ = (r + 1) * a + s;
  57116. h[m] = E,
  57117. h[m + 1] = b,
  57118. h[m + 2] = _,
  57119. h[m + 3] = b,
  57120. h[m + 4] = w,
  57121. h[m + 5] = _,
  57122. m += 6
  57123. }
  57124. this.setIndex(new n.BufferAttribute(h,1)),
  57125. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57126. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57127. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57128. }
  57129. ,
  57130. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57131. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57132. n.TorusGeometry = function(e, t, i, r, o) {
  57133. n.Geometry.call(this),
  57134. this.type = "TorusGeometry",
  57135. this.parameters = {
  57136. radius: e,
  57137. tube: t,
  57138. radialSegments: i,
  57139. tubularSegments: r,
  57140. arc: o
  57141. },
  57142. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57143. }
  57144. ,
  57145. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57146. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57147. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57148. function s(e, t, i, n, r) {
  57149. var o = Math.cos(e)
  57150. , a = Math.sin(e)
  57151. , s = i / t * e
  57152. , l = Math.cos(s);
  57153. r.x = n * (2 + l) * .5 * o,
  57154. r.y = n * (2 + l) * a * .5,
  57155. r.z = n * Math.sin(s) * .5
  57156. }
  57157. n.BufferGeometry.call(this),
  57158. this.type = "TorusKnotBufferGeometry",
  57159. this.parameters = {
  57160. radius: e,
  57161. tube: t,
  57162. tubularSegments: i,
  57163. radialSegments: r,
  57164. p: o,
  57165. q: a
  57166. },
  57167. e = e || 100,
  57168. t = t || 40,
  57169. i = Math.floor(i) || 64,
  57170. r = Math.floor(r) || 8,
  57171. o = o || 2,
  57172. a = a || 3;
  57173. 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;
  57174. for (l = 0; l <= i; ++l) {
  57175. var T = l / i * o * Math.PI * 2;
  57176. for (s(T, o, a, e, I),
  57177. s(T + .01, o, a, e, E),
  57178. w.subVectors(E, I),
  57179. _.addVectors(E, I),
  57180. b.crossVectors(w, _),
  57181. _.crossVectors(b, w),
  57182. b.normalize(),
  57183. _.normalize(),
  57184. c = 0; c <= r; ++c) {
  57185. var x = c / r * Math.PI * 2
  57186. , S = -t * Math.cos(x)
  57187. , M = t * Math.sin(x);
  57188. A.x = I.x + (S * _.x + M * b.x),
  57189. A.y = I.y + (S * _.y + M * b.y),
  57190. A.z = I.z + (S * _.z + M * b.z),
  57191. p.setXYZ(m, A.x, A.y, A.z),
  57192. y.subVectors(A, I).normalize(),
  57193. f.setXYZ(m, y.x, y.y, y.z),
  57194. C.x = l / i,
  57195. C.y = c / r,
  57196. g.setXY(m, C.x, C.y),
  57197. m++
  57198. }
  57199. }
  57200. for (c = 1; c <= i; c++)
  57201. for (l = 1; l <= r; l++) {
  57202. var R = (r + 1) * (c - 1) + (l - 1)
  57203. , P = (r + 1) * c + (l - 1)
  57204. , O = (r + 1) * c + l
  57205. , L = (r + 1) * (c - 1) + l;
  57206. d.setX(v, R),
  57207. v++,
  57208. d.setX(v, P),
  57209. v++,
  57210. d.setX(v, L),
  57211. v++,
  57212. d.setX(v, P),
  57213. v++,
  57214. d.setX(v, O),
  57215. v++,
  57216. d.setX(v, L),
  57217. v++
  57218. }
  57219. this.setIndex(d),
  57220. this.addAttribute("position", p),
  57221. this.addAttribute("normal", f),
  57222. this.addAttribute("uv", g)
  57223. }
  57224. ,
  57225. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57226. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57227. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57228. n.Geometry.call(this),
  57229. this.type = "TorusKnotGeometry",
  57230. this.parameters = {
  57231. radius: e,
  57232. tube: t,
  57233. tubularSegments: i,
  57234. radialSegments: r,
  57235. p: o,
  57236. q: a
  57237. },
  57238. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57239. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57240. this.mergeVertices()
  57241. }
  57242. ,
  57243. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57244. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57245. n.TubeGeometry = function(e, t, i, r, o, a) {
  57246. function s(e, t, i) {
  57247. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57248. }
  57249. n.Geometry.call(this),
  57250. this.type = "TubeGeometry",
  57251. this.parameters = {
  57252. path: e,
  57253. segments: t,
  57254. radius: i,
  57255. radialSegments: r,
  57256. closed: o,
  57257. taper: a
  57258. },
  57259. t = t || 64,
  57260. i = i || 1,
  57261. r = r || 8,
  57262. o = o || !1,
  57263. a = a || n.TubeGeometry.NoTaper;
  57264. 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;
  57265. for (this.tangents = D,
  57266. this.normals = N,
  57267. this.binormals = B,
  57268. v = 0; v < P; v++)
  57269. for (M[v] = [],
  57270. u = v / (P - 1),
  57271. m = e.getPointAt(u),
  57272. l = D[v],
  57273. c = N[v],
  57274. h = B[v],
  57275. p = i * a(u),
  57276. A = 0; A < r; A++)
  57277. d = A / r * 2 * Math.PI,
  57278. f = -p * Math.cos(d),
  57279. g = p * Math.sin(d),
  57280. O.copy(m),
  57281. O.x += f * c.x + g * h.x,
  57282. O.y += f * c.y + g * h.y,
  57283. O.z += f * c.z + g * h.z,
  57284. M[v][A] = s(O.x, O.y, O.z);
  57285. for (v = 0; v < t; v++)
  57286. for (A = 0; A < r; A++)
  57287. y = o ? (v + 1) % t : v + 1,
  57288. C = (A + 1) % r,
  57289. I = M[v][A],
  57290. E = M[y][A],
  57291. b = M[y][C],
  57292. w = M[v][C],
  57293. _ = new n.Vector2(v / t,A / r),
  57294. T = new n.Vector2((v + 1) / t,A / r),
  57295. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57296. S = new n.Vector2(v / t,(A + 1) / r),
  57297. this.faces.push(new n.Face3(I,E,w)),
  57298. this.faceVertexUvs[0].push([_, T, S]),
  57299. this.faces.push(new n.Face3(E,b,w)),
  57300. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57301. this.computeFaceNormals(),
  57302. this.computeVertexNormals()
  57303. }
  57304. ,
  57305. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57306. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57307. n.TubeGeometry.NoTaper = function(e) {
  57308. return 1
  57309. }
  57310. ,
  57311. n.TubeGeometry.SinusoidalTaper = function(e) {
  57312. return Math.sin(Math.PI * e)
  57313. }
  57314. ,
  57315. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57316. function r() {
  57317. f[0] = new n.Vector3,
  57318. g[0] = new n.Vector3,
  57319. a = Number.MAX_VALUE,
  57320. s = Math.abs(p[0].x),
  57321. l = Math.abs(p[0].y),
  57322. c = Math.abs(p[0].z),
  57323. s <= a && (a = s,
  57324. d.set(1, 0, 0)),
  57325. l <= a && (a = l,
  57326. d.set(0, 1, 0)),
  57327. c <= a && d.set(0, 0, 1),
  57328. m.crossVectors(p[0], d).normalize(),
  57329. f[0].crossVectors(p[0], m),
  57330. g[0].crossVectors(p[0], f[0])
  57331. }
  57332. 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;
  57333. for (this.tangents = p,
  57334. this.normals = f,
  57335. this.binormals = g,
  57336. h = 0; h < A; h++)
  57337. u = h / (A - 1),
  57338. p[h] = e.getTangentAt(u),
  57339. p[h].normalize();
  57340. for (r(),
  57341. h = 1; h < A; h++)
  57342. f[h] = f[h - 1].clone(),
  57343. g[h] = g[h - 1].clone(),
  57344. m.crossVectors(p[h - 1], p[h]),
  57345. m.length() > Number.EPSILON && (m.normalize(),
  57346. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57347. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57348. g[h].crossVectors(p[h], f[h]);
  57349. if (i)
  57350. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57351. o /= A - 1,
  57352. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57353. h = 1; h < A; h++)
  57354. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57355. g[h].crossVectors(p[h], f[h])
  57356. }
  57357. ,
  57358. n.PolyhedronGeometry = function(e, t, i, r) {
  57359. function o(e) {
  57360. var t = e.normalize().clone();
  57361. t.index = u.vertices.push(t) - 1;
  57362. var i = l(e) / 2 / Math.PI + .5
  57363. , r = c(e) / Math.PI + .5;
  57364. return t.uv = new n.Vector2(i,1 - r),
  57365. t
  57366. }
  57367. function a(e, t, i, r) {
  57368. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57369. u.faces.push(o),
  57370. C.copy(e).add(t).add(i).divideScalar(3);
  57371. var a = l(C);
  57372. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57373. }
  57374. function s(e, t) {
  57375. 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++) {
  57376. l[h] = [];
  57377. 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++)
  57378. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57379. }
  57380. for (var h = 0; h < i; h++)
  57381. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57382. var m = Math.floor(g / 2);
  57383. 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)
  57384. }
  57385. }
  57386. function l(e) {
  57387. return Math.atan2(e.z, -e.x)
  57388. }
  57389. function c(e) {
  57390. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57391. }
  57392. function h(e, t, i) {
  57393. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57394. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57395. e.clone()
  57396. }
  57397. n.Geometry.call(this),
  57398. this.type = "PolyhedronGeometry",
  57399. this.parameters = {
  57400. vertices: e,
  57401. indices: t,
  57402. radius: i,
  57403. detail: r
  57404. },
  57405. i = i || 1,
  57406. r = r || 0;
  57407. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57408. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57409. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57410. m++) {
  57411. var v = f[t[d]]
  57412. , A = f[t[d + 1]]
  57413. , y = f[t[d + 2]];
  57414. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57415. }
  57416. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57417. s(g[d], r);
  57418. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57419. var I = this.faceVertexUvs[0][d]
  57420. , E = I[0].x
  57421. , b = I[1].x
  57422. , w = I[2].x
  57423. , _ = Math.max(E, b, w)
  57424. , T = Math.min(E, b, w);
  57425. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57426. b < .2 && (I[1].x += 1),
  57427. w < .2 && (I[2].x += 1))
  57428. }
  57429. for (var d = 0, p = this.vertices.length; d < p; d++)
  57430. this.vertices[d].multiplyScalar(i);
  57431. this.mergeVertices(),
  57432. this.computeFaceNormals(),
  57433. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57434. }
  57435. ,
  57436. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57437. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57438. n.DodecahedronGeometry = function(e, t) {
  57439. var i = (1 + Math.sqrt(5)) / 2
  57440. , r = 1 / i
  57441. , 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]
  57442. , 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];
  57443. n.PolyhedronGeometry.call(this, o, a, e, t),
  57444. this.type = "DodecahedronGeometry",
  57445. this.parameters = {
  57446. radius: e,
  57447. detail: t
  57448. }
  57449. }
  57450. ,
  57451. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57452. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57453. n.IcosahedronGeometry = function(e, t) {
  57454. var i = (1 + Math.sqrt(5)) / 2
  57455. , 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]
  57456. , 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];
  57457. n.PolyhedronGeometry.call(this, r, o, e, t),
  57458. this.type = "IcosahedronGeometry",
  57459. this.parameters = {
  57460. radius: e,
  57461. detail: t
  57462. }
  57463. }
  57464. ,
  57465. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57466. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57467. n.OctahedronGeometry = function(e, t) {
  57468. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57469. , 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];
  57470. n.PolyhedronGeometry.call(this, i, r, e, t),
  57471. this.type = "OctahedronGeometry",
  57472. this.parameters = {
  57473. radius: e,
  57474. detail: t
  57475. }
  57476. }
  57477. ,
  57478. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57479. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57480. n.TetrahedronGeometry = function(e, t) {
  57481. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57482. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57483. n.PolyhedronGeometry.call(this, i, r, e, t),
  57484. this.type = "TetrahedronGeometry",
  57485. this.parameters = {
  57486. radius: e,
  57487. detail: t
  57488. }
  57489. }
  57490. ,
  57491. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57492. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57493. n.ParametricGeometry = function(e, t, i) {
  57494. n.Geometry.call(this),
  57495. this.type = "ParametricGeometry",
  57496. this.parameters = {
  57497. func: e,
  57498. slices: t,
  57499. stacks: i
  57500. };
  57501. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57502. for (r = 0; r <= i; r++)
  57503. for (l = r / i,
  57504. o = 0; o <= t; o++)
  57505. s = o / t,
  57506. a = e(s, l),
  57507. c.push(a);
  57508. var p, f, g, m, v, A, y, C;
  57509. for (r = 0; r < i; r++)
  57510. for (o = 0; o < t; o++)
  57511. p = r * d + o,
  57512. f = r * d + o + 1,
  57513. g = (r + 1) * d + o + 1,
  57514. m = (r + 1) * d + o,
  57515. v = new n.Vector2(o / t,r / i),
  57516. A = new n.Vector2((o + 1) / t,r / i),
  57517. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57518. C = new n.Vector2(o / t,(r + 1) / i),
  57519. h.push(new n.Face3(p,f,m)),
  57520. u.push([v, A, C]),
  57521. h.push(new n.Face3(f,g,m)),
  57522. u.push([A.clone(), y, C.clone()]);
  57523. this.computeFaceNormals(),
  57524. this.computeVertexNormals()
  57525. }
  57526. ,
  57527. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57528. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57529. n.WireframeGeometry = function(e) {
  57530. function t(e, t) {
  57531. return e - t
  57532. }
  57533. n.BufferGeometry.call(this);
  57534. var i = [0, 0]
  57535. , r = {}
  57536. , o = ["a", "b", "c"];
  57537. if (e instanceof n.Geometry) {
  57538. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57539. for (var d = s[h], p = 0; p < 3; p++) {
  57540. i[0] = d[o[p]],
  57541. i[1] = d[o[(p + 1) % 3]],
  57542. i.sort(t);
  57543. var f = i.toString();
  57544. void 0 === r[f] && (c[2 * l] = i[0],
  57545. c[2 * l + 1] = i[1],
  57546. r[f] = !0,
  57547. l++)
  57548. }
  57549. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57550. for (var p = 0; p < 2; p++) {
  57551. var m = a[c[2 * h + p]]
  57552. , v = 6 * h + 3 * p;
  57553. g[v + 0] = m.x,
  57554. g[v + 1] = m.y,
  57555. g[v + 2] = m.z
  57556. }
  57557. this.addAttribute("position", new n.BufferAttribute(g,3))
  57558. } else if (e instanceof n.BufferGeometry)
  57559. if (null !== e.index) {
  57560. var A = e.index.array
  57561. , a = e.attributes.position
  57562. , y = e.groups
  57563. , l = 0;
  57564. 0 === y.length && e.addGroup(0, A.length);
  57565. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57566. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57567. for (var p = 0; p < 3; p++) {
  57568. i[0] = A[h + p],
  57569. i[1] = A[h + (p + 1) % 3],
  57570. i.sort(t);
  57571. var f = i.toString();
  57572. void 0 === r[f] && (c[2 * l] = i[0],
  57573. c[2 * l + 1] = i[1],
  57574. r[f] = !0,
  57575. l++)
  57576. }
  57577. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57578. for (var p = 0; p < 2; p++) {
  57579. var v = 6 * h + 3 * p
  57580. , T = c[2 * h + p];
  57581. g[v + 0] = a.getX(T),
  57582. g[v + 1] = a.getY(T),
  57583. g[v + 2] = a.getZ(T)
  57584. }
  57585. this.addAttribute("position", new n.BufferAttribute(g,3))
  57586. } else {
  57587. 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++)
  57588. for (var p = 0; p < 3; p++) {
  57589. var v = 18 * h + 6 * p
  57590. , S = 9 * h + 3 * p;
  57591. g[v + 0] = a[S],
  57592. g[v + 1] = a[S + 1],
  57593. g[v + 2] = a[S + 2];
  57594. var T = 9 * h + 3 * ((p + 1) % 3);
  57595. g[v + 3] = a[T],
  57596. g[v + 4] = a[T + 1],
  57597. g[v + 5] = a[T + 2]
  57598. }
  57599. this.addAttribute("position", new n.BufferAttribute(g,3))
  57600. }
  57601. }
  57602. ,
  57603. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57604. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57605. n.AxisHelper = function(e) {
  57606. e = e || 1;
  57607. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57608. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57609. , r = new n.BufferGeometry;
  57610. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57611. r.addAttribute("color", new n.BufferAttribute(i,3));
  57612. var o = new n.LineBasicMaterial({
  57613. vertexColors: n.VertexColors
  57614. });
  57615. n.LineSegments.call(this, r, o)
  57616. }
  57617. ,
  57618. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57619. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57620. n.ArrowHelper = function() {
  57621. var e = new n.Geometry;
  57622. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57623. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57624. return t.translate(0, -.5, 0),
  57625. function(i, r, o, a, s, l) {
  57626. n.Object3D.call(this),
  57627. void 0 === a && (a = 16776960),
  57628. void 0 === o && (o = 1),
  57629. void 0 === s && (s = .2 * o),
  57630. void 0 === l && (l = .2 * s),
  57631. this.position.copy(r),
  57632. this.line = new n.Line(e,new n.LineBasicMaterial({
  57633. color: a
  57634. })),
  57635. this.line.matrixAutoUpdate = !1,
  57636. this.add(this.line),
  57637. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57638. color: a
  57639. })),
  57640. this.cone.matrixAutoUpdate = !1,
  57641. this.add(this.cone),
  57642. this.setDirection(i),
  57643. this.setLength(o, s, l)
  57644. }
  57645. }(),
  57646. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57647. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57648. n.ArrowHelper.prototype.setDirection = function() {
  57649. var e, t = new n.Vector3;
  57650. return function(i) {
  57651. 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(),
  57652. e = Math.acos(i.y),
  57653. this.quaternion.setFromAxisAngle(t, e))
  57654. }
  57655. }(),
  57656. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57657. void 0 === t && (t = .2 * e),
  57658. void 0 === i && (i = .2 * t),
  57659. this.line.scale.set(1, Math.max(0, e - t), 1),
  57660. this.line.updateMatrix(),
  57661. this.cone.scale.set(i, t, i),
  57662. this.cone.position.y = e,
  57663. this.cone.updateMatrix()
  57664. }
  57665. ,
  57666. n.ArrowHelper.prototype.setColor = function(e) {
  57667. this.line.material.color.set(e),
  57668. this.cone.material.color.set(e)
  57669. }
  57670. ,
  57671. n.BoxHelper = function(e) {
  57672. 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])
  57673. , i = new Float32Array(24)
  57674. , r = new n.BufferGeometry;
  57675. r.setIndex(new n.BufferAttribute(t,1)),
  57676. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57677. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57678. color: 16776960
  57679. })),
  57680. void 0 !== e && this.update(e)
  57681. }
  57682. ,
  57683. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57684. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57685. n.BoxHelper.prototype.update = function() {
  57686. var e = new n.Box3;
  57687. return function(t) {
  57688. if (e.setFromObject(t),
  57689. !e.isEmpty()) {
  57690. var i = e.min
  57691. , n = e.max
  57692. , r = this.geometry.attributes.position
  57693. , o = r.array;
  57694. o[0] = n.x,
  57695. o[1] = n.y,
  57696. o[2] = n.z,
  57697. o[3] = i.x,
  57698. o[4] = n.y,
  57699. o[5] = n.z,
  57700. o[6] = i.x,
  57701. o[7] = i.y,
  57702. o[8] = n.z,
  57703. o[9] = n.x,
  57704. o[10] = i.y,
  57705. o[11] = n.z,
  57706. o[12] = n.x,
  57707. o[13] = n.y,
  57708. o[14] = i.z,
  57709. o[15] = i.x,
  57710. o[16] = n.y,
  57711. o[17] = i.z,
  57712. o[18] = i.x,
  57713. o[19] = i.y,
  57714. o[20] = i.z,
  57715. o[21] = n.x,
  57716. o[22] = i.y,
  57717. o[23] = i.z,
  57718. r.needsUpdate = !0,
  57719. this.geometry.computeBoundingSphere()
  57720. }
  57721. }
  57722. }(),
  57723. n.BoundingBoxHelper = function(e, t) {
  57724. var i = void 0 !== t ? t : 8947848;
  57725. this.object = e,
  57726. this.box = new n.Box3,
  57727. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57728. color: i,
  57729. wireframe: !0
  57730. }))
  57731. }
  57732. ,
  57733. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57734. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57735. n.BoundingBoxHelper.prototype.update = function() {
  57736. this.box.setFromObject(this.object),
  57737. this.box.size(this.scale),
  57738. this.box.center(this.position)
  57739. }
  57740. ,
  57741. n.CameraHelper = function(e) {
  57742. function t(e, t, n) {
  57743. i(e, n),
  57744. i(t, n)
  57745. }
  57746. function i(e, t) {
  57747. r.vertices.push(new n.Vector3),
  57748. r.colors.push(new n.Color(t)),
  57749. void 0 === a[e] && (a[e] = []),
  57750. a[e].push(r.vertices.length - 1)
  57751. }
  57752. var r = new n.Geometry
  57753. , o = new n.LineBasicMaterial({
  57754. color: 16777215,
  57755. vertexColors: n.FaceColors
  57756. })
  57757. , a = {}
  57758. , s = 16755200
  57759. , l = 16711680
  57760. , c = 43775
  57761. , h = 16777215
  57762. , u = 3355443;
  57763. t("n1", "n2", s),
  57764. t("n2", "n4", s),
  57765. t("n4", "n3", s),
  57766. t("n3", "n1", s),
  57767. t("f1", "f2", s),
  57768. t("f2", "f4", s),
  57769. t("f4", "f3", s),
  57770. t("f3", "f1", s),
  57771. t("n1", "f1", s),
  57772. t("n2", "f2", s),
  57773. t("n3", "f3", s),
  57774. t("n4", "f4", s),
  57775. t("p", "n1", l),
  57776. t("p", "n2", l),
  57777. t("p", "n3", l),
  57778. t("p", "n4", l),
  57779. t("u1", "u2", c),
  57780. t("u2", "u3", c),
  57781. t("u3", "u1", c),
  57782. t("c", "t", h),
  57783. t("p", "c", u),
  57784. t("cn1", "cn2", u),
  57785. t("cn3", "cn4", u),
  57786. t("cf1", "cf2", u),
  57787. t("cf3", "cf4", u),
  57788. n.LineSegments.call(this, r, o),
  57789. this.camera = e,
  57790. this.camera.updateProjectionMatrix(),
  57791. this.matrix = e.matrixWorld,
  57792. this.matrixAutoUpdate = !1,
  57793. this.pointMap = a,
  57794. this.update()
  57795. }
  57796. ,
  57797. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57798. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57799. n.CameraHelper.prototype.update = function() {
  57800. function e(e, n, a, s) {
  57801. r.set(n, a, s).unproject(o);
  57802. var l = i[e];
  57803. if (void 0 !== l)
  57804. for (var c = 0, h = l.length; c < h; c++)
  57805. t.vertices[l[c]].copy(r)
  57806. }
  57807. var t, i, r = new n.Vector3, o = new n.Camera;
  57808. return function() {
  57809. t = this.geometry,
  57810. i = this.pointMap;
  57811. var n = 1
  57812. , r = 1;
  57813. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57814. e("c", 0, 0, -1),
  57815. e("t", 0, 0, 1),
  57816. e("n1", -n, -r, -1),
  57817. e("n2", n, -r, -1),
  57818. e("n3", -n, r, -1),
  57819. e("n4", n, r, -1),
  57820. e("f1", -n, -r, 1),
  57821. e("f2", n, -r, 1),
  57822. e("f3", -n, r, 1),
  57823. e("f4", n, r, 1),
  57824. e("u1", .7 * n, 1.1 * r, -1),
  57825. e("u2", .7 * -n, 1.1 * r, -1),
  57826. e("u3", 0, 2 * r, -1),
  57827. e("cf1", -n, 0, 1),
  57828. e("cf2", n, 0, 1),
  57829. e("cf3", 0, -r, 1),
  57830. e("cf4", 0, r, 1),
  57831. e("cn1", -n, 0, -1),
  57832. e("cn2", n, 0, -1),
  57833. e("cn3", 0, -r, -1),
  57834. e("cn4", 0, r, -1),
  57835. t.verticesNeedUpdate = !0
  57836. }
  57837. }(),
  57838. n.DirectionalLightHelper = 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. t = t || 1;
  57845. var i = new n.Geometry;
  57846. 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));
  57847. var r = new n.LineBasicMaterial({
  57848. fog: !1
  57849. });
  57850. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57851. this.lightPlane = new n.Line(i,r),
  57852. this.add(this.lightPlane),
  57853. i = new n.Geometry,
  57854. i.vertices.push(new n.Vector3, new n.Vector3),
  57855. r = new n.LineBasicMaterial({
  57856. fog: !1
  57857. }),
  57858. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57859. this.targetLine = new n.Line(i,r),
  57860. this.add(this.targetLine),
  57861. this.update()
  57862. }
  57863. ,
  57864. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57865. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57866. n.DirectionalLightHelper.prototype.dispose = function() {
  57867. this.lightPlane.geometry.dispose(),
  57868. this.lightPlane.material.dispose(),
  57869. this.targetLine.geometry.dispose(),
  57870. this.targetLine.material.dispose()
  57871. }
  57872. ,
  57873. n.DirectionalLightHelper.prototype.update = function() {
  57874. var e = new n.Vector3
  57875. , t = new n.Vector3
  57876. , i = new n.Vector3;
  57877. return function() {
  57878. e.setFromMatrixPosition(this.light.matrixWorld),
  57879. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57880. i.subVectors(t, e),
  57881. this.lightPlane.lookAt(i),
  57882. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57883. this.targetLine.geometry.vertices[1].copy(i),
  57884. this.targetLine.geometry.verticesNeedUpdate = !0,
  57885. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57886. }
  57887. }(),
  57888. n.EdgesHelper = function(e, t, i) {
  57889. var r = void 0 !== t ? t : 16777215;
  57890. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57891. color: r
  57892. })),
  57893. this.matrix = e.matrixWorld,
  57894. this.matrixAutoUpdate = !1
  57895. }
  57896. ,
  57897. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57898. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57899. n.FaceNormalsHelper = function(e, t, i, r) {
  57900. this.object = e,
  57901. this.size = void 0 !== t ? t : 1;
  57902. var o = void 0 !== i ? i : 16776960
  57903. , a = void 0 !== r ? r : 1
  57904. , s = 0
  57905. , l = this.object.geometry;
  57906. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57907. var c = new n.BufferGeometry
  57908. , h = new n.Float32Attribute(2 * s * 3,3);
  57909. c.addAttribute("position", h),
  57910. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57911. color: o,
  57912. linewidth: a
  57913. })),
  57914. this.matrixAutoUpdate = !1,
  57915. this.update()
  57916. }
  57917. ,
  57918. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57919. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57920. n.FaceNormalsHelper.prototype.update = function() {
  57921. var e = new n.Vector3
  57922. , t = new n.Vector3
  57923. , i = new n.Matrix3;
  57924. return function() {
  57925. this.object.updateMatrixWorld(!0),
  57926. i.getNormalMatrix(this.object.matrixWorld);
  57927. 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++) {
  57928. var u = s[c]
  57929. , d = u.normal;
  57930. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57931. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57932. r.setXYZ(l, e.x, e.y, e.z),
  57933. l += 1,
  57934. r.setXYZ(l, t.x, t.y, t.z),
  57935. l += 1
  57936. }
  57937. return r.needsUpdate = !0,
  57938. this
  57939. }
  57940. }(),
  57941. n.GridHelper = function(e, t) {
  57942. var i = new n.Geometry
  57943. , r = new n.LineBasicMaterial({
  57944. vertexColors: n.VertexColors
  57945. });
  57946. this.color1 = new n.Color(4473924),
  57947. this.color2 = new n.Color(8947848);
  57948. for (var o = -e; o <= e; o += t) {
  57949. 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));
  57950. var a = 0 === o ? this.color1 : this.color2;
  57951. i.colors.push(a, a, a, a)
  57952. }
  57953. n.LineSegments.call(this, i, r)
  57954. }
  57955. ,
  57956. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57957. n.GridHelper.prototype.constructor = n.GridHelper,
  57958. n.GridHelper.prototype.setColors = function(e, t) {
  57959. this.color1.set(e),
  57960. this.color2.set(t),
  57961. this.geometry.colorsNeedUpdate = !0
  57962. }
  57963. ,
  57964. n.HemisphereLightHelper = function(e, t) {
  57965. n.Object3D.call(this),
  57966. this.light = e,
  57967. this.light.updateMatrixWorld(),
  57968. this.matrix = e.matrixWorld,
  57969. this.matrixAutoUpdate = !1,
  57970. this.colors = [new n.Color, new n.Color];
  57971. var i = new n.SphereGeometry(t,4,2);
  57972. i.rotateX(-Math.PI / 2);
  57973. for (var r = 0, o = 8; r < o; r++)
  57974. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57975. var a = new n.MeshBasicMaterial({
  57976. vertexColors: n.FaceColors,
  57977. wireframe: !0
  57978. });
  57979. this.lightSphere = new n.Mesh(i,a),
  57980. this.add(this.lightSphere),
  57981. this.update()
  57982. }
  57983. ,
  57984. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57985. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57986. n.HemisphereLightHelper.prototype.dispose = function() {
  57987. this.lightSphere.geometry.dispose(),
  57988. this.lightSphere.material.dispose()
  57989. }
  57990. ,
  57991. n.HemisphereLightHelper.prototype.update = function() {
  57992. var e = new n.Vector3;
  57993. return function() {
  57994. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57995. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57996. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57997. this.lightSphere.geometry.colorsNeedUpdate = !0
  57998. }
  57999. }(),
  58000. n.PointLightHelper = function(e, t) {
  58001. this.light = e,
  58002. this.light.updateMatrixWorld();
  58003. var i = new n.SphereGeometry(t,4,2)
  58004. , r = new n.MeshBasicMaterial({
  58005. wireframe: !0,
  58006. fog: !1
  58007. });
  58008. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58009. n.Mesh.call(this, i, r),
  58010. this.matrix = this.light.matrixWorld,
  58011. this.matrixAutoUpdate = !1
  58012. }
  58013. ,
  58014. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58015. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58016. n.PointLightHelper.prototype.dispose = function() {
  58017. this.geometry.dispose(),
  58018. this.material.dispose()
  58019. }
  58020. ,
  58021. n.PointLightHelper.prototype.update = function() {
  58022. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58023. }
  58024. ,
  58025. n.SkeletonHelper = function(e) {
  58026. this.bones = this.getBoneList(e);
  58027. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58028. var r = this.bones[i];
  58029. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58030. t.vertices.push(new n.Vector3),
  58031. t.colors.push(new n.Color(0,0,1)),
  58032. t.colors.push(new n.Color(0,1,0)))
  58033. }
  58034. t.dynamic = !0;
  58035. var o = new n.LineBasicMaterial({
  58036. vertexColors: n.VertexColors,
  58037. depthTest: !1,
  58038. depthWrite: !1,
  58039. transparent: !0
  58040. });
  58041. n.LineSegments.call(this, t, o),
  58042. this.root = e,
  58043. this.matrix = e.matrixWorld,
  58044. this.matrixAutoUpdate = !1,
  58045. this.update()
  58046. }
  58047. ,
  58048. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58049. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58050. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58051. var t = [];
  58052. e instanceof n.Bone && t.push(e);
  58053. for (var i = 0; i < e.children.length; i++)
  58054. t.push.apply(t, this.getBoneList(e.children[i]));
  58055. return t
  58056. }
  58057. ,
  58058. n.SkeletonHelper.prototype.update = function() {
  58059. 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++) {
  58060. var a = this.bones[o];
  58061. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58062. e.vertices[r].setFromMatrixPosition(i),
  58063. i.multiplyMatrices(t, a.parent.matrixWorld),
  58064. e.vertices[r + 1].setFromMatrixPosition(i),
  58065. r += 2)
  58066. }
  58067. e.verticesNeedUpdate = !0,
  58068. e.computeBoundingSphere()
  58069. }
  58070. ,
  58071. n.SpotLightHelper = function(e) {
  58072. n.Object3D.call(this),
  58073. this.light = e,
  58074. this.light.updateMatrixWorld(),
  58075. this.matrix = e.matrixWorld,
  58076. this.matrixAutoUpdate = !1;
  58077. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58078. t.translate(0, -.5, 0),
  58079. t.rotateX(-Math.PI / 2);
  58080. var i = new n.MeshBasicMaterial({
  58081. wireframe: !0,
  58082. fog: !1
  58083. });
  58084. this.cone = new n.Mesh(t,i),
  58085. this.add(this.cone),
  58086. this.update()
  58087. }
  58088. ,
  58089. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58090. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58091. n.SpotLightHelper.prototype.dispose = function() {
  58092. this.cone.geometry.dispose(),
  58093. this.cone.material.dispose()
  58094. }
  58095. ,
  58096. n.SpotLightHelper.prototype.update = function() {
  58097. var e = new n.Vector3
  58098. , t = new n.Vector3;
  58099. return function() {
  58100. var i = this.light.distance ? this.light.distance : 1e4
  58101. , n = i * Math.tan(this.light.angle);
  58102. this.cone.scale.set(n, n, i),
  58103. e.setFromMatrixPosition(this.light.matrixWorld),
  58104. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58105. this.cone.lookAt(t.sub(e)),
  58106. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58107. }
  58108. }(),
  58109. n.VertexNormalsHelper = function(e, t, i, r) {
  58110. this.object = e,
  58111. this.size = void 0 !== t ? t : 1;
  58112. var o = void 0 !== i ? i : 16711680
  58113. , a = void 0 !== r ? r : 1
  58114. , s = 0
  58115. , l = this.object.geometry;
  58116. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58117. var c = new n.BufferGeometry
  58118. , h = new n.Float32Attribute(2 * s * 3,3);
  58119. c.addAttribute("position", h),
  58120. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58121. color: o,
  58122. linewidth: a
  58123. })),
  58124. this.matrixAutoUpdate = !1,
  58125. this.update()
  58126. }
  58127. ,
  58128. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58129. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58130. n.VertexNormalsHelper.prototype.update = function() {
  58131. var e = new n.Vector3
  58132. , t = new n.Vector3
  58133. , i = new n.Matrix3;
  58134. return function() {
  58135. var r = ["a", "b", "c"];
  58136. this.object.updateMatrixWorld(!0),
  58137. i.getNormalMatrix(this.object.matrixWorld);
  58138. var o = this.object.matrixWorld
  58139. , a = this.geometry.attributes.position
  58140. , s = this.object.geometry;
  58141. if (s instanceof n.Geometry)
  58142. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58143. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58144. var m = l[p[r[f]]]
  58145. , v = p.vertexNormals[f];
  58146. e.copy(m).applyMatrix4(o),
  58147. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58148. a.setXYZ(h, e.x, e.y, e.z),
  58149. h += 1,
  58150. a.setXYZ(h, t.x, t.y, t.z),
  58151. h += 1
  58152. }
  58153. else if (s instanceof n.BufferGeometry)
  58154. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58155. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58156. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58157. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58158. a.setXYZ(h, e.x, e.y, e.z),
  58159. h += 1,
  58160. a.setXYZ(h, t.x, t.y, t.z),
  58161. h += 1;
  58162. return a.needsUpdate = !0,
  58163. this
  58164. }
  58165. }(),
  58166. n.WireframeHelper = function(e, t) {
  58167. var i = void 0 !== t ? t : 16777215;
  58168. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58169. color: i
  58170. })),
  58171. this.matrix = e.matrixWorld,
  58172. this.matrixAutoUpdate = !1
  58173. }
  58174. ,
  58175. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58176. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58177. n.ImmediateRenderObject = function(e) {
  58178. n.Object3D.call(this),
  58179. this.material = e,
  58180. this.render = function(e) {}
  58181. }
  58182. ,
  58183. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58184. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58185. n.MorphBlendMesh = function(e, t) {
  58186. n.Mesh.call(this, e, t),
  58187. this.animationsMap = {},
  58188. this.animationsList = [];
  58189. var i = this.geometry.morphTargets.length
  58190. , r = "__default"
  58191. , o = 0
  58192. , a = i - 1
  58193. , s = i / 1;
  58194. this.createAnimation(r, o, a, s),
  58195. this.setAnimationWeight(r, 1)
  58196. }
  58197. ,
  58198. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58199. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58200. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58201. var r = {
  58202. start: t,
  58203. end: i,
  58204. length: i - t + 1,
  58205. fps: n,
  58206. duration: (i - t) / n,
  58207. lastFrame: 0,
  58208. currentFrame: 0,
  58209. active: !1,
  58210. time: 0,
  58211. direction: 1,
  58212. weight: 1,
  58213. directionBackwards: !1,
  58214. mirroredLoop: !1
  58215. };
  58216. this.animationsMap[e] = r,
  58217. this.animationsList.push(r)
  58218. }
  58219. ,
  58220. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58221. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58222. var s = r.morphTargets[o]
  58223. , l = s.name.match(i);
  58224. if (l && l.length > 1) {
  58225. var c = l[1];
  58226. n[c] || (n[c] = {
  58227. start: 1 / 0,
  58228. end: -(1 / 0)
  58229. });
  58230. var h = n[c];
  58231. o < h.start && (h.start = o),
  58232. o > h.end && (h.end = o),
  58233. t || (t = c)
  58234. }
  58235. }
  58236. for (var c in n) {
  58237. var h = n[c];
  58238. this.createAnimation(c, h.start, h.end, e)
  58239. }
  58240. this.firstAnimation = t
  58241. }
  58242. ,
  58243. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58244. var t = this.animationsMap[e];
  58245. t && (t.direction = 1,
  58246. t.directionBackwards = !1)
  58247. }
  58248. ,
  58249. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58250. var t = this.animationsMap[e];
  58251. t && (t.direction = -1,
  58252. t.directionBackwards = !0)
  58253. }
  58254. ,
  58255. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58256. var i = this.animationsMap[e];
  58257. i && (i.fps = t,
  58258. i.duration = (i.end - i.start) / i.fps)
  58259. }
  58260. ,
  58261. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58262. var i = this.animationsMap[e];
  58263. i && (i.duration = t,
  58264. i.fps = (i.end - i.start) / i.duration)
  58265. }
  58266. ,
  58267. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58268. var i = this.animationsMap[e];
  58269. i && (i.weight = t)
  58270. }
  58271. ,
  58272. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58273. var i = this.animationsMap[e];
  58274. i && (i.time = t)
  58275. }
  58276. ,
  58277. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58278. var t = 0
  58279. , i = this.animationsMap[e];
  58280. return i && (t = i.time),
  58281. t
  58282. }
  58283. ,
  58284. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58285. var t = -1
  58286. , i = this.animationsMap[e];
  58287. return i && (t = i.duration),
  58288. t
  58289. }
  58290. ,
  58291. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58292. var t = this.animationsMap[e];
  58293. t ? (t.time = 0,
  58294. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58295. }
  58296. ,
  58297. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58298. var t = this.animationsMap[e];
  58299. t && (t.active = !1)
  58300. }
  58301. ,
  58302. n.MorphBlendMesh.prototype.update = function(e) {
  58303. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58304. var r = this.animationsList[t];
  58305. if (r.active) {
  58306. var o = r.duration / r.length;
  58307. r.time += r.direction * e,
  58308. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58309. r.time > r.duration && (r.time = r.duration,
  58310. r.directionBackwards = !0),
  58311. r.time < 0 && (r.time = 0,
  58312. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58313. r.time < 0 && (r.time += r.duration));
  58314. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58315. , s = r.weight;
  58316. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58317. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58318. this.morphTargetInfluences[a] = 0,
  58319. r.lastFrame = r.currentFrame,
  58320. r.currentFrame = a);
  58321. var l = r.time % o / o;
  58322. r.directionBackwards && (l = 1 - l),
  58323. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58324. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58325. }
  58326. }
  58327. }
  58328. ,
  58329. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58330. i.THREE = n) : this.THREE = n
  58331. window.THREE = n
  58332. getObjLoader()
  58333. initByTHREE(THREE)
  58334. }
  58335. , {}]
  58336. }, {}, [116]);
  58337. class PanTransGuide{
  58338. constructor(player){
  58339. this.player = player
  58340. this.currentIndex = 0
  58341. this.getNodes()
  58342. }
  58343. /* getNodes(){ //根据提供的点位,自动连起来,一点点平移过去
  58344. this.nodes = []
  58345. let path = this.player.path
  58346. let last
  58347. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58348. if(index>-1){
  58349. let locations = this.player.model.heroLocations[index].heroLocations
  58350. this.player.model.heroLocations.splice(index,1)
  58351. }
  58352. let get = (e, originItem)=>{
  58353. if(e.cameraMode != 'panorama'){
  58354. e.originItem = originItem
  58355. this.nodes.push(e)
  58356. return last = null //断连
  58357. }
  58358. if(last){
  58359. e.visited = true
  58360. path.setWarpDestination(e)
  58361. path.setWarpDestPano()
  58362. let A = path.getHeroPano(last),
  58363. B = path.warpDestPano
  58364. if(e.momentTour == 'black' && A!=B){
  58365. path.nodes = [A.id,B.id];//直接加入
  58366. }else{
  58367. path.nodes = path.findShortestPath(A, B)
  58368. if(path.nodes == null){//两个点之间不相通
  58369. console.log('两个点之间不相通',A.id,B.id)
  58370. path.nodes = [A.id,B.id];//直接加入
  58371. }
  58372. }
  58373. let wholeDis = 0, disSections = []
  58374. path.nodes.forEach((cur,i)=>{
  58375. if(i==0)return
  58376. let prePano = this.player.model.panos.get(path.nodes[i-1])
  58377. let curPano = this.player.model.panos.get(cur)
  58378. let dis = prePano.position.distanceTo(curPano.position)
  58379. disSections.push(dis)
  58380. wholeDis += dis
  58381. },0)
  58382. let quaStart = last.quaternion
  58383. let quaEnd = e.quaternion
  58384. path.nodes.forEach((panoId,j)=>{
  58385. if(j == 0){
  58386. if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
  58387. if(!last) return //和上一段末尾重复
  58388. return this.nodes.push({panoId,quaternion:quaStart})
  58389. }
  58390. let r = disSections[j-1] / wholeDis
  58391. let quaternion = quaStart.clone()
  58392. lerp.quaternion(quaternion, quaEnd)(r)
  58393. this.nodes.push({panoId, quaternion})
  58394. })
  58395. }
  58396. last = e
  58397. }
  58398. this.player.model.heroLocations.forEach((e,i)=>{
  58399. if(e.heroLocations){
  58400. e.heroLocations.forEach((a,j)=> get(a, [i,j]))
  58401. }else{
  58402. get(e,[i,0])
  58403. }
  58404. })
  58405. //补 因为last前一个可能不是panorama,导致last没加进nodes
  58406. if(last && !last.visited){
  58407. get(last)
  58408. }
  58409. } */
  58410. getNodes(){//提取每个区域的第一个点,然后在这些点间瞬移
  58411. this.nodes = []
  58412. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58413. if(index>-1){
  58414. let locations = this.player.model.heroLocations[index].heroLocations
  58415. this.player.model.heroLocations.splice(index,1)
  58416. }
  58417. /* let get = (e,originItem)=>{
  58418. if(e.cameraMode != 'panorama'){
  58419. return
  58420. }
  58421. this.nodes.push(e)
  58422. }
  58423. //仅使用每个导览区域第一个的版本
  58424. this.player.model.heroLocations.forEach((e,i)=>{ //按片段每个都使用的版本
  58425. if(e.heroLocations){
  58426. get(e.heroLocations[0],[i,0])
  58427. }else{
  58428. get(e,[i,0])
  58429. }
  58430. }) */
  58431. }
  58432. go(axis, interrupt){//仅使用每个导览区域第一个的版本
  58433. if(this.player.flying)return
  58434. let aimNode
  58435. let cur = this.nodes[this.currentIndex]
  58436. /* if(cur.panoId != this.player.currentPano.id && player.mode == 'panorama'){//已走动){//已走动
  58437. let curs = this.nodes.filter(e=>e.panoId == this.player.currentPano)
  58438. curs.sort((a,b)=>{ //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  58439. let indexA = this.nodes.indexOf(a)
  58440. let indexB = this.nodes.indexOf(b)
  58441. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  58442. })
  58443. cur = curs[0]
  58444. if(!cur){//不在道上 . 找离当前位置最近的node
  58445. let disMap = new Map
  58446. let nodes_ = this.nodes.filter(e=>!e.originItem)
  58447. nodes_.forEach(e=>{
  58448. disMap.set(e,player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  58449. })
  58450. let sorted = nodes_.slice().sort((a,b)=>{
  58451. return disMap.get(a) - disMap.get(b)
  58452. })
  58453. this.currentIndex = this.nodes.indexOf(sorted[0])//next
  58454. if(axis == -1){
  58455. this.moveIndex(-1)
  58456. }
  58457. aimNode = this.nodes[this.currentIndex]
  58458. }
  58459. }
  58460. let lastIndex = this.currentIndex
  58461. if(!aimNode){
  58462. this.moveIndex(axis)
  58463. aimNode = this.nodes[this.currentIndex]
  58464. }
  58465. if(aimNode.originItem){//要飞出的,直接用导览飞
  58466. player.director.setDestinationItem(aimNode.originItem)
  58467. player.director.goToDestination()
  58468. return
  58469. }
  58470. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  58471. let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58472. this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
  58473. //更新导览进度条 //已转移
  58474. //player.director.setCurrentItem( player.director.findNearestItem(true,true) )
  58475. })
  58476. */
  58477. let director = player.director
  58478. let destItem
  58479. /*if(axis == 1){
  58480. destItem = director.nextItem(director.currentItem)
  58481. }else{
  58482. destItem = director.prevItem(director.currentItem)
  58483. } */
  58484. let dest = (director.currentItem[0]+axis + player.model.heroLocations.length ) % player.model.heroLocations.length
  58485. destItem = [dest,0]
  58486. let location = player.model.getHeroDescriptorByIndex(destItem)
  58487. if(location.panoId != void 0 && location.panoId != "outside"){
  58488. let moveStyle = (director.currentItem[0] == 0 && director.currentItem[1] == 0 && axis == -1 || destItem[0] == 0 && destItem[1] == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58489. player[moveStyle]({pano: player.model.panos.get(location.panoId), quaternion:location.quaternion},()=>{
  58490. interrupt && setTimeout(()=>{director.playTour(),1})
  58491. })
  58492. }else{//如果飞出就直接执行导览的
  58493. if(axis == 1){
  58494. director.goNext(director.currentItem)
  58495. }else{
  58496. director.goPrev(director.currentItem)
  58497. }
  58498. interrupt && player.director.once("tour.end",()=>{
  58499. setTimeout(()=>{director.playTour(),1})
  58500. })
  58501. }
  58502. }
  58503. moveIndex(step){
  58504. this.currentIndex += (step + this.nodes.length)
  58505. this.currentIndex %= this.nodes.length
  58506. return this.currentIndex
  58507. }
  58508. }
  58509. //2025新的需求 沉浸看展直接使用导览
  58510. window.tourPlayCtl = {
  58511. go(axis){
  58512. let interrupt = player.director.wouldInterrupt()
  58513. if (interrupt){
  58514. //不执行
  58515. player.director.once("tour.end",()=>{
  58516. setTimeout(()=>{
  58517. player.guider2.go(axis, interrupt)
  58518. },100) //立即执行会一直loading,不知为啥
  58519. })
  58520. player.director.redirectToItem(player.director.destinationItem, "goToHighlight");
  58521. }else{
  58522. player.guider2.go(axis)
  58523. }
  58524. }
  58525. }
  58526. /* window.tourPlayCtl = {
  58527. go(axis){
  58528. let director = player.director
  58529. let path = player.path
  58530. director.setCurrentItem(player.director.findNearestItem(true,true))
  58531. let destItem
  58532. if(axis == 1){
  58533. destItem = director.nextItem(director.currentItem)
  58534. }else{
  58535. destItem = director.prevItem(director.currentItem)
  58536. }
  58537. let location = player.model.getHeroDescriptorByIndex(destItem)
  58538. if(location.panoId != void 0 && location.panoId != "outside"){
  58539. let moveStyle = (director.currentItem[0] == 0 && director.currentItem[1] == 0 && axis == -1 || destItem[0] == 0 && destItem[1] == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58540. player[moveStyle]({pano: player.model.panos.get(location.panoId), quaternion:location.quaternion})
  58541. }else{//如果飞出就直接执行导览的
  58542. if(axis == 1){
  58543. director.goNext(director.currentItem)
  58544. }else{
  58545. director.goPrev(director.currentItem)
  58546. }
  58547. }
  58548. }
  58549. }
  58550. */
  58551. class UserGuide{//由音乐来控制自动播放,音乐开着就当音乐播完自动下一个区域,否则不动。
  58552. constructor(player){
  58553. let lastCurItem
  58554. this.currentItem = [0,0]
  58555. this.player = player
  58556. this.pausedByBtn = true //音乐和自动播放是否暂停
  58557. SoundManager.list.find(e=>e.name == 'tour').audio.addEventListener('ended', ()=>{
  58558. player.director.tourIsPlaying && this.go(1) //下一个点
  58559. });
  58560. player.on("flying.ended",(a,b,pano,d)=>{
  58561. //更新导览进度条 导览片段的选中与当前点位所属片段对应。
  58562. this.setCurrentItem( player.director.findNearestItem(true,true) )
  58563. })
  58564. /* player.director.on("update.controls", ()=>{ //更新了currentItem的话
  58565. if(player.director.itemCompare(lastCurItem, player.director.currentItem,'equal' )) return
  58566. lastCurItem = player.director.currentItem?.slice()
  58567. if(!player.director.tourIsPlaying){
  58568. if(this.pausedByBtn) return
  58569. else this.play()
  58570. }
  58571. let curItem = player.model.getHeroDescriptorByIndex(player.director.currentItem)
  58572. if(player.currentPano.id == curItem.panoId){
  58573. this.setMusic()
  58574. }else{//走到了导览以外的区域
  58575. this.pause(false)//SoundManager.pause('tour')
  58576. }
  58577. }) */
  58578. player.director.playTourNearBy = this.play.bind(this)
  58579. player.director.stopTour = this.pause.bind(this)
  58580. }
  58581. setCurrentItem(item){
  58582. if(player.director.itemCompare(item, this.currentItem,'equal' )) return
  58583. //lastCurItem = player.director.currentItem?.slice()
  58584. console.log('setCurrentItem', item)
  58585. this.currentItem = item
  58586. let curItem = player.model.getHeroDescriptorByIndex(item)
  58587. if(player.currentPano.id == curItem.panoId){
  58588. player.director.setCurrentItem(item)//无论是否在导览页面、是否开启音乐都设置
  58589. //if(!player.director.tourIsPlaying){
  58590. if(this.pausedByBtn) return
  58591. else this.play()
  58592. //}
  58593. //this.setMusic()
  58594. }else{//走到了导览以外的区域 要取消高亮item
  58595. player.director.setCurrentItem(null)
  58596. this.pause(false)//SoundManager.pause('tour')
  58597. }
  58598. }
  58599. play(){
  58600. //从当前index开始播放,如果在导览区域,就在当前点播音乐,如果不是就跳到当前导览区域第一个点
  58601. //假定导览都在漫游模式 //假设不同导览区域不存在相同漫游点
  58602. this.pausedByBtn = false
  58603. let curItem = player.model.getHeroDescriptorByIndex(player.director.currentItem || [0,0])
  58604. let playMusic = ()=>{
  58605. this.setMusic()
  58606. }
  58607. if(player.currentPano.id != curItem.panoId){
  58608. player.flyToPano({pano: player.model.panos.get(curItem.panoId), quaternion:curItem.quaternion},()=>{
  58609. playMusic()
  58610. })
  58611. }else{
  58612. playMusic()
  58613. }
  58614. player.director.tourInProgress = player.director.tourIsPlaying = true
  58615. player.director.emit("update.controls")
  58616. }
  58617. pause(byBtn=true){
  58618. SoundManager.pause('tour')
  58619. player.director.tourInProgress = player.director.tourIsPlaying = false
  58620. player.director.emit("update.controls")
  58621. if(byBtn)this.pausedByBtn = true
  58622. }
  58623. go(axis){
  58624. let length = player.model.heroLocations.length
  58625. let cur = this.currentItem
  58626. let next = [(cur[0]+axis+length) % length, 0]
  58627. let nextItem = player.model.getHeroDescriptorByIndex(next)
  58628. player.flyToPano({pano: player.model.panos.get(nextItem.panoId), quaternion:nextItem.quaternion},()=>{
  58629. //this.setMusic()
  58630. })
  58631. Hot.closePopup();
  58632. }
  58633. setMusic(){
  58634. var musicInfo = player.model.heroLocations[player.director.currentItem[0]].musicInfo
  58635. if(!settings.tourSoundUnable && musicInfo && musicInfo.music ){
  58636. let musicType = localStorage.getItem('xunirole') || 'male'
  58637. let isMale = musicType.indexOf('female') < 0
  58638. let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
  58639. let src = fixMusic
  58640. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  58641. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  58642. let audioSrc2 = common.getFileNameFromUrl(src)
  58643. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  58644. /* if(player.director.currentItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  58645. SoundManager.play('tour',null,0) // currentTime = 0;
  58646. }else*/ if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  58647. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  58648. }
  58649. }else{//很可能是该folder的起始 */
  58650. SoundManager.play('tour', manage.dealURL(src))
  58651. }
  58652. }
  58653. }
  58654. }
  58655. window.tourPlayCtl = {
  58656. go(axis){
  58657. player.guider3.go(axis)
  58658. }
  58659. }
  58660. /*
  58661. warpTravel_BLACK =
  58662. ype.goToHighlight = fun
  58663. 20250306客户需求确认如下,前4点为改动:
  58664. 1、按当前的导览路线,每个展位只展示第一片段【不要自动旋转】,不播放其它导览片段;
  58665. 2、导览音频播放过程中用户可转动画面、切换点位、展开热点(热点无音频);
  58666. 3、在同一导览的不同点位之间切换时,导览音频继续讲解(导览配置多个点位的片段);
  58667. 4、播放导览音频,音频播放完自动进入下一导览(讲解展位);
  58668. 5、点击前进后退还是切换讲解展位;
  58669. 6、点击到路线之外的点位,讲解音频暂停;
  58670. 昨天说的背景音乐的屏蔽,也要做的。这样就不会有音频按钮的问题了
  58671. */