main_2020_show.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. var convertTool = {
  5. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  6. var camera = camera || player.camera;
  7. var dom = dom || player.domElement;
  8. 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);
  9. var x,y;
  10. x = (pos.x + 1) / 2 * dom.clientWidth;
  11. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  12. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  13. && y <= dom.clientHeight && y >= 0
  14. return {
  15. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  16. vector: pos, //(范围 -1 ~ 1)
  17. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  18. inSight : inSight //在屏幕范围内可见
  19. };
  20. },
  21. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  22. var ori = player.position
  23. var dir = pos3d.clone().sub(ori).normalize()
  24. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  25. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  26. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  27. }else{ */
  28. var o = ray.intersectObjects(player.model.colliders);
  29. //}
  30. var len = pos3d.distanceTo(ori);
  31. if (o && o.length) {
  32. for(var i=0;i<o.length;i++){
  33. if(o[i].distance < len){ return true; }//有遮挡
  34. }
  35. }
  36. },
  37. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  38. var dir = B.clone().sub(A).normalize();
  39. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  40. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  41. var o = ray.intersectObjects(options.model || player.model.colliders);
  42. if (o && o.length)return o;
  43. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  44. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  45. normal.multiplyScalar(options.throughWidth)
  46. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  47. var A2 = A.clone().add(normalVec3)
  48. ray.set(A2, dir);
  49. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  50. ray.set(A.clone().add(normalVec3.negate()), dir);
  51. if (o2 && o2.length)return o2;
  52. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  53. if (o3 && o3.length)return o3;
  54. }
  55. return null;
  56. }
  57. }
  58. var getTransformSid = function(){
  59. var name
  60. if(player.mode == 'panorama'){
  61. name = player.currentPano ? player.currentPano.id : 'outside'
  62. }else{
  63. name = 'outside'
  64. }
  65. return name
  66. }
  67. var createEnterLogo = function(){
  68. var entryTex = Texture.load("images/enter.png", ()=>{
  69. player.controlEntryOpacity({on:true, entryShowing:true})
  70. })
  71. var plane = new THREE.Mesh(new THREE.PlaneBufferGeometry(1,1,1,1), new THREE.MeshBasicMaterial({
  72. transparent:true,
  73. map : entryTex,
  74. opacity:0,
  75. color: new THREE.Color(229/255,220/255,180/255),
  76. }))
  77. window.enterObjects = new THREE.Object3D;
  78. enterObjects.position.set(-23.611102870311473, 4.6692603935021335, -0.800100018978118)//(-34.301849651636786, 5.301961727741601, 20.08320022583008)
  79. enterObjects.add(plane);
  80. //player.model.add(enterObjects)
  81. player.overlayGroup.add(enterObjects)
  82. }
  83. var entryShowing = false;
  84. var _entryOpacityId = 999
  85. /* var updateEntryShowing = function(){
  86. var maxDis = 22;
  87. var show = player.position.distanceTo(enterObjects.position)<maxDis
  88. if(show && !entryShowing) player.controlEntryOpacity({on:true, entryShowing:true})
  89. else if(!show && entryShowing) player.controlEntryOpacity({on:false, entryShowing:false})
  90. } */
  91. /* n.prototype.controlEntryOpacity = function(o){
  92. if(op.entryShowing!=void 0) entryShowing = op.entryShowing
  93. if(entryShowing && !o.on)return
  94. var startOpa = enterObjects.children[0].material.opacity;
  95. var aimOpa = o.on ? 1 : 0.5
  96. y.cancelById(_entryOpacityId);
  97. y.start((progress)=>{
  98. var opa = startOpa * (1-progress) + o.opacity * progress
  99. enterObjects.children.forEach(plane=>{
  100. plane.material.opacity = opa
  101. })
  102. }, 1000, ()=>{//done
  103. if(entryShowing){
  104. this.controlEntryOpacity({on:!o.on})
  105. }
  106. }, 0, f.transition.movementEasing, null, _entryOpacityId);
  107. } */
  108. var dom = {//许钟文add
  109. getOffset: function(type, element, parent) {
  110. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  111. if (!parent) parent = $("body")[0];
  112. while (element = element.offsetParent) {
  113. if (element == parent) break;
  114. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  115. }
  116. return left;
  117. }
  118. };
  119. !function() {
  120. "use strict";
  121. function t(t, i) {
  122. return typeof t === i
  123. }
  124. function i(t, i) {
  125. return t instanceof i
  126. }
  127. function n(t) {
  128. return t && t.nodeType
  129. }
  130. function e(t) {
  131. return n(t) ? t : i(t, g) ? t[0] : void 0
  132. }
  133. function o(t, i, n) {
  134. return g.each(t, function(t, e) {
  135. n = i.call(e, n, t, e)
  136. }),
  137. n
  138. }
  139. function r(t, i, n) {
  140. var e, o, r;
  141. if (t === i)
  142. return !0;
  143. if (!t || !i || t.constructor !== i.constructor)
  144. return !1;
  145. for (e = 0,
  146. o = n.length; o > e; e += 1) {
  147. if (r = n[e],
  148. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  149. return !1;
  150. if (t[r] !== i[r])
  151. return !1
  152. }
  153. return !0
  154. }
  155. function s(t, i, n, e) {
  156. this.left = E(t),
  157. this.top = E(i),
  158. this.width = E(n),
  159. this.height = E(e),
  160. this.right = this.left + this.width,
  161. this.bottom = this.top + this.height
  162. }
  163. function h(t, i, n, e) {
  164. this.visible = t || 0,
  165. this.viewport = i || 0,
  166. this.possible = n || 0,
  167. this.rects = e && T({}, e) || null
  168. }
  169. function l(t, i) {
  170. this.els = t,
  171. this.viewport = i
  172. }
  173. function c(t, i, n) {
  174. var e;
  175. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  176. e ? e[n] : 0
  177. }
  178. function u(t, i) {
  179. return t.val - i.val
  180. }
  181. function a(t, i) {
  182. return i.val - t.val
  183. }
  184. function f(t) {
  185. var i = s.ofContent(t, !0)
  186. , n = s.ofViewport(t, !0)
  187. , e = i.width - n.width
  188. , o = i.height - n.height;
  189. this.content = i,
  190. this.viewport = n,
  191. this.width = 0 >= e ? null : n.left / e,
  192. this.height = 0 >= o ? null : n.top / o,
  193. this.left = n.left,
  194. this.top = n.top,
  195. this.right = i.right - n.right,
  196. this.bottom = i.bottom - n.bottom
  197. }
  198. function p(t) {
  199. this.el = t || window
  200. }
  201. function d(t, i) {
  202. this.context = t,
  203. this.viewport = i,
  204. this.init()
  205. }
  206. function v(t, i, n, e) {
  207. this.context = new l(t,i),
  208. this.property = n,
  209. this.descending = e,
  210. this.init()
  211. }
  212. function w(t) {
  213. t && t !== window && t !== document ? (this.context = t,
  214. this.$autoTarget = g(t)) : this.context = window,
  215. this.init()
  216. }
  217. var g = jQuery
  218. , m = g(window)
  219. , b = g(document)
  220. , T = g.extend
  221. , y = g.isFunction
  222. , k = Math.max
  223. , V = Math.min
  224. , E = Math.round
  225. , x = function() {
  226. var t = {}
  227. , i = 1;
  228. return function(n) {
  229. return n ? (t[n] || (t[n] = i,
  230. i += 1),
  231. t[n]) : 0
  232. }
  233. }();
  234. T(s.prototype, {
  235. equals: function(t) {
  236. return r(this, t, ["left", "top", "width", "height"])
  237. },
  238. area: function() {
  239. return this.width * this.height
  240. },
  241. relativeTo: function(t) {
  242. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  243. },
  244. intersection: function(t) {
  245. if (!i(t, s))
  246. return null;
  247. var n = k(this.left, t.left)
  248. , e = V(this.right, t.right)
  249. , o = k(this.top, t.top)
  250. , r = V(this.bottom, t.bottom)
  251. , h = e - n
  252. , l = r - o;
  253. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  254. },
  255. envelope: function(t) {
  256. if (!i(t, s))
  257. return this;
  258. var n = V(this.left, t.left)
  259. , e = k(this.right, t.right)
  260. , o = V(this.top, t.top)
  261. , r = k(this.bottom, t.bottom)
  262. , h = e - n
  263. , l = r - o;
  264. return new s(n,o,h,l)
  265. }
  266. }),
  267. T(s, {
  268. ofContent: function(t, i) {
  269. 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())
  270. },
  271. ofViewport: function(t, i) {
  272. 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())
  273. },
  274. ofElement: function(t) {
  275. var i = g(t);
  276. if (!i.is(":visible"))
  277. return null;
  278. var n = i.offset();
  279. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  280. }
  281. }),
  282. T(h.prototype, {
  283. equals: function(t) {
  284. return this.fracsEqual(t) && this.rectsEqual(t)
  285. },
  286. fracsEqual: function(t) {
  287. return r(this, t, ["visible", "viewport", "possible"])
  288. },
  289. rectsEqual: function(t) {
  290. return r(this.rects, t.rects, ["document", "element", "viewport"])
  291. }
  292. }),
  293. T(h, {
  294. of: function(t, i) {
  295. var e, o, r;
  296. return t = n(t) && s.ofElement(t) || t,
  297. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  298. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  299. r = V(t.width, i.width) * V(t.height, i.height),
  300. new h(o / t.area(),o / i.area(),o / r,{
  301. document: e,
  302. element: e.relativeTo(t),
  303. viewport: e.relativeTo(i)
  304. })) : new h
  305. }
  306. });
  307. var q = ["width", "height", "left", "right", "top", "bottom"]
  308. , S = ["possible", "visible", "viewport"];
  309. T(l.prototype, {
  310. sorted: function(t, i) {
  311. var n = this.viewport;
  312. return g.map(this.els, function(i) {
  313. return {
  314. el: i,
  315. val: c(i, n, t)
  316. }
  317. }).sort(i ? a : u)
  318. },
  319. best: function(t, i) {
  320. return this.els.length ? this.sorted(t, i)[0] : null
  321. }
  322. }),
  323. T(f.prototype, {
  324. equals: function(t) {
  325. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  326. }
  327. }),
  328. T(p.prototype, {
  329. equals: function(t) {
  330. return r(this, t, ["el"])
  331. },
  332. scrollState: function() {
  333. return new f(this.el)
  334. },
  335. scrollTo: function(t, i, n) {
  336. var e = g(this.el === window ? "html,body" : this.el);
  337. t = t || 0,
  338. i = i || 0,
  339. n = isNaN(n) ? 1e3 : n,
  340. e.stop(!0).animate({
  341. scrollLeft: t,
  342. scrollTop: i
  343. }, n)
  344. },
  345. scroll: function(t, i, n) {
  346. var e = this.el === window ? m : g(this.el);
  347. t = t || 0,
  348. i = i || 0,
  349. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  350. },
  351. scrollToRect: function(t, i, n, e) {
  352. i = i || 0,
  353. n = n || 0,
  354. this.scrollTo(t.left - i, t.top - n, e)
  355. },
  356. scrollToElement: function(t, i, n, e) {
  357. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  358. this.scrollToRect(o, i, n, e)
  359. }
  360. });
  361. var C = {
  362. init: function() {
  363. this.callbacks = g.Callbacks("memory unique"),
  364. this.currVal = null,
  365. this.prevVal = null,
  366. this.checkProxy = g.proxy(this.check, this),
  367. this.autoCheck()
  368. },
  369. bind: function(t) {
  370. this.callbacks.add(t)
  371. },
  372. unbind: function(t) {
  373. t ? this.callbacks.remove(t) : this.callbacks.empty()
  374. },
  375. trigger: function() {
  376. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  377. },
  378. check: function(t) {
  379. var i = this.updatedValue(t);
  380. return void 0 !== i && (this.prevVal = this.currVal,
  381. this.currVal = i,
  382. this.trigger(),
  383. !0)
  384. },
  385. $autoTarget: m,
  386. autoEvents: "load resize scroll",
  387. autoCheck: function(t) {
  388. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  389. }
  390. };
  391. T(d.prototype, C, {
  392. updatedValue: function() {
  393. var t = h.of(this.context, this.viewport);
  394. return this.currVal && this.currVal.equals(t) ? void 0 : t
  395. }
  396. }),
  397. T(v.prototype, C, {
  398. updatedValue: function() {
  399. var t = this.context.best(this.property, this.descending);
  400. return t && (t = t.val > 0 ? t.el : null,
  401. this.currVal !== t) ? t : void 0
  402. }
  403. }),
  404. T(w.prototype, C, {
  405. updatedValue: function() {
  406. var t = new f(this.context);
  407. return this.currVal && this.currVal.equals(t) ? void 0 : t
  408. }
  409. });
  410. var L = function(t, i) {
  411. var n = [].slice
  412. , e = jQuery
  413. , o = e.extend
  414. , r = e.isFunction
  415. , s = o({}, i)
  416. , h = function(i, n, o, s) {
  417. return o = r(o) ? o.apply(i, n) : o,
  418. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  419. }
  420. , l = function() {
  421. return h(this, n.call(arguments), s.defaultStatic, l)
  422. }
  423. , c = function(t) {
  424. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  425. }
  426. , u = function(t) {
  427. t && (o(l, t.statics),
  428. o(c, t.methods)),
  429. l.modplug = u
  430. };
  431. u.prev = {
  432. statics: e[t],
  433. methods: e.fn[t]
  434. },
  435. u(i),
  436. e[t] = l,
  437. e.fn[t] = c
  438. }
  439. , M = "fracs";
  440. L(M, {
  441. statics: {
  442. version: "0.15.0",
  443. Rect: s,
  444. Fractions: h,
  445. Group: l,
  446. ScrollState: f,
  447. Viewport: p,
  448. FracsCallbacks: d,
  449. GroupCallbacks: v,
  450. ScrollStateCallbacks: w,
  451. fracs: function(t, i) {
  452. return h.of(t, i)
  453. }
  454. },
  455. methods: {
  456. content: function(t) {
  457. return this.length ? s.ofContent(this[0], t) : null
  458. },
  459. envelope: function() {
  460. return o(this, function(t) {
  461. var i = s.ofElement(this);
  462. return t ? t.envelope(i) : i
  463. })
  464. },
  465. fracs: function(i, n, o) {
  466. t(i, "string") || (o = n,
  467. n = i,
  468. i = null),
  469. y(n) || (o = n,
  470. n = null),
  471. o = e(o);
  472. var r = M + ".fracs." + x(o);
  473. return "unbind" === i ? this.each(function() {
  474. var t = g(this).data(r);
  475. t && t.unbind(n)
  476. }) : "check" === i ? this.each(function() {
  477. var t = g(this).data(r);
  478. t && t.check()
  479. }) : y(n) ? this.each(function() {
  480. var t = g(this)
  481. , i = t.data(r);
  482. i || (i = new d(this,o),
  483. t.data(r, i)),
  484. i.bind(n)
  485. }) : this.length ? h.of(this[0], o) : null
  486. },
  487. intersection: function() {
  488. return o(this, function(t) {
  489. var i = s.ofElement(this);
  490. return t ? t.intersection(i) : i
  491. })
  492. },
  493. max: function(t, i, n) {
  494. return y(i) || (n = i,
  495. i = null),
  496. n = e(n),
  497. i ? (new v(this,n,t,!0).bind(i),
  498. this) : this.pushStack(new l(this,n).best(t, !0).el)
  499. },
  500. min: function(t, i, n) {
  501. return y(i) || (n = i,
  502. i = null),
  503. n = e(n),
  504. i ? (new v(this,n,t).bind(i),
  505. this) : this.pushStack(new l(this,n).best(t).el)
  506. },
  507. rect: function() {
  508. return this.length ? s.ofElement(this[0]) : null
  509. },
  510. scrollState: function(i, n) {
  511. var e = M + ".scrollState";
  512. return t(i, "string") || (n = i,
  513. i = null),
  514. "unbind" === i ? this.each(function() {
  515. var t = g(this).data(e);
  516. t && t.unbind(n)
  517. }) : "check" === i ? this.each(function() {
  518. var t = g(this).data(e);
  519. t && t.check()
  520. }) : y(n) ? this.each(function() {
  521. var t = g(this)
  522. , i = t.data(e);
  523. i || (i = new w(this),
  524. t.data(e, i)),
  525. i.bind(n)
  526. }) : this.length ? new f(this[0]) : null
  527. },
  528. scroll: function(t, i, n) {
  529. return this.each(function() {
  530. new p(this).scroll(t, i, n)
  531. })
  532. },
  533. scrollTo: function(t, i, n, o) {
  534. return g.isNumeric(t) && (o = n,
  535. n = i,
  536. i = t,
  537. t = null),
  538. t = e(t),
  539. this.each(function() {
  540. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  541. })
  542. },
  543. scrollToThis: function(t, i, n, o) {
  544. return o = new p(e(o)),
  545. o.scrollToElement(this[0], t, i, n),
  546. this
  547. },
  548. softLink: function(t, i, n, o) {
  549. return o = new p(e(o)),
  550. this.filter("a[href^=#]").each(function() {
  551. var e = g(this);
  552. e.on("click", function() {
  553. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  554. })
  555. })
  556. },
  557. sort: function(i, n, o) {
  558. return t(n, "boolean") || (o = n,
  559. n = null),
  560. o = e(o),
  561. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  562. return t.el
  563. }))
  564. },
  565. viewport: function(t) {
  566. return this.length ? s.ofViewport(this[0], t) : null
  567. }
  568. },
  569. defaultStatic: "fracs",
  570. defaultMethod: "fracs"
  571. })
  572. }();
  573. if ("undefined" == typeof jQuery)
  574. throw new Error("Bootstrap's JavaScript requires jQuery");
  575. +function(t) {
  576. "use strict";
  577. function e(e) {
  578. return this.each(function() {
  579. var o = t(this)
  580. , s = o.data("bs.tooltip")
  581. , n = "object" == typeof e && e;
  582. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  583. "string" == typeof e && s[e]())
  584. })
  585. }
  586. var i = function(t, e) {
  587. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  588. this.init("tooltip", t, e)
  589. };
  590. i.VERSION = "3.2.0",
  591. i.DEFAULTS = {
  592. animation: !0,
  593. placement: "top",
  594. selector: !1,
  595. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  596. trigger: "hover focus",
  597. title: "",
  598. delay: 0,
  599. html: !1,
  600. container: !1,
  601. viewport: {
  602. selector: "body",
  603. padding: 0
  604. }
  605. },
  606. i.prototype.init = function(e, i, o) {
  607. this.enabled = !0,
  608. this.type = e,
  609. this.$element = t(i),
  610. this.options = this.getOptions(o),
  611. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  612. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  613. var r = s[n];
  614. if ("click" == r)
  615. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  616. else if ("manual" != r) {
  617. var a = "hover" == r ? "mouseenter" : "focusin"
  618. , l = "hover" == r ? "mouseleave" : "focusout";
  619. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  620. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  621. }
  622. }
  623. this.options.selector ? this._options = t.extend({}, this.options, {
  624. trigger: "manual",
  625. selector: ""
  626. }) : this.fixTitle()
  627. }
  628. ,
  629. i.prototype.getDefaults = function() {
  630. return i.DEFAULTS
  631. }
  632. ,
  633. i.prototype.getOptions = function(e) {
  634. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  635. e.delay && "number" == typeof e.delay && (e.delay = {
  636. show: e.delay,
  637. hide: e.delay
  638. }),
  639. e
  640. }
  641. ,
  642. i.prototype.getDelegateOptions = function() {
  643. var e = {}
  644. , i = this.getDefaults();
  645. return this._options && t.each(this._options, function(t, o) {
  646. i[t] != o && (e[t] = o)
  647. }),
  648. e
  649. }
  650. ,
  651. i.prototype.enter = function(e) {
  652. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  653. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  654. t(e.currentTarget).data("bs." + this.type, i)),
  655. clearTimeout(i.timeout),
  656. i.hoverState = "in",
  657. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  658. // "in" == i.hoverState && i.show()
  659. }, i.options.delay.show)) : i.show()
  660. }
  661. ,
  662. i.prototype.leave = function(e) {
  663. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  664. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  665. t(e.currentTarget).data("bs." + this.type, i)),
  666. clearTimeout(i.timeout),
  667. i.hoverState = "out",
  668. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  669. "out" == i.hoverState && i.hide()
  670. }, i.options.delay.hide)) : i.hide()
  671. }
  672. ,
  673. i.prototype.show = function() {
  674. var e = t.Event("show.bs." + this.type);
  675. if (this.hasContent() && this.enabled) {
  676. this.$element.trigger(e);
  677. var i = t.contains(document.documentElement, this.$element[0]);
  678. if (e.isDefaultPrevented() || !i)
  679. return;
  680. var o = this
  681. , s = this.tip()
  682. , n = this.getUID(this.type);
  683. this.setContent(),
  684. s.attr("id", n),
  685. this.$element.attr("aria-describedby", n),
  686. this.options.animation && s.addClass("fade");
  687. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  688. , a = /\s?auto?\s?/i
  689. , l = a.test(r);
  690. l && (r = r.replace(a, "") || "top"),
  691. s.detach().css({
  692. top: 0,
  693. left: 0,
  694. display: "block"
  695. }).addClass(r).data("bs." + this.type, this),
  696. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  697. var p = this.getPosition()
  698. , h = s[0].offsetWidth
  699. , f = s[0].offsetHeight;
  700. if (l) {
  701. var u = r
  702. , c = this.$element.parent()
  703. , d = this.getPosition(c);
  704. 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,
  705. s.removeClass(u).addClass(r)
  706. }
  707. var g = this.getCalculatedOffset(r, p, h, f);
  708. this.applyPlacement(g, r);
  709. var y = function() {
  710. o.$element.trigger("shown.bs." + o.type),
  711. o.hoverState = null
  712. };
  713. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  714. }
  715. }
  716. ,
  717. i.prototype.applyPlacement = function(e, i) {
  718. var o = this.tip()
  719. , s = o[0].offsetWidth
  720. , n = o[0].offsetHeight
  721. , r = parseInt(o.css("margin-top"), 10)
  722. , a = parseInt(o.css("margin-left"), 10);
  723. isNaN(r) && (r = 0),
  724. isNaN(a) && (a = 0),
  725. e.top = e.top + r,
  726. e.left = e.left + a,
  727. t.offset.setOffset(o[0], t.extend({
  728. using: function(t) {
  729. o.css({
  730. top: Math.round(t.top),
  731. left: Math.round(t.left)
  732. })
  733. }
  734. }, e), 0),
  735. o.addClass("in");
  736. var l = o[0].offsetWidth
  737. , p = o[0].offsetHeight;
  738. "top" == i && p != n && (e.top = e.top + n - p);
  739. var h = this.getViewportAdjustedDelta(i, e, l, p);
  740. h.left ? e.left += h.left : e.top += h.top;
  741. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  742. , u = h.left ? "left" : "top"
  743. , c = h.left ? "offsetWidth" : "offsetHeight";
  744. o.offset(e),
  745. this.replaceArrow(f, o[0][c], u)
  746. }
  747. ,
  748. i.prototype.replaceArrow = function(t, e, i) {
  749. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  750. }
  751. ,
  752. i.prototype.setContent = function() {
  753. var t = this.tip()
  754. , e = this.getTitle();
  755. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  756. t.removeClass("fade in top bottom left right")
  757. }
  758. ,
  759. i.prototype.hide = function() {
  760. function e() {
  761. "in" != i.hoverState && o.detach(),
  762. i.$element.trigger("hidden.bs." + i.type)
  763. }
  764. var i = this
  765. , o = this.tip()
  766. , s = t.Event("hide.bs." + this.type);
  767. if (this.$element.removeAttr("aria-describedby"),
  768. this.$element.trigger(s),
  769. !s.isDefaultPrevented())
  770. return o.removeClass("in"),
  771. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  772. this.hoverState = null,
  773. this
  774. }
  775. ,
  776. i.prototype.fixTitle = function() {
  777. var t = this.$element;
  778. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  779. }
  780. ,
  781. i.prototype.hasContent = function() {
  782. return this.getTitle()
  783. }
  784. ,
  785. i.prototype.getPosition = function(e) {
  786. e = e || this.$element;
  787. var i = e[0]
  788. , o = "BODY" == i.tagName;
  789. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  790. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  791. width: o ? t(window).width() : e.outerWidth(),
  792. height: o ? t(window).height() : e.outerHeight()
  793. }, o ? {
  794. top: 0,
  795. left: 0
  796. } : e.offset())
  797. }
  798. ,
  799. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  800. return "bottom" == t ? {
  801. top: e.top + e.height,
  802. left: e.left + e.width / 2 - i / 2
  803. } : "top" == t ? {
  804. top: e.top - o,
  805. left: e.left + e.width / 2 - i / 2
  806. } : "left" == t ? {
  807. top: e.top + e.height / 2 - o / 2,
  808. left: e.left - i
  809. } : {
  810. top: e.top + e.height / 2 - o / 2,
  811. left: e.left + e.width
  812. }
  813. }
  814. ,
  815. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  816. var s = {
  817. top: 0,
  818. left: 0
  819. };
  820. if (!this.$viewport)
  821. return s;
  822. var n = this.options.viewport && this.options.viewport.padding || 0
  823. , r = this.getPosition(this.$viewport);
  824. if (/right|left/.test(t)) {
  825. var a = e.top - n - r.scroll
  826. , l = e.top + n - r.scroll + o;
  827. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  828. } else {
  829. var p = e.left - n
  830. , h = e.left + n + i;
  831. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  832. }
  833. return s
  834. }
  835. ,
  836. i.prototype.getTitle = function() {
  837. var t, e = this.$element, i = this.options;
  838. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  839. }
  840. ,
  841. i.prototype.getUID = function(t) {
  842. do
  843. t += ~~(1e6 * Math.random());
  844. while (document.getElementById(t));return t
  845. }
  846. ,
  847. i.prototype.tip = function() {
  848. return this.$tip = this.$tip || t(this.options.template)
  849. }
  850. ,
  851. i.prototype.arrow = function() {
  852. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  853. }
  854. ,
  855. i.prototype.validate = function() {
  856. this.$element[0].parentNode || (this.hide(),
  857. this.$element = null,
  858. this.options = null)
  859. }
  860. ,
  861. i.prototype.enable = function() {
  862. this.enabled = !0
  863. }
  864. ,
  865. i.prototype.disable = function() {
  866. this.enabled = !1
  867. }
  868. ,
  869. i.prototype.toggleEnabled = function() {
  870. this.enabled = !this.enabled
  871. }
  872. ,
  873. i.prototype.toggle = function(e) {
  874. var i = this;
  875. e && (i = t(e.currentTarget).data("bs." + this.type),
  876. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  877. t(e.currentTarget).data("bs." + this.type, i))),
  878. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  879. }
  880. ,
  881. i.prototype.destroy = function() {
  882. clearTimeout(this.timeout),
  883. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  884. }
  885. ;
  886. var o = t.fn.tooltip;
  887. t.fn.tooltip = e,
  888. t.fn.tooltip.Constructor = i,
  889. t.fn.tooltip.noConflict = function() {
  890. return t.fn.tooltip = o,
  891. this
  892. }
  893. }(jQuery);
  894. !function(e, t, n) {
  895. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  896. }("Keen", this, function() {
  897. "use strict";
  898. function Keen() {
  899. return _init.apply(this, arguments)
  900. }
  901. function _init(e) {
  902. if (_isUndefined(e))
  903. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  904. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  905. throw new Error("Please provide a projectId");
  906. this.configure(e)
  907. }
  908. function _extend(e) {
  909. for (var t = 1; t < arguments.length; t++)
  910. for (var n in arguments[t])
  911. e[n] = arguments[t][n];
  912. return e
  913. }
  914. function _isUndefined(e) {
  915. return void 0 === e
  916. }
  917. function _type(e) {
  918. var t = e && e.constructor ? e.constructor.toString() : void 0;
  919. return t ? t.match(/function (.*)\(/)[1] : "Null"
  920. }
  921. function _each(e, t, n) {
  922. var r;
  923. if (!e)
  924. return 0;
  925. if (n = n ? n : e,
  926. "array" === _type(e)) {
  927. for (r = 0; r < e.length; r++)
  928. if (t.call(n, e[r], r, e) === !1)
  929. return 0
  930. } else
  931. for (r in e)
  932. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  933. return 0;
  934. return 1
  935. }
  936. function _parse_params(e) {
  937. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  938. return decodeURIComponent(e.replace(r, " "))
  939. }, a = e.split("?")[1]; t = i.exec(a); )
  940. n[o(t[1])] = o(t[2]);
  941. return n
  942. }
  943. function _set_protocol(e) {
  944. switch (e) {
  945. case "http":
  946. return "http";
  947. case "auto":
  948. return location.protocol.replace(/:/g, "");
  949. case "https":
  950. case void 0:
  951. default:
  952. return "https"
  953. }
  954. }
  955. function _set_request_type(e) {
  956. var t = e || "jsonp"
  957. , n = !1;
  958. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  959. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  960. }
  961. function _build_url(e) {
  962. return this.client.endpoint + "/projects/" + this.client.projectId + e
  963. }
  964. function _uploadEvent(e, t, n, r, i) {
  965. var o = _build_url.apply(this, ["/events/" + e])
  966. , a = {};
  967. n = n !== !1,
  968. this.client.globalProperties && (a = this.client.globalProperties(e));
  969. for (var c in t)
  970. t.hasOwnProperty(c) && (a[c] = t[c]);
  971. switch (this.client.requestType) {
  972. case "xhr":
  973. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  974. break;
  975. case "jsonp":
  976. var s = JSON.stringify(a)
  977. , l = Keen.Base64.encode(s);
  978. o = o + "?api_key=" + this.client.writeKey,
  979. o = o + "&data=" + l,
  980. o = o + "&modified=" + (new Date).getTime(),
  981. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  982. break;
  983. case "beacon":
  984. var s = JSON.stringify(a)
  985. , l = Keen.Base64.encode(s);
  986. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  987. o = o + "&data=" + encodeURIComponent(l),
  988. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  989. o += "&c=clv1",
  990. _request.beacon.apply(this, [o, null, r, i])
  991. }
  992. }
  993. Keen.prototype.configure = function(e) {
  994. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  995. e.protocol = _set_protocol(e.protocol),
  996. e.requestType = _set_request_type(e.requestType),
  997. this.client = {
  998. projectId: e.projectId,
  999. writeKey: e.writeKey,
  1000. readKey: e.readKey,
  1001. globalProperties: null,
  1002. endpoint: e.protocol + "://" + e.host,
  1003. requestType: e.requestType
  1004. },
  1005. Keen.trigger("client", this, e),
  1006. this.trigger("ready"),
  1007. this
  1008. }
  1009. ;
  1010. var _request = {
  1011. xhr: function(e, t, n, r, i, o, a, c) {
  1012. if (!i)
  1013. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1014. var s = new XMLHttpRequest;
  1015. if (s.onreadystatechange = function() {
  1016. if (4 == s.readyState)
  1017. if (s.status >= 200 && s.status < 300) {
  1018. var e;
  1019. try {
  1020. e = JSON.parse(s.responseText)
  1021. } catch (e) {
  1022. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  1023. c && c(s, e)
  1024. }
  1025. a && e && a(e)
  1026. } else
  1027. Keen.log("HTTP request failed."),
  1028. c && c(s, null)
  1029. }
  1030. ,
  1031. s.open(e, t, o),
  1032. i && s.setRequestHeader("Authorization", i),
  1033. r && s.setRequestHeader("Content-Type", "application/json"),
  1034. n)
  1035. for (var l in n)
  1036. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1037. var u = r ? JSON.stringify(r) : null;
  1038. s.send(u)
  1039. },
  1040. jsonp: function(e, t, n, r) {
  1041. if (!t)
  1042. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1043. if (t && e.indexOf("api_key") < 0) {
  1044. var i = e.indexOf("?") > 0 ? "&" : "?";
  1045. e = e + i + "api_key=" + t
  1046. }
  1047. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1048. o += "a";
  1049. var a = !1;
  1050. window[o] = function(e) {
  1051. a = !0,
  1052. n && e && n(e),
  1053. window[o] = void 0
  1054. }
  1055. ,
  1056. e = e + "&jsonp=" + o;
  1057. var c = document.createElement("script");
  1058. c.id = "keen-jsonp",
  1059. c.src = e,
  1060. document.getElementsByTagName("head")[0].appendChild(c),
  1061. c.onreadystatechange = function() {
  1062. a === !1 && "loaded" === this.readyState && (a = !0,
  1063. r && r())
  1064. }
  1065. ,
  1066. c.onerror = function() {
  1067. a === !1 && (a = !0,
  1068. r && r())
  1069. }
  1070. },
  1071. beacon: function(e, t, n, r) {
  1072. if (t && e.indexOf("api_key") < 0) {
  1073. var i = e.indexOf("?") > 0 ? "&" : "?";
  1074. e = e + i + "api_key=" + t
  1075. }
  1076. var o = !1
  1077. , a = document.createElement("img");
  1078. a.onload = function() {
  1079. if (o = !0,
  1080. "naturalHeight"in this) {
  1081. if (this.naturalHeight + this.naturalWidth === 0)
  1082. return void this.onerror()
  1083. } else if (this.width + this.height === 0)
  1084. return void this.onerror();
  1085. n && n({
  1086. created: !0
  1087. })
  1088. }
  1089. ,
  1090. a.onerror = function() {
  1091. o = !0,
  1092. r && r()
  1093. }
  1094. ,
  1095. a.src = e
  1096. }
  1097. }
  1098. , Events = Keen.Events = {
  1099. on: function(e, t) {
  1100. this.listeners || (this.listeners = {});
  1101. var n = this.listeners[e] || (this.listeners[e] = []);
  1102. return n.push({
  1103. callback: t
  1104. }),
  1105. this
  1106. },
  1107. off: function(e, t) {
  1108. if (!e && !t)
  1109. return this.listeners = void 0,
  1110. delete this.listeners,
  1111. this;
  1112. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1113. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1114. t && 0 != n.length || (this.listeners[e] = void 0,
  1115. delete this.listeners[e]);
  1116. return this
  1117. },
  1118. trigger: function(e) {
  1119. if (!this.listeners)
  1120. return this;
  1121. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1122. n[r].callback.apply(this, t);
  1123. return this
  1124. }
  1125. };
  1126. _extend(Keen.prototype, Events),
  1127. _extend(Keen, Events),
  1128. Keen.loaded = !0,
  1129. Keen.utils = {
  1130. each: _each,
  1131. extend: _extend,
  1132. parseParams: _parse_params
  1133. },
  1134. Keen.ready = function(e) {
  1135. Keen.loaded ? e() : Keen.on("ready", e)
  1136. }
  1137. ,
  1138. Keen.log = function(e) {
  1139. "object" == typeof console && console.log("[Keen IO]", e)
  1140. }
  1141. ;
  1142. var Plugins = Keen.Plugins = {};
  1143. Keen.prototype.addEvent = function() {
  1144. _uploadEvent.apply(this, arguments)
  1145. }
  1146. ,
  1147. Keen.prototype.addEventSync = function(e, t, n, r) {
  1148. _uploadEvent.apply(this, [e, t, !1, n, r])
  1149. }
  1150. ,
  1151. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1152. var o = e
  1153. , a = o.metaKey
  1154. , c = o.target
  1155. , s = !1
  1156. , l = function() {};
  1157. return void 0 === r && (r = 500),
  1158. "A" === c.nodeName ? l = function() {
  1159. a || s || (s = !0,
  1160. window.location = c.href)
  1161. }
  1162. : "FORM" === c.nodeName && (l = function() {
  1163. s || (s = !0,
  1164. c.submit())
  1165. }
  1166. ),
  1167. i && (l = function() {
  1168. s || (s = !0,
  1169. i())
  1170. }
  1171. ),
  1172. _uploadEvent.call(this, t, n, l, l),
  1173. setTimeout(function() {
  1174. l()
  1175. }, r),
  1176. !!a && void 0
  1177. }
  1178. ,
  1179. Keen.prototype.setGlobalProperties = function(e) {
  1180. if (!this.client)
  1181. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1182. if (!e || "function" != typeof e)
  1183. throw new Error("Invalid value for global properties: " + e);
  1184. this.client.globalProperties = e
  1185. }
  1186. ,
  1187. Keen.Base64 = {
  1188. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1189. encode: function(e) {
  1190. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1191. for (e = this.utf8.encode(e); l < e.length; )
  1192. t = e.charCodeAt(l++),
  1193. n = e.charCodeAt(l++),
  1194. r = e.charCodeAt(l++),
  1195. i = t >> 2,
  1196. o = (3 & t) << 4 | n >> 4,
  1197. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1198. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1199. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1200. return s
  1201. },
  1202. decode: function(e) {
  1203. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1204. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1205. t = u.indexOf(e.charAt(l++)),
  1206. n = u.indexOf(e.charAt(l++)),
  1207. r = u.indexOf(e.charAt(l++)),
  1208. i = u.indexOf(e.charAt(l++)),
  1209. o = t << 2 | n >> 4,
  1210. a = (15 & n) << 4 | r >> 2,
  1211. c = (3 & r) << 6 | i,
  1212. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1213. return this.utf8.decode(s)
  1214. },
  1215. utf8: {
  1216. encode: function(e) {
  1217. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1218. t = e.charCodeAt(r++),
  1219. 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);
  1220. return n
  1221. },
  1222. decode: function(e) {
  1223. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1224. n = e.charCodeAt(i),
  1225. 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];
  1226. return r
  1227. }
  1228. }
  1229. },
  1230. "object" != typeof JSON && (JSON = {}),
  1231. function() {
  1232. function f(e) {
  1233. return 10 > e ? "0" + e : e
  1234. }
  1235. function quote(e) {
  1236. return escapable.lastIndex = 0,
  1237. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1238. var t = meta[e];
  1239. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1240. }) + '"' : '"' + e + '"'
  1241. }
  1242. function str(e, t) {
  1243. var n, r, i, o, a, c = gap, s = t[e];
  1244. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1245. "function" == typeof rep && (s = rep.call(t, e, s)),
  1246. typeof s) {
  1247. case "string":
  1248. return quote(s);
  1249. case "number":
  1250. return isFinite(s) ? String(s) : "null";
  1251. case "boolean":
  1252. case "null":
  1253. return String(s);
  1254. case "object":
  1255. if (!s)
  1256. return "null";
  1257. if (gap += indent,
  1258. a = [],
  1259. "[object Array]" === Object.prototype.toString.apply(s)) {
  1260. for (o = s.length,
  1261. n = 0; o > n; n += 1)
  1262. a[n] = str(n, s) || "null";
  1263. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1264. gap = c,
  1265. i
  1266. }
  1267. if (rep && "object" == typeof rep)
  1268. for (o = rep.length,
  1269. n = 0; o > n; n += 1)
  1270. "string" == typeof rep[n] && (r = rep[n],
  1271. i = str(r, s),
  1272. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1273. else
  1274. for (r in s)
  1275. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1276. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1277. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1278. gap = c,
  1279. i
  1280. }
  1281. }
  1282. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1283. 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
  1284. }
  1285. ,
  1286. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1287. return this.valueOf()
  1288. }
  1289. );
  1290. 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 = {
  1291. "\b": "\\b",
  1292. "\t": "\\t",
  1293. "\n": "\\n",
  1294. "\f": "\\f",
  1295. "\r": "\\r",
  1296. '"': '\\"',
  1297. "\\": "\\\\"
  1298. }, rep;
  1299. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1300. var r;
  1301. if (gap = "",
  1302. indent = "",
  1303. "number" == typeof n)
  1304. for (r = 0; n > r; r += 1)
  1305. indent += " ";
  1306. else
  1307. "string" == typeof n && (indent = n);
  1308. if (rep = t,
  1309. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1310. throw new Error("JSON.stringify");
  1311. return str("", {
  1312. "": e
  1313. })
  1314. }
  1315. ),
  1316. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1317. function walk(e, t) {
  1318. var n, r, i = e[t];
  1319. if (i && "object" == typeof i)
  1320. for (n in i)
  1321. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1322. void 0 !== r ? i[n] = r : delete i[n]);
  1323. return reviver.call(e, t, i)
  1324. }
  1325. var j;
  1326. if (text = String(text),
  1327. cx.lastIndex = 0,
  1328. cx.test(text) && (text = text.replace(cx, function(e) {
  1329. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1330. })),
  1331. /^[\],:{}\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, "")))
  1332. return j = eval("(" + text + ")"),
  1333. "function" == typeof reviver ? walk({
  1334. "": j
  1335. }, "") : j;
  1336. throw new SyntaxError("JSON.parse")
  1337. }
  1338. )
  1339. }(),
  1340. !function(e, t, n) {
  1341. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1342. }("domready", Keen.utils, function(e) {
  1343. function t(e) {
  1344. for (d = 1; e = r.shift(); )
  1345. e()
  1346. }
  1347. 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]);
  1348. return o[l] && o[l](s, n = function() {
  1349. o.removeEventListener(s, n, i),
  1350. t()
  1351. }
  1352. , i),
  1353. c && o.attachEvent(u, n = function() {
  1354. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1355. t())
  1356. }
  1357. ),
  1358. e = c ? function(t) {
  1359. self != top ? d ? t() : r.push(t) : function() {
  1360. try {
  1361. a.doScroll("left")
  1362. } catch (n) {
  1363. return setTimeout(function() {
  1364. e(t)
  1365. }, 50)
  1366. }
  1367. t()
  1368. }()
  1369. }
  1370. : function(e) {
  1371. d ? e() : r.push(e)
  1372. }
  1373. });
  1374. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1375. if (loaded && cached) {
  1376. clients = cached.clients || {},
  1377. ready = cached.ready || [];
  1378. for (var instance in clients)
  1379. if (clients.hasOwnProperty(instance)) {
  1380. var client = clients[instance];
  1381. for (var method in Keen.prototype)
  1382. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1383. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1384. ,
  1385. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1386. ,
  1387. client._config && (client.configure.call(client, client._config),
  1388. delete client._config),
  1389. client._setGlobalProperties) {
  1390. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1391. client.setGlobalProperties.apply(client, globals[i]);
  1392. delete client._setGlobalProperties
  1393. }
  1394. if (client._addEvent) {
  1395. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1396. client.addEvent.apply(client, queue[i]);
  1397. delete client._addEvent
  1398. }
  1399. var callback = client._on || [];
  1400. if (client._on) {
  1401. for (var i = 0; i < callback.length; i++)
  1402. client.on.apply(client, callback[i]);
  1403. client.trigger("ready"),
  1404. delete client._on
  1405. }
  1406. }
  1407. for (var i = 0; i < ready.length; i++) {
  1408. var callback = ready[i];
  1409. Keen.on("ready", function() {
  1410. callback()
  1411. })
  1412. }
  1413. }
  1414. return Keen.loaded && setTimeout(function() {
  1415. Keen.utils.domready(function() {
  1416. Keen.trigger("ready")
  1417. })
  1418. }, 0),
  1419. Keen
  1420. });
  1421. !function() {
  1422. var t = window.analytics = window.analytics || [];
  1423. if (!t.initialize) {
  1424. if (t.invoked)
  1425. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1426. t.invoked = !0,
  1427. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1428. t.factory = function(e) {
  1429. return function() {
  1430. var n = Array.prototype.slice.call(arguments);
  1431. return n.unshift(e),
  1432. t.push(n),
  1433. t
  1434. }
  1435. }
  1436. ;
  1437. for (var e = 0; e < t.methods.length; e++) {
  1438. var n = t.methods[e];
  1439. t[n] = t.factory(n)
  1440. }
  1441. t.load = function(t) {
  1442. var e = document.createElement("script");
  1443. e.type = "text/javascript",
  1444. e.async = !0,
  1445. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1446. var n = document.getElementsByTagName("script")[0];
  1447. n.parentNode.insertBefore(e, n)
  1448. }
  1449. ,
  1450. t.SNIPPET_VERSION = "4.0.0"
  1451. }
  1452. }();
  1453. !function(i, e) {
  1454. "use strict";
  1455. var s = ""
  1456. , r = "?"
  1457. , o = "function"
  1458. , a = "undefined"
  1459. , n = "object"
  1460. , t = "major"
  1461. , d = "model"
  1462. , w = "name"
  1463. , l = "type"
  1464. , p = "vendor"
  1465. , m = "version"
  1466. , c = "architecture"
  1467. , u = "console"
  1468. , g = "mobile"
  1469. , f = "tablet"
  1470. , h = "smarttv"
  1471. , b = {
  1472. has: function(i, e) {
  1473. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1474. },
  1475. lowerize: function(i) {
  1476. return i.toLowerCase()
  1477. }
  1478. }
  1479. , y = {
  1480. rgx: function() {
  1481. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1482. var c = m[p]
  1483. , u = m[p + 1];
  1484. if (typeof i === a) {
  1485. i = {};
  1486. for (t in u)
  1487. d = u[t],
  1488. typeof d === n ? i[d[0]] = e : i[d] = e
  1489. }
  1490. for (s = r = 0; s < c.length; s++)
  1491. if (w = c[s].exec(this.getUA())) {
  1492. for (t = 0; t < u.length; t++)
  1493. l = w[++r],
  1494. d = u[t],
  1495. 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;
  1496. break
  1497. }
  1498. if (w)
  1499. break
  1500. }
  1501. return i
  1502. },
  1503. str: function(i, s) {
  1504. for (var o in s)
  1505. if (typeof s[o] === n && s[o].length > 0) {
  1506. for (var a = 0; a < s[o].length; a++)
  1507. if (b.has(s[o][a], i))
  1508. return o === r ? e : o
  1509. } else if (b.has(s[o], i))
  1510. return o === r ? e : o;
  1511. return i
  1512. }
  1513. }
  1514. , v = {
  1515. browser: {
  1516. oldsafari: {
  1517. major: {
  1518. 1: ["/8", "/1", "/3"],
  1519. 2: "/4",
  1520. "?": "/"
  1521. },
  1522. version: {
  1523. "1.0": "/8",
  1524. 1.2: "/1",
  1525. 1.3: "/3",
  1526. "2.0": "/412",
  1527. "2.0.2": "/416",
  1528. "2.0.3": "/417",
  1529. "2.0.4": "/419",
  1530. "?": "/"
  1531. }
  1532. }
  1533. },
  1534. device: {
  1535. sprint: {
  1536. model: {
  1537. "Evo Shift 4G": "7373KT"
  1538. },
  1539. vendor: {
  1540. HTC: "APA",
  1541. Sprint: "Sprint"
  1542. }
  1543. }
  1544. },
  1545. os: {
  1546. windows: {
  1547. version: {
  1548. ME: "4.90",
  1549. "NT 3.11": "NT3.51",
  1550. "NT 4.0": "NT4.0",
  1551. 2e3: "NT 5.0",
  1552. XP: ["NT 5.1", "NT 5.2"],
  1553. Vista: "NT 6.0",
  1554. 7: "NT 6.1",
  1555. 8: "NT 6.2",
  1556. 8.1: "NT 6.3",
  1557. RT: "ARM"
  1558. }
  1559. }
  1560. }
  1561. }
  1562. , k = {
  1563. 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]],
  1564. 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]],
  1565. 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]],
  1566. 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]],
  1567. 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]]
  1568. }
  1569. , x = function(e) {
  1570. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1571. return this instanceof x ? (this.getBrowser = function() {
  1572. return y.rgx.apply(this, k.browser)
  1573. }
  1574. ,
  1575. this.getCPU = function() {
  1576. return y.rgx.apply(this, k.cpu)
  1577. }
  1578. ,
  1579. this.getDevice = function() {
  1580. return y.rgx.apply(this, k.device)
  1581. }
  1582. ,
  1583. this.getEngine = function() {
  1584. return y.rgx.apply(this, k.engine)
  1585. }
  1586. ,
  1587. this.getOS = function() {
  1588. return y.rgx.apply(this, k.os)
  1589. }
  1590. ,
  1591. this.getResult = function() {
  1592. return {
  1593. ua: this.getUA(),
  1594. browser: this.getBrowser(),
  1595. engine: this.getEngine(),
  1596. os: this.getOS(),
  1597. device: this.getDevice(),
  1598. cpu: this.getCPU()
  1599. }
  1600. }
  1601. ,
  1602. this.getUA = function() {
  1603. return r
  1604. }
  1605. ,
  1606. this.setUA = function(i) {
  1607. return r = i,
  1608. this
  1609. }
  1610. ,
  1611. void this.setUA(r)) : new x(e).getResult()
  1612. };
  1613. if (typeof exports !== a)
  1614. typeof module !== a && module.exports && (exports = module.exports = x),
  1615. exports.UAParser = x;
  1616. else if (i.UAParser = x,
  1617. typeof define === o && define.amd && define(function() {
  1618. return x
  1619. }),
  1620. typeof i.jQuery !== a) {
  1621. var A = i.jQuery
  1622. , _ = new x;
  1623. A.ua = _.getResult(),
  1624. A.ua.get = function() {
  1625. return _.getUA()
  1626. }
  1627. ,
  1628. A.ua.set = function(i) {
  1629. _.setUA(i);
  1630. var e = _.getResult();
  1631. for (var s in e)
  1632. A.ua[s] = e[s]
  1633. }
  1634. }
  1635. }(this);
  1636. window.Modernizr = function(n, e, t) {
  1637. function o(n) {
  1638. d.cssText = n
  1639. }
  1640. function r(n, e) {
  1641. return typeof n === e
  1642. }
  1643. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1644. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1645. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1646. return e in n && r(n.constructor.prototype[e], "undefined")
  1647. }
  1648. : function(n, e) {
  1649. return v.call(n, e)
  1650. }
  1651. ,
  1652. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1653. var e = this;
  1654. if ("function" != typeof e)
  1655. throw new TypeError;
  1656. var t = b.call(arguments, 1)
  1657. , o = function() {
  1658. if (this instanceof o) {
  1659. var r = function() {};
  1660. r.prototype = e.prototype;
  1661. var i = new r
  1662. , c = e.apply(i, t.concat(b.call(arguments)));
  1663. return Object(c) === c ? c : i
  1664. }
  1665. return e.apply(n, t.concat(b.call(arguments)))
  1666. };
  1667. return o
  1668. }
  1669. ),
  1670. y.webgl = function() {
  1671. return !!n.WebGLRenderingContext
  1672. }
  1673. ;
  1674. for (var h in y)
  1675. u(y, h) && (c = h.toLowerCase(),
  1676. f[c] = y[h](),
  1677. w.push((f[c] ? "" : "no-") + c));
  1678. return f.addTest = function(n, e) {
  1679. if ("object" == typeof n)
  1680. for (var o in n)
  1681. u(n, o) && f.addTest(o, n[o]);
  1682. else {
  1683. if (n = n.toLowerCase(),
  1684. f[n] !== t)
  1685. return f;
  1686. e = "function" == typeof e ? e() : e,
  1687. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1688. f[n] = e
  1689. }
  1690. return f
  1691. }
  1692. ,
  1693. o(""),
  1694. p = i = null,
  1695. f._version = a,
  1696. f
  1697. }(this, this.document);
  1698. !function(e, t, a) {
  1699. "use strict";
  1700. function n(t, h, m) {
  1701. function H(a) {
  1702. var n = 0
  1703. , i = Ee.length;
  1704. if (Ce.old = e.extend({}, Ce),
  1705. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1706. ke = Be[ge.horizontal ? "width" : "height"](),
  1707. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1708. Ee.length = 0,
  1709. Ce.start = 0,
  1710. Ce.end = q(ze - Ie, 0),
  1711. Re) {
  1712. n = Ne.length,
  1713. qe = Pe.children(ge.itemSelector),
  1714. Ne.length = 0;
  1715. 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;
  1716. ze = 0,
  1717. qe.each(function(t, a) {
  1718. var n = e(a)
  1719. , i = a.getBoundingClientRect()
  1720. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1721. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1722. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1723. , h = l + d + p
  1724. , m = !d || !p
  1725. , g = {};
  1726. g.el = a,
  1727. g.size = m ? l : h,
  1728. g.half = g.size / 2,
  1729. g.start = ze + (m ? d : 0),
  1730. g.center = g.start - E(Ie / 2 - g.size / 2),
  1731. g.end = g.start - Ie + g.size,
  1732. t || (ze += s),
  1733. ze += h,
  1734. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1735. t === v && (g.end += o,
  1736. ze += o,
  1737. f = m ? p : 0),
  1738. Ne.push(g),
  1739. r = g
  1740. }),
  1741. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1742. ze -= f,
  1743. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1744. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1745. }
  1746. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1747. Q(),
  1748. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1749. Te = d(Te, ge.minHandleSize, ke),
  1750. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1751. xe.end = ke - Te,
  1752. it || j()),
  1753. !we && Ie > 0) {
  1754. var p = Ce.start
  1755. , h = "";
  1756. if (Re)
  1757. e.each(Ne, function(e, t) {
  1758. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1759. Ee.push(p),
  1760. p += Ie,
  1761. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1762. });
  1763. else
  1764. for (; p - Ie < Ce.end; )
  1765. Ee.push(p),
  1766. p += Ie;
  1767. if (De[0] && i !== Ee.length) {
  1768. for (var m = 0; m < Ee.length; m++)
  1769. h += ge.pageBuilder.call(ye, m);
  1770. Ae = De.html(h).children(),
  1771. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1772. }
  1773. }
  1774. if (Oe.slideeSize = ze,
  1775. Oe.frameSize = Ie,
  1776. Oe.sbSize = ke,
  1777. Oe.handleSize = Te,
  1778. Re) {
  1779. a && null != ge.startAt && (W(ge.startAt),
  1780. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1781. var g = Ne[Oe.activeItem];
  1782. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1783. } else
  1784. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1785. pe("load")
  1786. }
  1787. function X(e, t, a) {
  1788. if (Re && at.released && !a) {
  1789. var n = $(e)
  1790. , i = e > Ce.start && e < Ce.end;
  1791. Le ? (i && (e = Ne[n.centerItem].center),
  1792. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1793. }
  1794. 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),
  1795. et.start = +new Date,
  1796. et.time = 0,
  1797. et.from = Ce.cur,
  1798. et.to = e,
  1799. et.delta = e - Ce.cur,
  1800. et.tweesing = at.tweese || at.init && !at.slidee,
  1801. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1802. at.tweese = 0,
  1803. e !== Ce.dest && (Ce.dest = e,
  1804. pe("change"),
  1805. it || Y()),
  1806. K(),
  1807. Q(),
  1808. Z(),
  1809. F()
  1810. }
  1811. function Y() {
  1812. if (ye.initialized) {
  1813. if (!it)
  1814. return it = w(Y),
  1815. void (at.released && pe("moveStart"));
  1816. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1817. 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),
  1818. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1819. et.to === Ce.cur ? (Ce.cur = et.to,
  1820. at.tweese = it = 0) : it = w(Y),
  1821. pe("move"),
  1822. 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"),
  1823. !it && at.released && pe("moveEnd"),
  1824. j()
  1825. }
  1826. }
  1827. function j() {
  1828. 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,
  1829. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1830. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1831. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1832. }
  1833. function F() {
  1834. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1835. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1836. pe("activePage", _e.page))
  1837. }
  1838. function M() {
  1839. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1840. ot = at.init ? w(M) : 0,
  1841. tt.now = +new Date,
  1842. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1843. X(at.init ? tt.pos : E(tt.pos)),
  1844. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1845. tt.lastTime = tt.now
  1846. }
  1847. function L(e, t, n) {
  1848. if ("boolean" === i(t) && (n = t,
  1849. t = a),
  1850. t === a)
  1851. X(Ce[e], n);
  1852. else {
  1853. if (Le && "center" !== e)
  1854. return;
  1855. var r = ye.getPos(t);
  1856. r && X(r[e], n, !Le)
  1857. }
  1858. }
  1859. function R(e) {
  1860. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1861. }
  1862. function U(e) {
  1863. return R(l(e) && 0 > e ? e + Ne.length : e)
  1864. }
  1865. function W(e, t) {
  1866. var a = R(e);
  1867. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1868. qe.eq(a).addClass(ge.activeClass),
  1869. _e.active = Oe.activeItem = a,
  1870. Z(),
  1871. pe("active", a)),
  1872. a)
  1873. }
  1874. function $(e) {
  1875. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1876. var t = {}
  1877. , a = Me ? 0 : Ie / 2;
  1878. if (!we)
  1879. for (var n = 0, i = Ee.length; i > n; n++) {
  1880. if (e >= Ce.end || n === Ee.length - 1) {
  1881. t.activePage = Ee.length - 1;
  1882. break
  1883. }
  1884. if (e <= Ee[n] + a) {
  1885. t.activePage = n;
  1886. break
  1887. }
  1888. }
  1889. if (Re) {
  1890. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1891. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1892. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1893. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1894. s = c;
  1895. break
  1896. }
  1897. t.firstItem = l(r) ? r : 0,
  1898. t.centerItem = l(o) ? o : t.firstItem,
  1899. t.lastItem = l(s) ? s : t.centerItem
  1900. }
  1901. return t
  1902. }
  1903. function Q(t) {
  1904. e.extend(Oe, $(t))
  1905. }
  1906. function Z() {
  1907. var e = Ce.dest <= Ce.start
  1908. , t = Ce.dest >= Ce.end
  1909. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1910. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1911. Je.is("button,input") && Je.prop("disabled", e),
  1912. Ke.is("button,input") && Ke.prop("disabled", t),
  1913. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1914. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1915. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1916. Qe.is("button,input") && Qe.prop("disabled", e),
  1917. $e.is("button,input") && $e.prop("disabled", t)),
  1918. Re && null != Oe.activeItem) {
  1919. var n = 0 === Oe.activeItem
  1920. , i = Oe.activeItem >= Ne.length - 1
  1921. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1922. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1923. Ze.is("button,input") && Ze.prop("disabled", n),
  1924. Ge.is("button,input") && Ge.prop("disabled", i),
  1925. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1926. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1927. }
  1928. }
  1929. function G(e, t, a) {
  1930. if (e = U(e),
  1931. t = U(t),
  1932. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1933. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1934. var n = t > e ? e : a ? t : t - 1
  1935. , i = e > t ? e : a ? t + 1 : t
  1936. , r = e > t;
  1937. 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)),
  1938. H()
  1939. }
  1940. }
  1941. function J(e, t) {
  1942. for (var a = 0, n = Ve[e].length; n > a; a++)
  1943. if (Ve[e][a] === t)
  1944. return a;
  1945. return -1
  1946. }
  1947. function K() {
  1948. at.released && !ye.isPaused && ye.resume()
  1949. }
  1950. function V(e) {
  1951. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1952. }
  1953. function _() {
  1954. at.history[0] = at.history[1],
  1955. at.history[1] = at.history[2],
  1956. at.history[2] = at.history[3],
  1957. at.history[3] = at.delta
  1958. }
  1959. function ee(e) {
  1960. at.released = 0,
  1961. at.source = e,
  1962. at.slidee = "slidee" === e
  1963. }
  1964. function te(t) {
  1965. var a = "touchstart" === t.type
  1966. , n = t.data.source
  1967. , i = "slidee" === n;
  1968. 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),
  1969. ee(n),
  1970. at.init = 0,
  1971. at.$source = e(t.target),
  1972. at.touch = a,
  1973. at.pointer = a ? t.originalEvent.touches[0] : t,
  1974. at.initX = at.pointer.pageX,
  1975. at.initY = at.pointer.pageY,
  1976. at.initPos = i ? Ce.cur : xe.cur,
  1977. at.start = +new Date,
  1978. at.time = 0,
  1979. at.path = 0,
  1980. at.delta = 0,
  1981. at.locked = 0,
  1982. at.history = [0, 0, 0, 0],
  1983. at.pathToLock = i ? a ? 30 : 10 : 0,
  1984. b.on(a ? z : I, ae),
  1985. ye.pause(1),
  1986. (i ? Pe : Se).addClass(ge.draggedClass),
  1987. pe("moveStart"),
  1988. i && (rt = setInterval(_, 10)))
  1989. }
  1990. function ae(e) {
  1991. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1992. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1993. at.pathX = at.pointer.pageX - at.initX,
  1994. at.pathY = at.pointer.pageY - at.initY,
  1995. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1996. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1997. at.released || !(at.path < 1)) {
  1998. if (!at.init) {
  1999. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  2000. return ne();
  2001. at.init = 1
  2002. }
  2003. r(e),
  2004. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  2005. at.$source.on(B, s)),
  2006. at.released && (ne(),
  2007. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  2008. at.delta += at.swing,
  2009. at.tweese = x(at.swing) > 10)),
  2010. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2011. }
  2012. }
  2013. function ne() {
  2014. clearInterval(rt),
  2015. at.released = !0,
  2016. b.off(at.touch ? z : I, ae),
  2017. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2018. setTimeout(function() {
  2019. at.$source.off(B, s)
  2020. }),
  2021. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2022. ye.resume(1),
  2023. at.init = 0
  2024. }
  2025. function ie(t) {
  2026. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2027. }
  2028. function re() {
  2029. ye.stop(),
  2030. b.off("mouseup", re)
  2031. }
  2032. function se(e) {
  2033. switch (r(e),
  2034. this) {
  2035. case $e[0]:
  2036. case Qe[0]:
  2037. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  2038. b.on("mouseup", re);
  2039. break;
  2040. case Ze[0]:
  2041. ye.prev();
  2042. break;
  2043. case Ge[0]:
  2044. ye.next();
  2045. break;
  2046. case Je[0]:
  2047. ye.prevPage();
  2048. break;
  2049. case Ke[0]:
  2050. ye.nextPage()
  2051. }
  2052. }
  2053. function oe(e) {
  2054. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2055. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2056. Re ? (p = +new Date,
  2057. nt.last < p - nt.resetTime && (nt.delta = 0),
  2058. nt.last = p,
  2059. nt.delta += nt.curDelta,
  2060. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  2061. nt.delta %= 1),
  2062. nt.finalDelta) : nt.curDelta
  2063. }
  2064. function le(e) {
  2065. e.originalEvent[g] = ye;
  2066. var t = +new Date;
  2067. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2068. return void (O = t);
  2069. if (ge.scrollBy && Ce.start !== Ce.end) {
  2070. var a = oe(e.originalEvent);
  2071. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  2072. ye.slideBy(ge.scrollBy * a)
  2073. }
  2074. }
  2075. function ce(e) {
  2076. ge.clickBar && e.target === Be[0] && (r(e),
  2077. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2078. }
  2079. function de(e) {
  2080. if (ge.keyboardNavBy)
  2081. switch (e.which) {
  2082. case ge.horizontal ? 37 : 38:
  2083. r(e),
  2084. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2085. break;
  2086. case ge.horizontal ? 39 : 40:
  2087. r(e),
  2088. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  2089. }
  2090. }
  2091. function ue(e) {
  2092. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  2093. }
  2094. function fe() {
  2095. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2096. }
  2097. function ve(e) {
  2098. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2099. }
  2100. function pe(e, t) {
  2101. if (Ve[e]) {
  2102. for (me = Ve[e].length,
  2103. T.length = 0,
  2104. he = 0; me > he; he++)
  2105. T.push(Ve[e][he]);
  2106. for (he = 0; me > he; he++)
  2107. T[he].call(ye, e, t)
  2108. }
  2109. }
  2110. 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 = {
  2111. start: 0,
  2112. center: 0,
  2113. end: 0,
  2114. cur: 0,
  2115. dest: 0
  2116. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2117. start: 0,
  2118. end: 0,
  2119. cur: 0
  2120. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2121. firstItem: 0,
  2122. lastItem: 0,
  2123. centerItem: 0,
  2124. activeItem: null,
  2125. activePage: 0
  2126. }, 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 = {
  2127. released: 1
  2128. }, nt = {
  2129. last: 0,
  2130. delta: 0,
  2131. resetTime: 200
  2132. }, it = 0, rt = 0, st = 0, ot = 0;
  2133. we || (t = be[0]),
  2134. ye.initialized = 0,
  2135. ye.frame = t,
  2136. ye.slidee = Pe[0],
  2137. ye.pos = Ce,
  2138. ye.rel = Oe,
  2139. ye.items = Ne,
  2140. ye.pages = Ee,
  2141. ye.isPaused = 0,
  2142. ye.options = ge,
  2143. ye.dragging = at,
  2144. ye.reload = function() {
  2145. H()
  2146. }
  2147. ,
  2148. ye.getPos = function(e) {
  2149. if (Re) {
  2150. var t = R(e);
  2151. return -1 !== t && Ne[t]
  2152. }
  2153. var a = Pe.find(e).eq(0);
  2154. if (a[0]) {
  2155. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2156. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2157. return {
  2158. start: n,
  2159. center: n - Ie / 2 + i / 2,
  2160. end: n - Ie + i,
  2161. size: i
  2162. }
  2163. }
  2164. return !1
  2165. }
  2166. ,
  2167. ye.moveBy = function(e) {
  2168. tt.speed = e,
  2169. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2170. tt.startPos = Ce.cur,
  2171. ee("button"),
  2172. at.init = 1,
  2173. pe("moveStart"),
  2174. y(ot),
  2175. M())
  2176. }
  2177. ,
  2178. ye.stop = function() {
  2179. "button" === at.source && (at.init = 0,
  2180. at.released = 1)
  2181. }
  2182. ,
  2183. ye.prev = function() {
  2184. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2185. }
  2186. ,
  2187. ye.next = function() {
  2188. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2189. }
  2190. ,
  2191. ye.prevPage = function() {
  2192. ye.activatePage(Oe.activePage - 1)
  2193. }
  2194. ,
  2195. ye.nextPage = function() {
  2196. ye.activatePage(Oe.activePage + 1)
  2197. }
  2198. ,
  2199. ye.slideBy = function(e, t) {
  2200. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2201. }
  2202. ,
  2203. ye.slideTo = function(e, t) {
  2204. X(e, t)
  2205. }
  2206. ,
  2207. ye.toStart = function(e, t) {
  2208. L("start", e, t)
  2209. }
  2210. ,
  2211. ye.toEnd = function(e, t) {
  2212. L("end", e, t)
  2213. }
  2214. ,
  2215. ye.toCenter = function(e, t) {
  2216. L("center", e, t)
  2217. }
  2218. ,
  2219. ye.getIndex = R,
  2220. ye.activate = function(e, t) {
  2221. var a = W(e);
  2222. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2223. }
  2224. ,
  2225. ye.activatePage = function(e, t) {
  2226. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2227. }
  2228. ,
  2229. ye.resume = function(e) {
  2230. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2231. st ? st = clearTimeout(st) : pe("resume"),
  2232. st = setTimeout(function() {
  2233. switch (pe("cycle"),
  2234. ge.cycleBy) {
  2235. case "items":
  2236. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2237. break;
  2238. case "pages":
  2239. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2240. }
  2241. }, ge.cycleInterval))
  2242. }
  2243. ,
  2244. ye.pause = function(e) {
  2245. e < ye.isPaused || (ye.isPaused = e || 100,
  2246. st && (st = clearTimeout(st),
  2247. pe("pause")))
  2248. }
  2249. ,
  2250. ye.toggle = function() {
  2251. ye[st ? "pause" : "resume"]()
  2252. }
  2253. ,
  2254. ye.set = function(t, a) {
  2255. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2256. }
  2257. ,
  2258. ye.add = function(t, a) {
  2259. var n = e(t);
  2260. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2261. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2262. H()
  2263. }
  2264. ,
  2265. ye.remove = function(t) {
  2266. if (Re) {
  2267. var a = U(t);
  2268. if (a > -1) {
  2269. qe.eq(a).remove();
  2270. var n = a === Oe.activeItem;
  2271. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2272. H(),
  2273. n && (_e.active = null,
  2274. ye.activate(Oe.activeItem))
  2275. }
  2276. } else
  2277. e(t).remove(),
  2278. H()
  2279. }
  2280. ,
  2281. ye.moveAfter = function(e, t) {
  2282. G(e, t, 1)
  2283. }
  2284. ,
  2285. ye.moveBefore = function(e, t) {
  2286. G(e, t)
  2287. }
  2288. ,
  2289. ye.on = function(e, t) {
  2290. if ("object" === i(e))
  2291. for (var a in e)
  2292. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2293. else if ("function" === i(t))
  2294. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2295. Ve[n[r]] = Ve[n[r]] || [],
  2296. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2297. else if ("array" === i(t))
  2298. for (var o = 0, l = t.length; l > o; o++)
  2299. ye.on(e, t[o])
  2300. }
  2301. ,
  2302. ye.one = function(e, t) {
  2303. function a() {
  2304. t.apply(ye, arguments),
  2305. ye.off(e, a)
  2306. }
  2307. ye.on(e, a)
  2308. }
  2309. ,
  2310. ye.off = function(e, t) {
  2311. if (t instanceof Array)
  2312. for (var a = 0, n = t.length; n > a; a++)
  2313. ye.off(e, t[a]);
  2314. else
  2315. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2316. if (Ve[i[r]] = Ve[i[r]] || [],
  2317. null == t)
  2318. Ve[i[r]].length = 0;
  2319. else {
  2320. var o = J(i[r], t);
  2321. -1 !== o && Ve[i[r]].splice(o, 1)
  2322. }
  2323. }
  2324. ,
  2325. ye.destroy = function() {
  2326. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2327. b.off("keydown", de),
  2328. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2329. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2330. De.empty(),
  2331. we || (be.off("." + g),
  2332. He.restore(),
  2333. Xe.restore(),
  2334. Ye.restore(),
  2335. je.restore(),
  2336. e.removeData(t, g)),
  2337. Ne.length = Ee.length = 0,
  2338. _e = {},
  2339. ye.initialized = 0,
  2340. ye
  2341. }
  2342. ,
  2343. ye.init = function() {
  2344. if (!ye.initialized) {
  2345. ye.on(m);
  2346. var e = ["overflow", "position"]
  2347. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2348. He.save.apply(He, e),
  2349. Ye.save.apply(Ye, e),
  2350. Xe.save.apply(Xe, t),
  2351. je.save.apply(je, t);
  2352. var a = Se;
  2353. return we || (a = a.add(Pe),
  2354. be.css("overflow", "hidden"),
  2355. f || "static" !== be.css("position") || be.css("position", "relative")),
  2356. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2357. a.css({
  2358. position: "absolute"
  2359. })),
  2360. ge.forward && $e.on(S, se),
  2361. ge.backward && Qe.on(S, se),
  2362. ge.prev && Ze.on(B, se),
  2363. ge.next && Ge.on(B, se),
  2364. ge.prevPage && Je.on(B, se),
  2365. ge.nextPage && Ke.on(B, se),
  2366. Ue.on(C, le),
  2367. Be[0] && Be.on(B, ce),
  2368. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2369. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2370. We.on(P, {
  2371. source: "slidee"
  2372. }, te),
  2373. Se && Se.on(P, {
  2374. source: "handle"
  2375. }, te),
  2376. b.on("keydown", de),
  2377. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2378. be.on("scroll." + g, o)),
  2379. ye.initialized = 1,
  2380. H(!0),
  2381. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2382. ye
  2383. }
  2384. }
  2385. }
  2386. function i(e) {
  2387. 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
  2388. }
  2389. function r(e, t) {
  2390. e.preventDefault(),
  2391. t && e.stopPropagation()
  2392. }
  2393. function s(t) {
  2394. r(t, 1),
  2395. e(this).off(t.type, s)
  2396. }
  2397. function o() {
  2398. this.scrollLeft = 0,
  2399. this.scrollTop = 0
  2400. }
  2401. function l(e) {
  2402. return !isNaN(parseFloat(e)) && isFinite(e)
  2403. }
  2404. function c(e, t) {
  2405. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2406. }
  2407. function d(e, t, a) {
  2408. return t > e ? t : e > a ? a : e
  2409. }
  2410. function u(e) {
  2411. var t = {};
  2412. return t.style = {},
  2413. t.save = function() {
  2414. if (e && e.nodeType) {
  2415. for (var a = 0; a < arguments.length; a++)
  2416. t.style[arguments[a]] = e.style[arguments[a]];
  2417. return t
  2418. }
  2419. }
  2420. ,
  2421. t.restore = function() {
  2422. if (e && e.nodeType) {
  2423. for (var a in t.style)
  2424. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2425. return t
  2426. }
  2427. }
  2428. ,
  2429. t
  2430. }
  2431. 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;
  2432. b.on(C, function(e) {
  2433. var t = e.originalEvent[g]
  2434. , a = +new Date;
  2435. (!t || t.options.scrollHijack < a - O) && (O = a)
  2436. }),
  2437. function(e) {
  2438. function t(e) {
  2439. var t = (new Date).getTime()
  2440. , n = Math.max(0, 16 - (t - a))
  2441. , i = setTimeout(e, n);
  2442. return a = t,
  2443. i
  2444. }
  2445. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2446. var a = (new Date).getTime()
  2447. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2448. y = function(t) {
  2449. n.call(e, t)
  2450. }
  2451. }(window),
  2452. function() {
  2453. function e(e) {
  2454. for (var n = 0, i = t.length; i > n; n++) {
  2455. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2456. if (null != a.style[r])
  2457. return r
  2458. }
  2459. }
  2460. var t = ["", "webkit", "moz", "ms", "o"]
  2461. , a = document.createElement("div");
  2462. f = e("transform"),
  2463. v = e("perspective") ? "translateZ(0) " : ""
  2464. }(),
  2465. t[m] = n,
  2466. e.fn[h] = function(t, a) {
  2467. var r, s;
  2468. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2469. s = Array.prototype.slice.call(arguments, 1)),
  2470. t = {}),
  2471. this.each(function(i, o) {
  2472. var l = e.data(o, g);
  2473. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2474. })
  2475. }
  2476. ,
  2477. n.defaults = {
  2478. slidee: null,
  2479. horizontal: !1,
  2480. itemNav: null,
  2481. itemSelector: null,
  2482. smart: !1,
  2483. activateOn: null,
  2484. activateMiddle: !1,
  2485. scrollSource: null,
  2486. scrollBy: 0,
  2487. scrollHijack: 300,
  2488. scrollTrap: !1,
  2489. dragSource: null,
  2490. mouseDragging: !1,
  2491. touchDragging: !1,
  2492. releaseSwing: !1,
  2493. swingSpeed: .2,
  2494. elasticBounds: !1,
  2495. interactive: null,
  2496. scrollBar: null,
  2497. dragHandle: !1,
  2498. dynamicHandle: !1,
  2499. minHandleSize: 50,
  2500. clickBar: !1,
  2501. syncSpeed: .5,
  2502. pagesBar: null,
  2503. activatePageOn: null,
  2504. pageBuilder: function(e) {
  2505. return "<li>" + (e + 1) + "</li>"
  2506. },
  2507. forward: null,
  2508. backward: null,
  2509. prev: null,
  2510. next: null,
  2511. prevPage: null,
  2512. nextPage: null,
  2513. cycleBy: null,
  2514. cycleInterval: 5e3,
  2515. pauseOnHover: !1,
  2516. startPaused: !1,
  2517. moveBy: 300,
  2518. speed: 0,
  2519. easing: "swing",
  2520. startAt: null,
  2521. keyboardNavBy: null,
  2522. draggedClass: "dragged",
  2523. activeClass: "active",
  2524. disabledClass: "disabled"
  2525. }
  2526. }(jQuery, window);
  2527. !function e(t, i, n) {
  2528. function r(a, s) {
  2529. if (!i[a]) {
  2530. if (!t[a]) {
  2531. var l = "function" == typeof require && require;
  2532. if (!s && l)
  2533. return l(a, !0);
  2534. if (o)
  2535. return o(a, !0);
  2536. var c = new Error("Cannot find module '" + a + "'");
  2537. throw c.code = "MODULE_NOT_FOUND",
  2538. c
  2539. }
  2540. var h = i[a] = {
  2541. exports: {}
  2542. };
  2543. t[a][0].call(h.exports, function(e) {
  2544. var i = t[a][1][e];
  2545. return r(i ? i : e)
  2546. }, h, h.exports, e, t, i, n)
  2547. }
  2548. return i[a].exports
  2549. }
  2550. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2551. r(n[a]);
  2552. return r
  2553. }({
  2554. 1: [function(e, t, i) {
  2555. (function(i) {
  2556. "use strict";
  2557. function n(e) {
  2558. this.player = null,
  2559. this.director = null,
  2560. this.modelManager = null,
  2561. this.container = null,
  2562. this.tagManager = null,
  2563. this.fadeInSpeed = e,
  2564. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2565. }
  2566. var r = e("three")
  2567. , o = e("./util/logger")
  2568. , a = (e("./util/common"),
  2569. e("./enum/PlayerEvents"))
  2570. , s = e("./enum/DirectorEvents")
  2571. , l = e("./settings")
  2572. , c = e("./enum/Viewmode")
  2573. , h = (e("./enum/WarpStyle"),
  2574. e("./enum/BlackoutStyle"),
  2575. e("./enum/ModelManagerEvents"))
  2576. , u = e("./enum/tagEvents")
  2577. , d = e("./util/transitions")
  2578. , p = e("./util/lerp")
  2579. , f = new o(i);
  2580. //window.THREE = r;
  2581. n.prototype.init = function(e, t, i, n, r) {
  2582. window.app = this;
  2583. this.player = t,
  2584. this.director = e,
  2585. this.modelManager = i,
  2586. this.tagManager = n,
  2587. this.container = r,
  2588. this.updateModel(),
  2589. this.bindEvents()
  2590. }
  2591. ,
  2592. n.prototype.bindEvents = function() {
  2593. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2594. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2595. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2596. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2597. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2598. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2599. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2600. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2601. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2602. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2603. }
  2604. ,
  2605. n.prototype.updateModel = function() {
  2606. //模型this.model
  2607. this.model = this.modelManager.getActiveModel()
  2608. }
  2609. ,
  2610. n.prototype.handleWarpStarted = function() {
  2611. this.hidePlayerReticule()
  2612. }
  2613. ,
  2614. n.prototype.ontagActivated = function() {
  2615. this.hidePlayerReticule()
  2616. }
  2617. ,
  2618. n.prototype.onNavigationTotag = function() {
  2619. this.hidePlayerReticule()
  2620. }
  2621. ,
  2622. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2623. var n = this.modelManager.getActiveModel()
  2624. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2625. n.fadePanoMarkers(r),
  2626. n.setMode(t)
  2627. }
  2628. ,
  2629. n.prototype.handlePlayerModeChanged = function(e, t) {
  2630. var i = this.modelManager.getActiveModel()
  2631. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2632. i.setSide(n),
  2633. i.setMode(t)
  2634. }
  2635. ,
  2636. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2637. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2638. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2639. }
  2640. ,
  2641. n.prototype.handleActionInterruption = function() {}
  2642. ,
  2643. n.prototype.handleStartInside = function(e) {
  2644. var t = l[this.player.mode]
  2645. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2646. this.fadeIn(this.fadeInSpeed),
  2647. this.model.alpha = 0,
  2648. this.model.skybox.material.uniforms.opacity.value = 1,
  2649. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2650. var n = this.player.reticule;
  2651. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2652. }
  2653. ,
  2654. n.prototype.handleStartOutside = function(e) {
  2655. this.fadeIn(e)
  2656. }
  2657. ,
  2658. n.prototype.fadeIn = function(e) {
  2659. null !== e && void 0 !== e || (e = 2e3,
  2660. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2661. $(this.container).fadeIn(e)
  2662. }
  2663. ,
  2664. n.prototype.hidePlayerReticule = function() {
  2665. this.player.reticule.hide()
  2666. }
  2667. ,
  2668. t.exports = n
  2669. }
  2670. ).call(this, "/js/DisplayController.js")
  2671. }
  2672. , {
  2673. "./enum/BlackoutStyle": 18,
  2674. "./enum/DirectorEvents": 23,
  2675. "./enum/tagEvents": 32,
  2676. "./enum/ModelManagerEvents": 33,
  2677. "./enum/PlayerEvents": 40,
  2678. "./enum/Viewmode": 51,
  2679. "./enum/WarpStyle": 52,
  2680. "./settings": 166,
  2681. "./util/common": 185,
  2682. "./util/lerp": 188,
  2683. "./util/logger": 189,
  2684. "./util/transitions": 195,
  2685. three: 217
  2686. }],
  2687. 2: [function(e, t, i) {
  2688. "use strict";
  2689. function n() {
  2690. this.baseStartTime = performance.timing.navigationStart,
  2691. this.loadingStartTime = null,
  2692. this.waitingStartTime = null,
  2693. this.appReadyTime = null
  2694. }
  2695. n.prototype.setBaseStartTime = function(e) {
  2696. this.baseStartTime = e || Date.now()
  2697. }
  2698. ,
  2699. n.prototype.setWaitingStartTime = function(e) {
  2700. this.waitingStartTime = e || Date.now()
  2701. }
  2702. ,
  2703. n.prototype.setLoadingStartTime = function(e) {
  2704. this.loadingStartTime = e || Date.now()
  2705. }
  2706. ,
  2707. n.prototype.setAppReadyTime = function(e) {
  2708. this.appReadyTime = e || Date.now()
  2709. }
  2710. ,
  2711. n.prototype.calcFullLoadingTime = function() {
  2712. var e = this.appReadyTime - this.baseStartTime;
  2713. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2714. e
  2715. }
  2716. ,
  2717. t.exports = n
  2718. }
  2719. , {}],
  2720. 3: [function(e, t, i) {
  2721. (function(i) {
  2722. "use strict";
  2723. function n() {
  2724. return 100 * Math.random()
  2725. }
  2726. var r = e("./util/logger")
  2727. , o = e("./util/browser")
  2728. , a = new r(i)
  2729. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2730. initialized: !1,
  2731. init: function(e, t) {
  2732. if (t = t || {},
  2733. !this.initialized) {
  2734. this.initialized = !0,
  2735. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2736. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2737. for (var i in e) {
  2738. var r = i.match("^sc_tilegen_([0-9]+)$");
  2739. r && (s.tilegen = n() < parseInt(r[1]));
  2740. var l = i.match("^sc_imgopt_([0-9]+)$");
  2741. l && (s.imgopt = n() < parseInt(l[1]))
  2742. }
  2743. for (var c in t)
  2744. s[c] = t[c],
  2745. a.debug("A/B override:", c, s[c])
  2746. }
  2747. },
  2748. changeIfTileGenerating: function(e) {
  2749. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2750. e += ""),
  2751. e
  2752. },
  2753. changeIfImageOptimzing: function(e) {
  2754. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2755. e += ""),
  2756. e
  2757. },
  2758. tilegen: !1,
  2759. imgopt: !1
  2760. };
  2761. t.exports = s
  2762. }
  2763. ).call(this, "/js/ab.js")
  2764. }
  2765. , {
  2766. "./util/browser": 182,
  2767. "./util/logger": 189
  2768. }],
  2769. 4: [function(e, t, i) {
  2770. (function(i) {
  2771. "use strict";
  2772. function n() {
  2773. return {
  2774. addons: [{
  2775. name: "keen:ua_parser",
  2776. input: {
  2777. ua_string: "user_agent"
  2778. },
  2779. output: "parsed_user_agent"
  2780. }]
  2781. }
  2782. }
  2783. function r(e, t, i, n) {
  2784. function r(t) {
  2785. l[t.sid] = !0;
  2786. var i = t.billboard.media && t.billboard.media.type
  2787. , n = {
  2788. tag_id: t.sid,
  2789. tags_visited: Object.keys(l).length,
  2790. tag_count: Object.keys(e.tags).length,
  2791. tag_view_count: ++E,
  2792. has_media: !!i
  2793. };
  2794. i && (n.media_type = i),
  2795. u("tag_opened", n)
  2796. }
  2797. var l = {}
  2798. , h = Date.now() - N
  2799. , f = null;
  2800. n && (f = Date.now() - window.navigationStart);
  2801. var g;
  2802. try {
  2803. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2804. } catch (e) {
  2805. g = !1
  2806. }
  2807. var v, A = e.supportsVR;
  2808. A || (v = "VR disabled at the model/account level",
  2809. 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"))),
  2810. u("model_loaded", {
  2811. duration: h,
  2812. duration_from_navigation_start: f,
  2813. has_hlr: g,
  2814. has_vr: A,
  2815. vr_reason: v
  2816. });
  2817. var I = 0;
  2818. e.panos.forEach(function(e) {
  2819. e.on("enter", function() {
  2820. c("pano_viewed", {
  2821. pano_id: e.id,
  2822. pano_view_count: ++I,
  2823. alignment_type: e.alignmentType,
  2824. interaction_source: O,
  2825. navigation_source: p
  2826. })
  2827. })
  2828. });
  2829. var E = 0;
  2830. for (var T in e.tags)
  2831. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2832. t.on("tour_auto", function(e) {
  2833. p = "tour_" + e
  2834. }),
  2835. t.on("tour_manual", function(e) {
  2836. O = "gui-" + e,
  2837. p = "tour_manual"
  2838. }),
  2839. i.on(C.InteractionKey, function() {
  2840. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2841. }),
  2842. i.on(C.InteractionDirect, function() {
  2843. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2844. }),
  2845. o(t),
  2846. a(),
  2847. s()
  2848. }
  2849. function o(e) {
  2850. I.on(T.OPENED, function() {
  2851. c("showcase_share_intent", {
  2852. pano_id: e.currentPano && e.currentPano.id
  2853. })
  2854. }),
  2855. I.on(T.LINK_CLICKED, function(t) {
  2856. c("showcase_share_action", {
  2857. channel: t.channel,
  2858. pano_id: e.currentPano && e.currentPano.id
  2859. })
  2860. }),
  2861. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2862. c("showcase_share_origin_link_clicked")
  2863. })
  2864. }
  2865. function a() {}
  2866. function s() {
  2867. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2868. gui_action: "click_vr_button"
  2869. })),
  2870. b.on(S.LAUNCH, function(e) {
  2871. c("showcase_gui", {
  2872. gui_action: "launch_vr",
  2873. vr_platform: e.vr_platform,
  2874. vr_app: e.vr_app
  2875. })
  2876. }),
  2877. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2878. gui_action: "vr_modal_prev"
  2879. })),
  2880. b.on(S.NEXT, function(e) {
  2881. c("showcase_gui", {
  2882. gui_action: e.nextAction
  2883. })
  2884. }),
  2885. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2886. gui_action: "vr_modal_close"
  2887. })),
  2888. b.on(S.falseICECHOSEN, function(e) {
  2889. c("showcase_gui", {
  2890. gui_action: e.name + " "
  2891. })
  2892. }),
  2893. b.on(S.STORE, function(e) {
  2894. c("showcase_gui", {
  2895. gui_action: "launch_store",
  2896. store: e
  2897. })
  2898. })
  2899. }
  2900. function l(e, t) {
  2901. if (f)
  2902. try {
  2903. f.addEvent(e, v.extendObject({
  2904. host: window.location.host,
  2905. keen: n(),
  2906. user_agent: "${keen.user_agent}",
  2907. referrer: {
  2908. url: v.normalizeUrl(document.referrer),
  2909. domain: v.domainFromUrl(document.referrer),
  2910. url_original: document.referrer
  2911. },
  2912. embedded: m.inIframe(),
  2913. is_mobile: m.isMobile(),
  2914. version: "2.25.6-0-gd87e5b1"
  2915. }, t))
  2916. } catch (e) {
  2917. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2918. }
  2919. }
  2920. function c(e, t) {
  2921. if (t = t || {},
  2922. L)
  2923. try {
  2924. window.analytics.track(e, v.extendObject(t, B), {
  2925. context: {
  2926. app: {
  2927. name: "showcase",
  2928. version: "2.25.6-0-gd87e5b1"
  2929. },
  2930. screen: {
  2931. width: window.screen.width,
  2932. height: window.screen.height,
  2933. density: window.devicePixelRatio
  2934. }
  2935. }
  2936. })
  2937. } catch (t) {
  2938. console.warn("Failed to send data to segment for " + e)
  2939. }
  2940. }
  2941. function h(e, t) {
  2942. if (t = t || {},
  2943. navigator.sendBeacon && L)
  2944. try {
  2945. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2946. event: e,
  2947. anonymousId: window.analytics.user().anonymousId(),
  2948. properties: v.extendObject(t, B),
  2949. writeKey: L,
  2950. sentAt: Date.now(),
  2951. type: "track",
  2952. context: {
  2953. userAgent: m.userAgent(),
  2954. library: {
  2955. name: "showcase-beacon",
  2956. version: "2.25.6-0-gd87e5b1"
  2957. },
  2958. app: {
  2959. name: "showcase",
  2960. version: "2.25.6-0-gd87e5b1"
  2961. }
  2962. }
  2963. }))
  2964. } catch (e) {
  2965. console.warn("Failed to send async segment request")
  2966. }
  2967. }
  2968. function u(e, t) {
  2969. t = t || {},
  2970. c(e, t)
  2971. }
  2972. function d(e, t) {
  2973. O = e === C.InteractionGui ? "gui-" + t : e,
  2974. p = "self_guided"
  2975. }
  2976. var p, f, g = (e("three"),
  2977. e("./util/ajax"),
  2978. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2979. 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"),
  2980. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2981. t.exports = {
  2982. report: function(e, t, i, n) {
  2983. l("Session starts", {
  2984. model: e,
  2985. status: t,
  2986. loadtime: Date.now() - (N || Date.now()),
  2987. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2988. autoplay: i,
  2989. quickstart: n,
  2990. ab_tilegen: g.tilegen,
  2991. ab_imgopt: g.imgopt
  2992. })
  2993. },
  2994. impression: function(e) {
  2995. e = e || {};
  2996. var t = void 0 === e.isVisible || e.isVisible
  2997. , i = (void 0 !== e.immediate && e.immediate,
  2998. window.location.search.substr(1).split("&"));
  2999. u("impression", {
  3000. visible: t,
  3001. url_params: i
  3002. })
  3003. },
  3004. initKeen: function(e) {
  3005. return e.token && e.appId ? void (f = new Keen({
  3006. projectId: e.appId,
  3007. writeKey: e.token,
  3008. readKey: "",
  3009. requestType: "xhr"
  3010. })) : void P.warn("no keen token/appId")
  3011. },
  3012. initSegment: function(e) {
  3013. return e.token ? (L = e.token,
  3014. window.analytics.load(e.token),
  3015. B = {
  3016. model_id: e.model,
  3017. start_source: e.startSource,
  3018. autoplay: e.autoplay,
  3019. quickstart: e.quickstart,
  3020. language_tag: A.languageTag,
  3021. is_mobile: m.isMobile(),
  3022. iframe: m.inIframe(),
  3023. aspect_ratio: m.aspectRatio(),
  3024. session_id: F,
  3025. window: {
  3026. width: $("#player").width(),
  3027. height: $("#player").height()
  3028. },
  3029. platform: {
  3030. browser: {
  3031. name: $.ua.browser.name,
  3032. major: $.ua.browser.major,
  3033. version: $.ua.browser.version
  3034. },
  3035. os: {
  3036. name: $.ua.os.name,
  3037. version: $.ua.os.version
  3038. },
  3039. device: {
  3040. vendor: $.ua.device.vendor,
  3041. model: $.ua.device.model,
  3042. type: $.ua.device.type
  3043. }
  3044. }
  3045. },
  3046. D = Math.random() < A.analytics.sessionTrackingRate,
  3047. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  3048. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  3049. },
  3050. sessionStart: function(e) {
  3051. P.debug("analytics user_session_start"),
  3052. c("session_started"),
  3053. N = Date.now(),
  3054. window.addEventListener("unload", function() {
  3055. h("session_ended", {
  3056. duration: Date.now() - N
  3057. })
  3058. })
  3059. },
  3060. modelLoaded: function(e, t, i, n) {
  3061. r(e, t, i, n)
  3062. },
  3063. loadComplete: function(e) {
  3064. var t = {
  3065. time_to_app_start: e
  3066. };
  3067. c("load_times", t)
  3068. },
  3069. track: function(e, t) {
  3070. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3071. c(e, t))
  3072. },
  3073. trackAlways: function(e, t) {
  3074. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3075. c(e, t)
  3076. },
  3077. getSessionId: function() {
  3078. return F
  3079. },
  3080. updateInteraction: d
  3081. }
  3082. }
  3083. ).call(this, "/js/analytics.js")
  3084. }
  3085. , {
  3086. "./ab": 3,
  3087. "./enum/ControlEvents": 21,
  3088. "./enum/PlayerEvents": 40,
  3089. "./enum/VROption": 47,
  3090. "./enum/VRPlatforms": 49,
  3091. "./enum/Viewmode": 51,
  3092. "./gui/sharing/ShareEvents": 76,
  3093. "./gui/sharing/modal": 77,
  3094. "./gui/title/TitleEvents": 80,
  3095. "./gui/title/titleBar": 82,
  3096. "./gui/vr/vrEvent": 85,
  3097. "./gui/vr/vrModal": 87,
  3098. "./localization/localize": 108,
  3099. "./tag/Billboard/BillboardEvent": 120,
  3100. "./settings": 166,
  3101. "./util/ajax": 181,
  3102. "./util/browser": 182,
  3103. "./util/common": 185,
  3104. "./util/logger": 189,
  3105. three: 217
  3106. }],
  3107. 5: [function(e, t, i) {
  3108. "use strict";
  3109. function n() {
  3110. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3111. this.controls = null
  3112. }
  3113. var r = e("three")
  3114. , o = e("../constants")
  3115. , a = e("../util/cameraLight");
  3116. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3117. n.prototype.updateAspect = function(e) {
  3118. this.aspect = e,
  3119. this.updateProjectionMatrix()
  3120. }
  3121. ,
  3122. t.exports = n
  3123. }
  3124. , {
  3125. "../constants": 8,
  3126. "../util/cameraLight": 184,
  3127. three: 217
  3128. }],
  3129. 6: [function(e, t, i) {
  3130. "use strict";
  3131. function n() {
  3132. var e = $("#player").width() / $("#player").height();
  3133. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3134. this.controls = null,
  3135. this.updateAspect(e)
  3136. }
  3137. var r = e("three")
  3138. , o = e("../constants");
  3139. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3140. n.prototype.updateAspect = function(e) {
  3141. this.aspect = e,
  3142. this.top = o.orthoBase / e,
  3143. this.bottom = -o.orthoBase / e,
  3144. this.updateProjectionMatrix()
  3145. }
  3146. ,
  3147. t.exports = n
  3148. }
  3149. , {
  3150. "../constants": 8,
  3151. three: 217
  3152. }],
  3153. 7: [function(e, t, i) {
  3154. "use strict";
  3155. function n() {
  3156. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3157. this.controls = null
  3158. }
  3159. var r = e("three")
  3160. , o = e("../settings")
  3161. , a = e("../util/cameraLight");
  3162. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3163. n.prototype.updateAspect = function(e) {
  3164. this.aspect = e,
  3165. this.updateProjectionMatrix()
  3166. }
  3167. ,
  3168. t.exports = n
  3169. }
  3170. , {
  3171. "../settings": 166,
  3172. "../util/cameraLight": 184,
  3173. three: 217
  3174. }],
  3175. 8: [function(e, t, i) {
  3176. "use strict";
  3177. t.exports = {
  3178. signedUrlDefaultExpireTime: 24e4,
  3179. signedUrlCheckInterval: 1e4,
  3180. signedUrlRefreshBuffer: 15e3,
  3181. dollhouseFOV: 70,
  3182. dollhouseNear: 1,
  3183. dollhouseFar: 5e3,
  3184. insideFOV: 70,
  3185. insideFOVMax: 120,
  3186. insideNear: .1,
  3187. insideFar: 5e3,
  3188. insideLookSpeed: .12,
  3189. insideLookLimitUp: 40,
  3190. insideLookLimitDown: -40,
  3191. orthoNear: 1,
  3192. orthoFar: 5e3,
  3193. orthoBase: 10,
  3194. narrowLandscapeHeight: 290,
  3195. reallyNarrowLandscapeHeight: 250,
  3196. visionTilingStartDate: new Date("8/26/2016"),
  3197. visionTilingStartVersion: "1.1.407.13667",
  3198. windowHeightHighQualityThreshold: 900,
  3199. tourStepDelayDefault: 3500,
  3200. tourStepDelaySlideShow: 5e3,
  3201. workshopApsect: 9 / 16,
  3202. highQualityMaxZoom: 2,
  3203. ultraHighQualityMaxZoom: 3
  3204. }
  3205. }
  3206. , {}],
  3207. 9: [function(e, t, i) {
  3208. "use strict";
  3209. function n() {
  3210. this.activeControl = null,
  3211. this.controls = {},
  3212. this.cameras = {}
  3213. }
  3214. var r = e("./PanoramaControls")
  3215. , o = e("./DollhouseControls")
  3216. , a = e("./FloorplanControls")
  3217. , s = e("../cameras/PanoramaCamera")
  3218. , l = e("../cameras/DollhouseCamera")
  3219. , c = e("../cameras/FloorplanCamera")
  3220. , h = e("events").EventEmitter
  3221. , u = e("../enum/ControlEvents")
  3222. , d = e("../enum/ModelManagerEvents")
  3223. , p = e("../enum/Viewmode")
  3224. , f = e("../settings");
  3225. n.prototype = Object.create(h.prototype),
  3226. n.prototype.init = function(e, t) {
  3227. this.setUpControls(),
  3228. this.bindEvents(e, t)
  3229. }
  3230. ,
  3231. n.prototype.activateControls = function(e) {
  3232. this.activeControl && (this.activeControl.reset(),
  3233. this.activeControl.enabled = !1),
  3234. this.controls[e] && (this.controls[e].enabled = !0),
  3235. this.activeControl = this.controls[e]
  3236. }
  3237. ,
  3238. n.prototype.setUpControls = function() {
  3239. var e = {}
  3240. , t = {}
  3241. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3242. , n = [s, l, c]
  3243. , h = [r, o, a];
  3244. i.forEach(function(i, r) {
  3245. e[i] = new n[r],
  3246. t[i] = new h[r](e[i]),
  3247. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3248. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3249. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3250. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3251. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3252. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3253. }
  3254. .bind(this)),
  3255. this.controls = t,
  3256. this.cameras = e
  3257. }
  3258. ,
  3259. n.prototype.bindEvents = function(e, t) {
  3260. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3261. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3262. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3263. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3264. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3265. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3266. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3267. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3268. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3269. e.addEventListener("contextmenu", function(e) {
  3270. e.preventDefault()
  3271. }),
  3272. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3273. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3274. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3275. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3276. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3277. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3278. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3279. t.on(d.ActiveModelChanged, function(e) {
  3280. this.setModelForControls(e.model)
  3281. }
  3282. .bind(this))
  3283. }
  3284. ,
  3285. n.prototype.setModelForControls = function(e) {
  3286. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3287. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3288. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3289. this.controls[e].setBounds(t)
  3290. }
  3291. .bind(this))
  3292. }
  3293. ,
  3294. n.prototype.onMouseDown = function(e) {
  3295. e.preventDefault(),
  3296. this.activeControl && this.activeControl.onMouseDown(e)
  3297. }
  3298. ,
  3299. n.prototype.onMouseMove = function(e) {
  3300. e.preventDefault(),
  3301. this.activeControl && this.activeControl.onMouseMove(e)
  3302. }
  3303. ,
  3304. n.prototype.onMouseUp = function(e) {
  3305. e.preventDefault(),
  3306. this.activeControl && this.activeControl.onMouseUp(e)
  3307. }
  3308. ,
  3309. n.prototype.onMouseOver = function(e) {
  3310. e.preventDefault(),
  3311. this.activeControl && this.activeControl.onMouseOver(e)
  3312. }
  3313. ,
  3314. n.prototype.onMouseWheel = function(e) {
  3315. e.preventDefault(),
  3316. this.activeControl && this.activeControl.onMouseWheel(e)
  3317. }
  3318. ,
  3319. n.prototype.onTouchStart = function(e) {
  3320. e.preventDefault(),
  3321. this.activeControl && this.activeControl.onTouchStart(e);
  3322. var hotList = $('#hotListWrap')[0];
  3323. hotList.classList.remove('hotListActive');
  3324. $('#hotListContent ul .active').removeClass('active');
  3325. $('#hotList')[0].classList.remove('active')
  3326. }
  3327. ,
  3328. n.prototype.onTouchMove = function(e) {
  3329. e.preventDefault(),
  3330. this.activeControl && this.activeControl.onTouchMove(e)
  3331. }
  3332. ,
  3333. n.prototype.onTouchEnd = function(e) {
  3334. e.preventDefault(),
  3335. this.activeControl && this.activeControl.onTouchEnd(e)
  3336. }
  3337. ,
  3338. n.prototype.onPointerDown = function(e) {
  3339. if (e.preventDefault(),
  3340. this.activeControl)
  3341. switch (e.pointerType) {
  3342. case "mouse":
  3343. this.activeControl.onMouseDown(e);
  3344. break;
  3345. default:
  3346. this.activeControl.onPointerDown(e)
  3347. }
  3348. }
  3349. ,
  3350. n.prototype.onPointerMove = function(e) {
  3351. if (e.preventDefault(),
  3352. this.activeControl)
  3353. switch (e.pointerType) {
  3354. case "mouse":
  3355. this.activeControl.onMouseMove(e);
  3356. break;
  3357. default:
  3358. this.activeControl.onPointerMove(e)
  3359. }
  3360. }
  3361. ,
  3362. n.prototype.onPointerUp = function(e) {
  3363. if (e.preventDefault(),
  3364. this.activeControl)
  3365. switch (e.pointerType) {
  3366. case "mouse":
  3367. this.activeControl.onMouseUp(e);
  3368. break;
  3369. default:
  3370. this.activeControl.onPointerUp(e)
  3371. }
  3372. }
  3373. ,
  3374. n.prototype.onPointerCancel = function(e) {
  3375. e.preventDefault(),
  3376. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3377. }
  3378. ,
  3379. n.prototype.onKeyDown = function(e) {
  3380. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3381. this.activeControl && this.activeControl.onKeyDown(e))
  3382. }
  3383. ,
  3384. n.prototype.onKeyUp = function(e) {
  3385. e.preventDefault(),
  3386. this.activeControl && this.activeControl.onKeyUp(e)
  3387. }
  3388. ,
  3389. t.exports = n
  3390. }
  3391. , {
  3392. "../cameras/DollhouseCamera": 5,
  3393. "../cameras/FloorplanCamera": 6,
  3394. "../cameras/PanoramaCamera": 7,
  3395. "../enum/ControlEvents": 21,
  3396. "../enum/ModelManagerEvents": 33,
  3397. "../enum/Viewmode": 51,
  3398. "../settings": 166,
  3399. "./DollhouseControls": 10,
  3400. "./FloorplanControls": 11,
  3401. "./PanoramaControls": 13,
  3402. events: 202
  3403. }],
  3404. 10: [function(e, t, i) {
  3405. "use strict";
  3406. function n(e) {
  3407. a.call(this, e),
  3408. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3409. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3410. this.minDistance = o.dollhouseDefault.minDistance,
  3411. this.maxDistance = o.dollhouseDefault.maxDistance,
  3412. this.adjustedMinDistance = this.minDistance,
  3413. this.adjustedMaxDistance = this.maxDistance
  3414. }
  3415. var r = e("three")
  3416. , o = e("../settings")
  3417. , a = e("./OutsideControls");
  3418. n.prototype = Object.create(a.prototype),
  3419. n.prototype.pan = function(e, t) {
  3420. this.camera.updateMatrix();
  3421. var i = this.camera.position.clone().sub(this.target).length();
  3422. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3423. this.panLeft(2 * e * i / $("#player").height()),
  3424. this.panUp(-2 * t * i / $("#player").height())
  3425. }
  3426. ,
  3427. n.prototype.updateZoom = function() {
  3428. var e = this.offset.length();
  3429. return e * this.scale
  3430. }
  3431. ,
  3432. n.prototype.setZoomBounds = function(e) {
  3433. var t = e.min.distanceTo(e.max);
  3434. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3435. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3436. this.minDistance = this.adjustedMinDistance,
  3437. this.maxDistance = this.adjustedMaxDistance
  3438. }
  3439. ,
  3440. n.prototype.resetRanges = function(e, t) {
  3441. e ? (this.minDistance = Math.min(e, this.minDistance),
  3442. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3443. this.maxDistance = this.adjustedMaxDistance),
  3444. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3445. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3446. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3447. }
  3448. ,
  3449. n.prototype.toJSON = function() {
  3450. return a.prototype.toJSON.call(this)
  3451. }
  3452. ,
  3453. t.exports = n
  3454. }
  3455. , {
  3456. "../settings": 166,
  3457. "./OutsideControls": 12,
  3458. three: 217
  3459. }],
  3460. 11: [function(e, t, i) {
  3461. "use strict";
  3462. function n(e) {
  3463. a.call(this, e),
  3464. this.minDistance = 15,
  3465. this.maxDistance = 50,
  3466. this.noRotateUpDown = !0,
  3467. this.minPolarAngle = 0,
  3468. this.maxPolarAngle = 0,
  3469. this.mouseActions[l.LEFT] = s.PAN,
  3470. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3471. this.mouseActions[l.RIGHT] = s.ROTATE,
  3472. this.touchActions[1] = s.PAN,
  3473. this.touchActions[2] = s.ROTATE_DOLLY,
  3474. this.absoluteScale = 1,
  3475. this.currentScale = 1
  3476. }
  3477. var r = e("three")
  3478. , o = e("../settings")
  3479. , a = e("./OutsideControls")
  3480. , s = e("../enum/ControlActions")
  3481. , l = e("../enum/MouseButton")
  3482. , c = e("../util/math")
  3483. , h = e("../util/browser");
  3484. n.prototype = Object.create(a.prototype),
  3485. n.prototype.zoomToContain = function(e) {
  3486. var t = Math.max(e.x, e.z)
  3487. , i = Math.min(e.x, e.z)
  3488. , n = Math.max(t, i * this.camera.aspect)
  3489. , r = Math.max(i, t * this.camera.aspect);
  3490. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3491. this.currentScale = this.absoluteScale
  3492. }
  3493. ,
  3494. n.prototype.rotateToView = function(e, t) {
  3495. var i = 0
  3496. , n = h.aspectRatio() < 1
  3497. , r = e.x < e.z;
  3498. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3499. this.rotateLeft(i),
  3500. this.update(0)
  3501. }
  3502. ,
  3503. n.prototype.pan = function(e, t) {
  3504. this.camera.updateMatrix(),
  3505. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3506. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3507. }
  3508. ,
  3509. n.prototype.updateZoom = function() {
  3510. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3511. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3512. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3513. this.camera.left = -o.orthoBase * this.currentScale,
  3514. this.camera.right = o.orthoBase * this.currentScale,
  3515. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3516. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3517. this.camera.updateProjectionMatrix(),
  3518. this.offset.length()
  3519. }
  3520. ,
  3521. n.prototype.toJSON = function() {
  3522. var e = new r.Quaternion
  3523. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3524. , i = new r.Quaternion;
  3525. return function() {
  3526. var n = a.prototype.toJSON.call(this);
  3527. return e.copy(n.camera_quaternion),
  3528. i.copy(t),
  3529. i.multiply(e),
  3530. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3531. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3532. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3533. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3534. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3535. n
  3536. }
  3537. }(),
  3538. t.exports = n
  3539. }
  3540. , {
  3541. "../enum/ControlActions": 20,
  3542. "../enum/MouseButton": 34,
  3543. "../settings": 166,
  3544. "../util/browser": 182,
  3545. "../util/math": 190,
  3546. "./OutsideControls": 12,
  3547. three: 217
  3548. }],
  3549. 12: [function(e, t, i) {
  3550. "use strict";
  3551. function n(e) {
  3552. this.camera = e,
  3553. this.camera.controls = this,
  3554. this.enabled = !1,
  3555. this.target = new r.Vector3,
  3556. this.targetBounds = new r.Box3,
  3557. this.zoomSpeed = 1,
  3558. this.minDistance = 0,
  3559. this.maxDistance = 1 / 0,
  3560. this.noRotateUpDown = !1,
  3561. this.rotateSpeed = 1,
  3562. this.keyboardZoomSpeed = 0,
  3563. this.keyPanSpeed = 7,
  3564. this.autoRotate = !1,
  3565. this.autoRotateSpeed = 2,
  3566. this.autoPan = !1,
  3567. this.autoPanPosition = new r.Vector3,
  3568. this.minPolarAngle = r.Math.degToRad(25),
  3569. this.maxPolarAngle = r.Math.degToRad(65),
  3570. this.rotationAcceleration = new r.Vector2,
  3571. this.rotationSpeed = new r.Vector2,
  3572. this.panAcceleration = new r.Vector2,
  3573. this.panSpeed = new r.Vector2,
  3574. this.rotateStart = new r.Vector2,
  3575. this.rotateEnd = new r.Vector2,
  3576. this.rotateDelta = new r.Vector2,
  3577. this.panStart = new r.Vector2,
  3578. this.panEnd = new r.Vector2,
  3579. this.panDelta = new r.Vector2,
  3580. this.panOffset = new r.Vector3,
  3581. this.offset = new r.Vector3,
  3582. this.dollyStart = new r.Vector2,
  3583. this.dollyEnd = new r.Vector2,
  3584. this.dollyDelta = new r.Vector2,
  3585. this.phiDelta = 0,
  3586. this.thetaDelta = 0,
  3587. this.scale = 1,
  3588. this.panVector = new r.Vector3,
  3589. this.lastPosition = new r.Vector3,
  3590. this.state = c.NONE,
  3591. this.mouseActions = {},
  3592. this.mouseActions[h.LEFT] = c.ROTATE,
  3593. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3594. this.mouseActions[h.RIGHT] = c.PAN,
  3595. this.touchActions = {},
  3596. this.touchActions[1] = c.ROTATE,
  3597. this.touchActions[2] = c.PAN_DOLLY,
  3598. this.lastMoveTime = 0,
  3599. this.pointersLimit = 2,
  3600. this.pointers = []
  3601. }
  3602. var r = e("three")
  3603. , o = e("../settings")
  3604. , a = e("../util/common")
  3605. , s = e("../util/math")
  3606. , l = e("../enum/Vectors")
  3607. , c = e("../enum/ControlActions")
  3608. , h = e("../enum/MouseButton")
  3609. , u = e("../enum/Keys")
  3610. , d = e("../enum/ControlEvents")
  3611. , p = e("events").EventEmitter
  3612. , f = 1e-6;
  3613. n.prototype = Object.create(p.prototype),
  3614. n.prototype.setBounds = function(e) {
  3615. this.targetBounds = e
  3616. }
  3617. ,
  3618. n.prototype.isEngaged = function() {
  3619. return this.state !== c.NONE
  3620. }
  3621. ,
  3622. n.prototype.rotateLeft = function(e) {
  3623. void 0 === e && (e = this.getAutoRotationAngle()),
  3624. this.thetaDelta -= e
  3625. }
  3626. ,
  3627. n.prototype.rotateUp = function(e) {
  3628. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3629. this.phiDelta -= e)
  3630. }
  3631. ,
  3632. n.prototype.panLeft = function(e) {
  3633. var t = this.camera.matrix.elements;
  3634. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3635. this.panOffset.multiplyScalar(-e),
  3636. this.panVector.add(this.panOffset)
  3637. }
  3638. ,
  3639. n.prototype.panUp = function(e) {
  3640. var t = this.camera.matrix.elements;
  3641. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3642. this.panOffset.multiplyScalar(-e),
  3643. this.panVector.add(this.panOffset)
  3644. }
  3645. ,
  3646. n.prototype.startRotating = function(e, t) {
  3647. e && this.navRotationAcc("x", e),
  3648. t && this.navRotationAcc("y", t)
  3649. }
  3650. ,
  3651. n.prototype.stopRotating = function(e) {
  3652. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3653. this.navRotationAcc("x", 0),
  3654. this.navRotationAcc("y", 0)
  3655. }
  3656. ,
  3657. n.prototype.setAutoPanPosition = function(e, t) {
  3658. var i = new r.Vector3
  3659. , n = new r.Vector3;
  3660. return function(e, t) {
  3661. i.copy(this.camera.position),
  3662. void 0 === e && null === e || i.setX(e),
  3663. void 0 === t && null === t || i.setZ(t);
  3664. var r = this.camera.position.distanceTo(this.target)
  3665. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3666. this.targetClamped = !1,
  3667. n.copy(i).addScaledVector(o, r),
  3668. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3669. i.copy(n).addScaledVector(o, -r),
  3670. this.targetClamped = !0),
  3671. this.autoPanPosition.x = i.x,
  3672. this.autoPanPosition.z = i.z,
  3673. this.autoPan && this.stopAutoPanning()
  3674. }
  3675. }(),
  3676. n.prototype.stopAutoPanning = function() {
  3677. var e = this.autoPan;
  3678. this.autoPan = !1,
  3679. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3680. }
  3681. ,
  3682. n.prototype.dollyIn = function(e) {
  3683. void 0 === e && (e = this.getZoomScale()),
  3684. this.scale /= e
  3685. }
  3686. ,
  3687. n.prototype.dollyOut = function(e) {
  3688. void 0 === e && (e = this.getZoomScale()),
  3689. this.scale *= e
  3690. }
  3691. ,
  3692. n.prototype.updatePan = function(e) {
  3693. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3694. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3695. this.autoPan) {
  3696. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3697. t.setY(0).clampLength(0, 50 * e),
  3698. this.target.add(t),
  3699. this.camera.position.add(t),
  3700. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3701. this.stopAutoPanning())
  3702. }
  3703. }
  3704. ,
  3705. n.prototype.update = function(e) {
  3706. e || (e = 1 / 60),
  3707. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3708. this.rotateLeft(-this.rotationSpeed.x),
  3709. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3710. this.updatePan(e);
  3711. var t = this.camera.position;
  3712. this.offset.copy(t).sub(this.target);
  3713. var i = Math.atan2(this.offset.x, this.offset.z)
  3714. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3715. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3716. i += this.thetaDelta,
  3717. n += this.phiDelta,
  3718. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3719. n = Math.max(f, Math.min(Math.PI - f, n));
  3720. var r = this.updateZoom();
  3721. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3722. this.target.add(this.panVector),
  3723. this.targetBounds.clampPoint(this.target, this.target),
  3724. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3725. this.offset.y = r * Math.cos(n),
  3726. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3727. t.copy(this.target).add(this.offset),
  3728. this.camera.lookAt(this.target),
  3729. this.thetaDelta = 0,
  3730. this.phiDelta = 0,
  3731. this.scale = 1,
  3732. this.panVector.set(0, 0, 0),
  3733. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3734. }
  3735. ,
  3736. n.prototype.getAutoRotationAngle = function() {
  3737. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3738. }
  3739. ,
  3740. n.prototype.getZoomScale = function() {
  3741. return Math.pow(.95, this.zoomSpeed)
  3742. }
  3743. ,
  3744. n.prototype.onMouseDown = function(e) {
  3745. if (this.enabled) {
  3746. switch (e.preventDefault(),
  3747. this.stopAutoPanning(),
  3748. this.mouseDown = !0,
  3749. this.state = this.mouseActions[e.button],
  3750. this.state) {
  3751. case c.ROTATE:
  3752. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3753. this.rotationSpeed.set(0, 0);
  3754. break;
  3755. case c.DOLLY:
  3756. this.dollyStart.set(e.clientX, e.clientY);
  3757. break;
  3758. case c.PAN:
  3759. this.panStart.set(e.clientX, e.clientY)
  3760. }
  3761. this.emit(d.InputStart, "mouse")
  3762. }
  3763. }
  3764. ,
  3765. n.prototype.onMouseMove = function(e) {
  3766. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3767. switch (e.preventDefault(),
  3768. this.state) {
  3769. case c.ROTATE:
  3770. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3771. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3772. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3773. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3774. this.rotateStart.copy(this.rotateEnd);
  3775. break;
  3776. case c.DOLLY:
  3777. this.dollyEnd.set(e.clientX, e.clientY),
  3778. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3779. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3780. t.call(this),
  3781. this.dollyStart.copy(this.dollyEnd);
  3782. break;
  3783. case c.PAN:
  3784. this.panEnd.set(e.clientX, e.clientY),
  3785. this.panDelta.subVectors(this.panEnd, this.panStart),
  3786. this.pan(this.panDelta.x, this.panDelta.y),
  3787. this.panStart.copy(this.panEnd)
  3788. }
  3789. this.emit(d.Move, "mouse"),
  3790. this.lastMoveTime = e.timeStamp,
  3791. this.update()
  3792. }
  3793. }
  3794. ,
  3795. n.prototype.onMouseUp = function(e) {
  3796. this.enabled && (this.mouseDown = !1,
  3797. this.state = c.NONE,
  3798. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3799. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3800. this.update(),
  3801. this.rotationAcceleration.set(0, 0),
  3802. this.rotateDelta.set(0, 0)))
  3803. }
  3804. ,
  3805. n.prototype.onMouseOver = function(e) {
  3806. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3807. }
  3808. ,
  3809. n.prototype.onMouseWheel = function(e) {
  3810. if (this.enabled && o.useWheel) {
  3811. this.emit(d.Move, "wheel");
  3812. var t = e.wheelDelta || -e.detail
  3813. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3814. i.call(this),
  3815. this.update()
  3816. }
  3817. }
  3818. ,
  3819. n.prototype.onKeyDown = function(e) {
  3820. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3821. this.handleKeyDown(e.which)))
  3822. }
  3823. ,
  3824. n.prototype.navRotationAcc = function(e, t) {
  3825. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3826. }
  3827. ,
  3828. n.prototype.navPanAcc = function(e, t) {
  3829. this.stopAutoPanning(),
  3830. this.panAcceleration[e] = t
  3831. }
  3832. ,
  3833. n.prototype.handleKeyDown = function(e) {
  3834. var t = !0;
  3835. switch (e) {
  3836. case u.UPARROW:
  3837. case u.I:
  3838. this.navRotationAcc("y", 1);
  3839. break;
  3840. case u.DOWNARROW:
  3841. case u.K:
  3842. this.navRotationAcc("y", -1);
  3843. break;
  3844. case u.LEFTARROW:
  3845. case u.J:
  3846. this.navRotationAcc("x", -1);
  3847. break;
  3848. case u.RIGHTARROW:
  3849. case u.L:
  3850. this.navRotationAcc("x", 1);
  3851. break;
  3852. case u.W:
  3853. this.navPanAcc("y", 1);
  3854. break;
  3855. case u.S:
  3856. this.navPanAcc("y", -1);
  3857. break;
  3858. case u.A:
  3859. this.navPanAcc("x", -1);
  3860. break;
  3861. case u.D:
  3862. this.navPanAcc("x", 1);
  3863. break;
  3864. default:
  3865. t = !1
  3866. }
  3867. t && this.emit(d.Move, "key")
  3868. }
  3869. ,
  3870. n.prototype.onKeyUp = function(e) {
  3871. this.enabled && (e.preventDefault(),
  3872. e.stopPropagation(),
  3873. this.handleKeyUp(e.which))
  3874. }
  3875. ,
  3876. n.prototype.handleKeyUp = function(e) {
  3877. switch (e) {
  3878. case u.I:
  3879. case u.K:
  3880. case u.UPARROW:
  3881. case u.DOWNARROW:
  3882. this.keyboardZoomSpeed = 0,
  3883. this.rotationAcceleration.y = 0;
  3884. break;
  3885. case u.J:
  3886. case u.L:
  3887. case u.LEFTARROW:
  3888. case u.RIGHTARROW:
  3889. this.rotationAcceleration.x = 0;
  3890. break;
  3891. case u.S:
  3892. case u.W:
  3893. this.panAcceleration.y = 0;
  3894. break;
  3895. case u.A:
  3896. case u.D:
  3897. this.panAcceleration.x = 0
  3898. }
  3899. }
  3900. ,
  3901. n.prototype.onTouchStart = function(e) {
  3902. if (this.enabled || this.state === c.NONE) {
  3903. e.preventDefault(),
  3904. e.stopPropagation(),
  3905. this.stopAutoPanning();
  3906. var t = function() {
  3907. if (2 === e.touches.length) {
  3908. var t = e.touches[0].pageX - e.touches[1].pageX
  3909. , i = e.touches[0].pageY - e.touches[1].pageY;
  3910. this.dollyStart.set(t, i)
  3911. }
  3912. }
  3913. .bind(this)
  3914. , i = function() {
  3915. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3916. }
  3917. .bind(this)
  3918. , n = function() {
  3919. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3920. }
  3921. .bind(this);
  3922. switch (this.state = this.touchActions[e.touches.length],
  3923. this.state) {
  3924. case c.PAN_DOLLY:
  3925. t();
  3926. case c.PAN:
  3927. i();
  3928. break;
  3929. case c.ROTATE_DOLLY:
  3930. t();
  3931. case c.ROTATE:
  3932. n()
  3933. }
  3934. this.rotationSpeed.set(0, 0),
  3935. this.emit(d.InputStart, "touch")
  3936. }
  3937. }
  3938. ,
  3939. n.prototype.onTouchMove = function(e) {
  3940. if (this.enabled && this.state !== c.NONE) {
  3941. e.preventDefault(),
  3942. e.stopPropagation();
  3943. var t = function() {
  3944. var t = e.touches[0].pageX - e.touches[1].pageX
  3945. , i = e.touches[0].pageY - e.touches[1].pageY;
  3946. this.dollyEnd.set(t, i);
  3947. var n = this.dollyStart.length() - this.dollyEnd.length();
  3948. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3949. this.dollyStart.copy(this.dollyEnd)
  3950. }
  3951. .bind(this)
  3952. , i = function() {
  3953. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3954. this.panDelta.subVectors(this.panEnd, this.panStart),
  3955. this.pan(this.panDelta.x, this.panDelta.y),
  3956. this.panStart.copy(this.panEnd),
  3957. this.rotateDelta.set(0, 0)
  3958. }
  3959. .bind(this)
  3960. , n = function() {
  3961. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3962. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3963. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3964. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3965. this.rotateStart.copy(this.rotateEnd)
  3966. }
  3967. .bind(this)
  3968. , r = function() {
  3969. if (2 === e.touches.length) {
  3970. var i = window.devicePixelRatio || 1
  3971. , r = e.touches[1].pageX - e.touches[0].pageX
  3972. , s = e.touches[1].pageY - e.touches[0].pageY
  3973. , l = Math.sqrt(r * r + s * s)
  3974. , h = Math.abs(this.dollyStart.length() - l);
  3975. if (h > o.input.touchMoveThreshold * i)
  3976. this.state = c.DOLLY,
  3977. t();
  3978. else {
  3979. var u = a.average(e.touches, "pageX")
  3980. , d = a.average(e.touches, "pageY")
  3981. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3982. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3983. this.rotateStart.set(u, d),
  3984. n())
  3985. }
  3986. }
  3987. }
  3988. .bind(this);
  3989. switch (this.state) {
  3990. case c.PAN_DOLLY:
  3991. t();
  3992. case c.PAN:
  3993. i();
  3994. break;
  3995. case c.ROTATE_DOLLY:
  3996. r();
  3997. break;
  3998. case c.DOLLY:
  3999. t();
  4000. break;
  4001. case c.ROTATE:
  4002. n();
  4003. break;
  4004. default:
  4005. this.state = c.NONE
  4006. }
  4007. this.lastMoveTime = e.timeStamp,
  4008. this.emit(d.Move, "touch")
  4009. }
  4010. }
  4011. ,
  4012. n.prototype.onTouchEnd = function(e) {
  4013. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4014. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4015. this.state = c.NONE,
  4016. this.update(),
  4017. this.rotationAcceleration.set(0, 0),
  4018. this.rotateDelta.set(0, 0))
  4019. }
  4020. ,
  4021. n.prototype.onPointerDown = function(e) {
  4022. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4023. id: e.pointerId,
  4024. pageX: e.pageX,
  4025. pageY: e.pageY
  4026. }),
  4027. e.touches = this.pointers,
  4028. this.onTouchStart(e)),
  4029. this.emit(d.InputStart, "pointer"))
  4030. }
  4031. ,
  4032. n.prototype.onPointerMove = function(e) {
  4033. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4034. e.pointerId === t.id && (t.pageX = e.pageX,
  4035. t.pageY = e.pageY)
  4036. }),
  4037. e.touches = this.pointers,
  4038. this.onTouchMove(e))
  4039. }
  4040. ,
  4041. n.prototype.onPointerUp = function(e) {
  4042. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4043. e.pointerId === t.id && this.pointers.splice(i, 1)
  4044. }
  4045. .bind(this)),
  4046. e.touches = this.pointers,
  4047. this.onTouchEnd(e))
  4048. }
  4049. ,
  4050. n.prototype.reset = function() {
  4051. this.state = c.NONE,
  4052. this.stopAutoPanning(),
  4053. this.rotationSpeed.set(0, 0),
  4054. this.rotationAcceleration.set(0, 0),
  4055. this.panSpeed.set(0, 0),
  4056. this.panAcceleration.set(0, 0)
  4057. }
  4058. ,
  4059. n.prototype.toJSON = function() {
  4060. var e = {
  4061. camera_position: {
  4062. x: s.toPrecision(this.camera.position.x, 4),
  4063. y: s.toPrecision(this.camera.position.y, 4),
  4064. z: s.toPrecision(this.camera.position.z, 4)
  4065. },
  4066. camera_quaternion: {
  4067. x: s.toPrecision(this.camera.quaternion.x, 4),
  4068. y: s.toPrecision(this.camera.quaternion.y, 4),
  4069. z: s.toPrecision(this.camera.quaternion.z, 4),
  4070. w: s.toPrecision(this.camera.quaternion.w, 4)
  4071. }
  4072. };
  4073. return e
  4074. }
  4075. ,
  4076. t.exports = n
  4077. }
  4078. , {
  4079. "../enum/ControlActions": 20,
  4080. "../enum/ControlEvents": 21,
  4081. "../enum/Keys": 30,
  4082. "../enum/MouseButton": 34,
  4083. "../enum/Vectors": 50,
  4084. "../settings": 166,
  4085. "../util/common": 185,
  4086. "../util/math": 190,
  4087. events: 202,
  4088. three: 217
  4089. }],
  4090. 13: [function(e, t, i) {
  4091. (function(i) {
  4092. "use strict";
  4093. function n(e) {
  4094. this.camera = e,
  4095. this.camera.controls = this,
  4096. this.target = new r.Vector3(0,0,0),
  4097. this.lookVector = new r.Vector3,
  4098. this.lookSpeed = .05,
  4099. this.rotationAcc = new r.Vector2,
  4100. this.rotationSpeed = new r.Vector2,
  4101. this.lat = 0,
  4102. this.lon = 0,
  4103. this.phi = 0,
  4104. this.theta = 0,
  4105. this.enabled = !1,
  4106. this.locked = !1,
  4107. this.pointer = new r.Vector2(0,0),
  4108. this.rotationHistory = [],
  4109. this.rotationDifference = new r.Vector2,
  4110. this.pointerDragOn = !1,
  4111. this.pointerDragStart = new r.Vector2(0,0),
  4112. this.pinchDistance = 0,
  4113. this.moveStart = new r.Vector2,
  4114. this.moveTolerance = .01,
  4115. this.pointersLimit = 2,
  4116. this.pointers = []
  4117. }
  4118. var r = e("three")
  4119. , o = e("../util/logger")
  4120. , a = e("../settings")
  4121. , s = e("../util/common")
  4122. , l = e("../util/math")
  4123. , c = (e("../enum/Vectors"),
  4124. e("../enum/MouseButton"))
  4125. , h = e("../enum/Keys")
  4126. , u = e("../enum/ControlEvents")
  4127. , d = e("events").EventEmitter;
  4128. new o(i);
  4129. n.prototype = Object.create(d.prototype),
  4130. n.prototype.usable = function() {
  4131. return this.enabled && !this.locked
  4132. }
  4133. ,
  4134. n.prototype.lookAt = function(e) {
  4135. var t = this.camera.position.clone().sub(e)
  4136. , i = Math.atan(t.z / t.x);
  4137. i += t.x < 0 ? Math.PI : 0,
  4138. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4139. this.lon = r.Math.radToDeg(i) + 180;
  4140. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4141. , o = Math.atan(t.y / n);
  4142. this.lat = -r.Math.radToDeg(o)
  4143. }
  4144. ,
  4145. n.prototype.startRotationFrom = function(e, t) {
  4146. l.convertScreenPositionToNDC(e, t, this.pointer),
  4147. this.pointerDragOn = !0,
  4148. this.pointerDragStart.copy(this.pointer),
  4149. this.moveStart.copy(this.pointer),
  4150. this.rotationHistory = [],
  4151. this.rotationSpeed.set(0, 0)
  4152. }
  4153. ,
  4154. n.prototype.onMouseOver = function(e) {
  4155. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4156. }
  4157. ,
  4158. n.prototype.onTouchStart = function(e) {
  4159. if (this.usable()) {
  4160. switch (e.preventDefault(),
  4161. e.stopPropagation(),
  4162. e.touches.length) {
  4163. case 1:
  4164. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4165. break;
  4166. case 2:
  4167. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4168. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4169. this.pinchDistance = Math.sqrt(t * t + i * i)
  4170. }
  4171. this.emit(u.InputStart, "touch")
  4172. }
  4173. }
  4174. ,
  4175. n.prototype.onPointerDown = function(e) {
  4176. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4177. id: e.pointerId,
  4178. clientX: e.clientX,
  4179. clientY: e.clientY
  4180. }),
  4181. e.touches = this.pointers,
  4182. this.onTouchStart(e),
  4183. this.emit(u.InputStart, "pointer"))
  4184. }
  4185. ,
  4186. n.prototype.onMouseDown = function(e) {
  4187. if (this.usable()) {
  4188. switch (e.preventDefault(),
  4189. e.stopPropagation(),
  4190. e.button) {
  4191. case c.LEFT:
  4192. this.startRotationFrom(e.clientX, e.clientY)
  4193. }
  4194. this.emit(u.InputStart, "mouse")
  4195. }
  4196. }
  4197. ,
  4198. n.prototype.updateRotation = function() {
  4199. if (this.usable() && this.pointerDragOn) {
  4200. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4201. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4202. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4203. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4204. , o = Math.atan2(e.y, i)
  4205. , a = Math.atan2(t.y, n);
  4206. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4207. e.y = 0,
  4208. t.y = 0;
  4209. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4210. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4211. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4212. this.pointerDragStart.copy(this.pointer)
  4213. }
  4214. }
  4215. ,
  4216. n.prototype.onMouseMove = function(e) {
  4217. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4218. 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"))
  4219. }
  4220. ,
  4221. n.prototype.onTouchMove = function(e) {
  4222. if (this.usable())
  4223. switch (this.emit(u.Move, "touch"),
  4224. e.touches.length) {
  4225. case 1:
  4226. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4227. break;
  4228. case 2:
  4229. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4230. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4231. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4232. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4233. this.emit(u.Pinch, n),
  4234. this.pinchDistance -= n)
  4235. }
  4236. }
  4237. ,
  4238. n.prototype.onPointerMove = function(e) {
  4239. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4240. e.pointerId === t.id && (t.clientX = e.clientX,
  4241. t.clientY = e.clientY)
  4242. }),
  4243. e.touches = this.pointers,
  4244. this.onTouchMove(e))
  4245. }
  4246. ,
  4247. n.prototype.endRotation = function() {
  4248. this.pointerDragOn = !1;
  4249. var e = s.averageVectors(this.rotationHistory);
  4250. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4251. }
  4252. ,
  4253. n.prototype.onTouchEnd = function(e) {
  4254. this.usable() && (e.preventDefault(),
  4255. e.stopPropagation(),
  4256. this.endRotation())
  4257. }
  4258. ,
  4259. n.prototype.onMouseUp = function(e) {
  4260. this.usable() && (e.preventDefault(),
  4261. e.stopPropagation(),
  4262. this.endRotation())
  4263. }
  4264. ,
  4265. n.prototype.onPointerUp = function(e) {
  4266. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4267. e.pointerId === t.id && this.pointers.splice(i, 1)
  4268. }
  4269. .bind(this)),
  4270. e.touches = this.pointers,
  4271. this.onTouchEnd(e))
  4272. }
  4273. ,
  4274. n.prototype.update = function(e) {
  4275. this.lon,
  4276. this.lat;
  4277. for (this.updateRotation(),
  4278. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4279. this.rotationHistory.shift();
  4280. this.lon += this.rotationDifference.x,
  4281. this.lat += this.rotationDifference.y,
  4282. this.rotationDifference.set(0, 0),
  4283. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4284. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4285. this.lon += this.rotationSpeed.x * e,
  4286. this.lat += this.rotationSpeed.y * e
  4287. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4288. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4289. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4290. 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 );
  4291. this.phi = r.Math.degToRad(90 - this.lat),
  4292. this.theta = r.Math.degToRad(this.lon),
  4293. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4294. this.lookVector.y = Math.cos(this.phi),
  4295. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4296. this.target.copy(this.lookVector).add(this.camera.position),
  4297. this.camera.lookAt(this.target)
  4298. }
  4299. ,
  4300. n.prototype.onMouseWheel = function(e) {
  4301. if (this.usable()) {
  4302. var t = e.wheelDelta || -e.detail;
  4303. this.emit(u.InteractionDirect),
  4304. this.emit(u.Scroll, t)
  4305. }
  4306. }
  4307. ,
  4308. n.prototype.onKeyDown = function(e) {
  4309. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4310. this.handleKeyDown(e.which)))
  4311. }
  4312. ,
  4313. n.prototype.handleKeyDown = function(e) {
  4314. var t = function(e, t) {
  4315. this.rotationAcc[e] = t
  4316. }
  4317. .bind(this);
  4318. this.emit(u.InteractionKey);
  4319. var i = !0;
  4320. switch (e) {
  4321. case h.LEFTARROW:
  4322. case h.J:
  4323. t("x", -1);
  4324. break;
  4325. case h.RIGHTARROW:
  4326. case h.L:
  4327. t("x", 1);
  4328. break;
  4329. case h.I:
  4330. t("y", 1);
  4331. break;
  4332. case h.K:
  4333. t("y", -1);
  4334. break;
  4335. default:
  4336. i = !1
  4337. }
  4338. i && this.emit(u.Move, "key")
  4339. }
  4340. ,
  4341. n.prototype.onKeyUp = function(e) {
  4342. this.usable() && (e.preventDefault(),
  4343. e.stopPropagation(),
  4344. this.handleKeyUp(e.which))
  4345. }
  4346. ,
  4347. n.prototype.handleKeyUp = function(e) {
  4348. switch (e) {
  4349. case h.LEFTARROW:
  4350. case h.J:
  4351. case h.RIGHTARROW:
  4352. case h.L:
  4353. this.rotationAcc.x = 0;
  4354. break;
  4355. case h.I:
  4356. case h.K:
  4357. this.rotationAcc.y = 0
  4358. }
  4359. }
  4360. ,
  4361. n.prototype.startRotating = function(e, t) {
  4362. e && (this.rotationAcc.x = e),
  4363. t && (this.rotationAcc.y = t)
  4364. }
  4365. ,
  4366. n.prototype.stopRotating = function(e) {
  4367. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4368. this.rotationAcc.set(0, 0)
  4369. }
  4370. ,
  4371. n.prototype.reset = function() {
  4372. this.pointerDragOn = !1,
  4373. this.rotationAcc.set(0, 0),
  4374. this.rotationSpeed.set(0, 0),
  4375. this.pointers = []
  4376. }
  4377. ,
  4378. n.prototype.toJSON = function() {
  4379. var e = {
  4380. camera_position: {
  4381. x: l.toPrecision(this.camera.position.x, 4),
  4382. y: l.toPrecision(this.camera.position.y, 4),
  4383. z: l.toPrecision(this.camera.position.z, 4)
  4384. },
  4385. camera_quaternion: {
  4386. x: l.toPrecision(this.camera.quaternion.x, 4),
  4387. y: l.toPrecision(this.camera.quaternion.y, 4),
  4388. z: l.toPrecision(this.camera.quaternion.z, 4),
  4389. w: l.toPrecision(this.camera.quaternion.w, 4)
  4390. }
  4391. };
  4392. return e
  4393. }
  4394. ,
  4395. n.prototype.setStateFromJSON = function(e) {
  4396. this.camera.position.copy(e.camera_position),
  4397. this.camera.quaternion.copy(e.camera_quaternion)
  4398. }
  4399. ,
  4400. t.exports = n
  4401. }
  4402. ).call(this, "/js/controls/PanoramaControls.js")
  4403. }
  4404. , {
  4405. "../enum/ControlEvents": 21,
  4406. "../enum/Keys": 30,
  4407. "../enum/MouseButton": 34,
  4408. "../enum/Vectors": 50,
  4409. "../settings": 166,
  4410. "../util/common": 185,
  4411. "../util/logger": 189,
  4412. "../util/math": 190,
  4413. events: 202,
  4414. three: 217
  4415. }],
  4416. 14: [function(e, t, i) {
  4417. (function(i) {
  4418. "use strict";
  4419. var n = e("three")
  4420. , r = e("../enum/Viewmode")
  4421. , o = e("../util/logger")
  4422. , a = new o(i);
  4423. t.exports = {
  4424. serialize: function(e) {
  4425. return encodeURI(JSON.stringify(e))
  4426. },
  4427. deserialize: function(e) {
  4428. function t(e) {
  4429. function t(e, t) {
  4430. return e && "number" == typeof t && !isNaN(t)
  4431. }
  4432. return e.reduce(t, !0)
  4433. }
  4434. try {
  4435. var i = JSON.parse(decodeURI(e))
  4436. , o = {
  4437. mode: r.fromInt(i.camera_mode),
  4438. panoId: i.scan_id,
  4439. position: (new n.Vector3).copy(i.camera_position),
  4440. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4441. zoom: i.ortho_zoom,
  4442. floorVisibility: i.floor_visibility
  4443. }
  4444. , s = o.position;
  4445. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4446. var l = o.quaternion;
  4447. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4448. o
  4449. } catch (i) {
  4450. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4451. try {
  4452. var c = e.split(",")
  4453. , h = {
  4454. x: parseFloat(c[2]),
  4455. y: parseFloat(c[3]),
  4456. z: parseFloat(c[4])
  4457. }
  4458. , u = {
  4459. x: parseFloat(c[5]),
  4460. y: parseFloat(c[6]),
  4461. z: parseFloat(c[7]),
  4462. w: parseFloat(c[8])
  4463. };
  4464. return t([h.x, h.y, h.z]) || (h.x = 0,
  4465. h.y = 0,
  4466. h.z = 0),
  4467. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4468. u.y = 0,
  4469. u.z = 0,
  4470. u.w = 1),
  4471. {
  4472. mode: r.fromInt(c[0]),
  4473. panoId: c[1],
  4474. position: (new n.Vector3).copy(h),
  4475. quaternion: (new n.Quaternion).copy(u)
  4476. }
  4477. } catch (t) {
  4478. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4479. }
  4480. }
  4481. return null
  4482. }
  4483. }
  4484. }
  4485. ).call(this, "/js/controls/serializer.js")
  4486. }
  4487. , {
  4488. "../enum/Viewmode": 51,
  4489. "../util/logger": 189,
  4490. three: 217
  4491. }],
  4492. 15: [function(e, t, i) {
  4493. (function(i) {
  4494. "use strict";
  4495. function n() {
  4496. this.endlessLoop = a.warp.loop,
  4497. this.clock = new r.Clock(!0),
  4498. this.model = null,
  4499. this.player = null,
  4500. this.currentItem = null,
  4501. this.destinationItem = null,
  4502. this.tourIsPlaying = !1,
  4503. this.transitionStage = y.None,
  4504. this.nextFunc = null,
  4505. this.onTheBus = !1,
  4506. this.tourInProgress = !1,
  4507. this.reachSource = null,
  4508. this.interrupted = !1,
  4509. this.nItems = 0,
  4510. this.walkingSectionPaused = !1
  4511. }
  4512. var r = e("three")
  4513. , o = e("./util/logger")
  4514. , a = e("./settings")
  4515. , s = e("./util/transitions")
  4516. , l = e("events").EventEmitter
  4517. , c = e("./enum/Viewmode")
  4518. , h = e("./analytics")
  4519. , u = e("./enum/WarpStyle")
  4520. , s = e("./util/transitions")
  4521. , d = (e("./model/ModelManager"),
  4522. e("./enum/ModelManagerEvents"))
  4523. , p = e("./enum/DirectorEvents")
  4524. , f = e("./enum/PlayerEvents")
  4525. , g = (e("./enum/ControlEvents"),
  4526. e("./enum/BlackoutStyle"))
  4527. , m = e("./enum/PathDiscardMode")
  4528. , v = e("./enum/PathDisplayMode")
  4529. , A = (e("./player"),
  4530. new o(i))
  4531. , y = Object.freeze({
  4532. None: 0,
  4533. Moving: 1,
  4534. Aiming: 2,
  4535. Interlude: 3
  4536. })
  4537. , C = Object.freeze({
  4538. Forward: 1,
  4539. NoChange: 0,
  4540. Backwards: -1
  4541. })
  4542. , I = s.getUniqueId();
  4543. n.prototype = Object.create(l.prototype),
  4544. n.prototype.init = function(e, t) {
  4545. this.player = e,
  4546. this.modelManager = t,
  4547. this.updateModel(),
  4548. this.resetAll(),
  4549. this.bindEvents()
  4550. }
  4551. ,
  4552. n.prototype.resetAll = function() {
  4553. if (this.currentItem = null,
  4554. this.destinationItem = null,
  4555. this.tourIsPlaying = !1,
  4556. this.bgmReplay(),//xzw
  4557. this.transitionStage = y.None,
  4558. this.nextFunc = null,
  4559. this.onTheBus = !1,
  4560. this.reachSource = null,
  4561. this.interrupted = !1,
  4562. this.model) {
  4563. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4564. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4565. } else
  4566. this.defaultWarpStyle = u.BLACK,
  4567. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4568. this.resetSpecialTransition()
  4569. }
  4570. ,
  4571. n.prototype.updateModel = function() {
  4572. this.model = this.modelManager.getActiveModel(),
  4573. this.nItems = this.model.heroLocations.length
  4574. }
  4575. ,
  4576. n.prototype.bindEvents = function() {
  4577. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4578. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4579. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4580. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4581. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4582. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4583. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4584. this.player.once(f.Move, function() {
  4585. s.cancelById(I)
  4586. })
  4587. }
  4588. ,
  4589. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4590. return e === u.WALK && (this.interrupt(g.NONE),
  4591. this.pauseWalkingSection(),
  4592. this.player.fastForwardActivePanoFlight(),
  4593. !0)
  4594. }
  4595. ,
  4596. n.prototype.handlePlayerMove = function(e) {
  4597. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4598. this.emit("update.controls")
  4599. }
  4600. ,
  4601. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4602. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4603. this.emit("update.controls"))
  4604. }
  4605. ,
  4606. n.prototype.handlePlayerModeChanged = function(e, t) {
  4607. this.intermediateState() || e === t || (this.onTheBus = !1,
  4608. this.emit("update.controls"))
  4609. }
  4610. ,
  4611. n.prototype.handlePlayerInputStart = function(e) {
  4612. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4613. }
  4614. ,
  4615. n.prototype.handlePlayerFlyingStarted = function() {
  4616. this.clearWalkingSectionPaused()
  4617. }
  4618. ,
  4619. n.prototype.describe = function() {
  4620. return {
  4621. nItems: this.nItems,
  4622. currentItem: this.currentItem,
  4623. destinationItem: this.destinationItem,
  4624. tourIsPlaying: this.tourIsPlaying,
  4625. onTheBus: this.onTheBus,
  4626. endlessLoop: this.endlessLoop,
  4627. viewMode: this.player.mode,
  4628. inTransition: this._inTransition(),
  4629. transitionStage: this.transitionStage,
  4630. tourInProgress: this.tourInProgress
  4631. }
  4632. }
  4633. ,
  4634. n.prototype._inTransition = function() {
  4635. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4636. }
  4637. ,
  4638. n.prototype.bounceable = function() {
  4639. var e = this.clock.getDelta();
  4640. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4641. }
  4642. ,
  4643. n.prototype.itemCompare = function(item1, item2, type){//add
  4644. if(type == 'equal'){//==
  4645. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4646. }else if(type == 'less'){//<
  4647. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4648. }
  4649. }
  4650. n.prototype.currentMoveDirection = function() {
  4651. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4652. 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
  4653. }
  4654. ,
  4655. n.prototype.clearPath = function() {
  4656. this._inTransition() || this.player.path.discardPathObject()
  4657. }
  4658. ,
  4659. n.prototype.allFloors = function() {
  4660. this.model.toggleAllFloors()
  4661. }
  4662. ,
  4663. n.prototype.actionComplete = function(e) {
  4664. if (this.interrupted = !1,
  4665. this.transitionStage = y.None,
  4666. this.resetSpecialTransition(),
  4667. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4668. this.tourIsPlaying || (this.player.disablePreRendering(),
  4669. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4670. this.emit("update.controls"),
  4671. this.nextFunc) {
  4672. var t = this.nextFunc;
  4673. this.nextFunc = null,
  4674. t()
  4675. }
  4676. }
  4677. ,
  4678. n.prototype.awaitCompletion = function(e, t) {
  4679. this.nextFunc = t,
  4680. e()
  4681. }
  4682. ,
  4683. n.prototype.updateSuccessFunction = function(e) {
  4684. this.nextFunc = e
  4685. }
  4686. ,
  4687. n.prototype.interrupt = function(e, t) {
  4688. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4689. this.tourIsPlaying = !1,
  4690. this.bgmReplay(),//xzw
  4691. this.interrupted = !0,
  4692. this.nextFunc = null,
  4693. this.emit(p.ActionInterrupted),
  4694. null !== e && void 0 !== e || (e = g.BEGINNING),
  4695. this.player.interruptAndFastForward(e, t),
  4696. !0)
  4697. }
  4698. ,
  4699. n.prototype.wouldInterrupt = function() {
  4700. return this.transitionStage !== y.None
  4701. }
  4702. ,
  4703. n.prototype.intermediateState = function() {
  4704. return this.transitionStage !== y.None
  4705. }
  4706. ,
  4707. n.prototype.isInterrupted = function() {
  4708. return this.interrupted
  4709. }
  4710. ,
  4711. n.prototype.pauseWalkingSection = function() {
  4712. this.walkingSectionPaused = !0
  4713. }
  4714. ,
  4715. n.prototype.clearWalkingSectionPaused = function() {
  4716. this.walkingSectionPaused = !1
  4717. }
  4718. ,
  4719. n.prototype.autoTour = function() {
  4720. var e = Date.now();
  4721. this.model.auxDataPromise.then(function() {
  4722. e = Date.now() - e;
  4723. var t = a.warp.auto
  4724. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4725. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4726. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4727. done: function() {
  4728. this.playTour()
  4729. }
  4730. .bind(this),
  4731. name: "_atr",
  4732. id: I
  4733. })
  4734. }
  4735. .bind(this))
  4736. }
  4737. ,
  4738. n.prototype.atDestinationPano = function() {
  4739. if (!this.player.currentPano || null === this.destinationItem)
  4740. return !1;
  4741. var e = this.player.currentPano.id;
  4742. if (void 0 === e)
  4743. return !1;
  4744. var t = this.model.heroLocations;
  4745. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4746. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4747. return destination && destination.panoId == e
  4748. }
  4749. ,
  4750. n.prototype.redirectToItem = function(e, t) {
  4751. if (null === e || void 0 === e)
  4752. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4753. if (!this.wouldInterrupt())
  4754. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4755. if (this.player.mode === c.TRANSITIONING)
  4756. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4757. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4758. var i = function() {
  4759. s.setTimeout(function() {
  4760. this.setDestinationItem(e),
  4761. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4762. }
  4763. .bind(this), 0)
  4764. }
  4765. .bind(this);
  4766. this.interrupt(g.END, 0),
  4767. this.updateSuccessFunction(i)
  4768. }
  4769. ,
  4770. n.prototype.useSpecialTransition = function(e) {
  4771. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4772. this.nextWarpStyle = u.BLACK
  4773. }
  4774. ,
  4775. n.prototype.resetSpecialTransition = function() {
  4776. this.nextWarpStyle = this.defaultWarpStyle
  4777. }
  4778. ,
  4779. n.prototype.arrivedAtDestination = function(e) {
  4780. if (this.player.flying || this.player.isWarping())
  4781. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4782. else {
  4783. this.transitionStage = y.Aiming;
  4784. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4785. this.player.model.fadePanoMarkers(0),
  4786. this.awaitCompletion(function() {
  4787. this.resetSpecialTransition(),
  4788. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4789. }
  4790. .bind(this), t)
  4791. }
  4792. }
  4793. ,
  4794. n.prototype.goToDestination = function(e, t, i, n) {
  4795. //音频
  4796. //if(this.destinationItem[1] == 0){//如果是每个folder的起始
  4797. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4798. if(musicInfo && musicInfo.music){
  4799. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4800. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4801. let audioSrc2 = o.split('/').pop();
  4802. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4803. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4804. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4805. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4806. g_tourAudio.play()
  4807. }
  4808. }else{//很可能是该folder的起始
  4809. g_tourAudio.src = manage.dealURL(o);
  4810. g_tourAudio.load()
  4811. }
  4812. }
  4813. //}
  4814. if (this.onTheBus = !0,
  4815. this.emit("update.controls"),
  4816. this.player.updateLastView(),
  4817. !n && this.atDestinationPano()){
  4818. /*
  4819. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4820. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4821. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4822. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4823. } */
  4824. return void this.arrivedAtDestination(!0);
  4825. }
  4826. if (this.player.flying || this.player.isWarping())
  4827. A.warn("Cannot go to new destination while player is flying or warping.");
  4828. else {
  4829. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4830. , o = null
  4831. , a1 = null;
  4832. if (r.isPano()) {
  4833. var s = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4834. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4835. o = this.arrivedAtDestination.bind(this, !0)
  4836. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4837. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4838. }
  4839. } else{
  4840. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4841. o = this.arrivedAtDestination.bind(this, !1);
  4842. }
  4843. this.transitionStage = y.Moving,
  4844. this.model.fadePanoMarkers(0),
  4845. this.awaitCompletion(function() {
  4846. a1();
  4847. }
  4848. .bind(this), o),
  4849. this.emit("update.controls")
  4850. }
  4851. }
  4852. ,
  4853. n.prototype.tourInterlude = function() {
  4854. if (h.trackAlways("reach_highlight", {
  4855. reach_source: this.reachSource
  4856. }),
  4857. this.model.fadePanoMarkers(0),
  4858. this.emit("update.controls"),
  4859. this.tourIsPlaying)
  4860. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4861. this.stopTour(true),
  4862. this.emit(p.TourEnd),
  4863. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4864. this.transitionStage = y.Interlude,
  4865. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4866. }
  4867. .bind(this), this.goNext.bind(this))
  4868. }
  4869. ,
  4870. n.prototype.playTour = function() {
  4871. if (!this.bounceable())
  4872. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4873. this.tourInProgress = !0,
  4874. this.reachSource = "play",
  4875. this.tourIsPlaying = !0,
  4876. this.wasZoomEnabled = this.player.zoomEnabled,
  4877. this.player.zoomEnabled = !1,
  4878. this.resetSpecialTransition(),
  4879. this.emit("update.controls"),
  4880. this.emit(p.TourStart),
  4881. this.player.enablePreRendering(),
  4882. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4883. this.goToDestination()) : this.goNext()))
  4884. }
  4885. ,
  4886. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4887. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4888. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4889. g_playAudio = g_bgAudio;
  4890. g_tourAudio && g_tourAudio.pause();
  4891. //window.tourAudio && window.tourAudio.pause();
  4892. manage.switchBgmState(true);
  4893. }
  4894. }
  4895. ,
  4896. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4897. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4898. this.tourIsPlaying = !1,
  4899. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4900. this.interrupt(),
  4901. this.clearWalkingSectionPaused(),
  4902. this.resetSpecialTransition(),
  4903. this.emit("update.controls"))
  4904. //window.tourAudio && window.tourAudio.pause();
  4905. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4906. {
  4907. g_tourAudio.pause();
  4908. //g_tourAudio.src = ""
  4909. }
  4910. }
  4911. ,
  4912. n.prototype.endTourProgress = function() {
  4913. this.tourInProgress = !1,
  4914. this.emit("update.controls"),
  4915. this.emit(p.TourEnd)
  4916. }
  4917. ,
  4918. n.prototype.goToHighlight = function(e) {
  4919. if (this.wouldInterrupt())
  4920. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4921. else {
  4922. if (A.debug("<tour.goto " + e + ">"),
  4923. this.isInterrupted())
  4924. return;
  4925. this.clearWalkingSectionPaused(),
  4926. this.setDestinationItem(e),
  4927. this.useSpecialTransition("Hilight"),
  4928. this.goToDestination(),
  4929. h.trackAlways("reach_highlight", {
  4930. reach_source: "thumb"
  4931. })
  4932. }
  4933. }
  4934. ,
  4935. n.prototype.prevHighlight = function() {
  4936. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4937. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4938. this.reachSource = "prev",
  4939. this.goPrev()))
  4940. }
  4941. ,
  4942. n.prototype.nextHighlight = function() {
  4943. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4944. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4945. this.reachSource = "next",
  4946. this.goNext()))
  4947. }
  4948. ,
  4949. n.prototype.changeMode = function(e) {
  4950. var t = $.Deferred()
  4951. , i = t.resolve.bind(t)
  4952. , n = t.reject.bind(t);
  4953. this.emit(p.StartModeChange);
  4954. var r = function() {
  4955. return this.clearWalkingSectionPaused(),
  4956. !!this.wouldInterrupt() && (this.interrupt(),
  4957. !0)
  4958. }
  4959. .bind(this);
  4960. if (!r()) {
  4961. switch (e) {
  4962. case c.PANORAMA:
  4963. 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);
  4964. break;
  4965. case c.DOLLHOUSE:
  4966. case c.FLOORPLAN:
  4967. this.player.flyToNewMode({
  4968. mode: e
  4969. }).done(i).fail(n);
  4970. break;
  4971. case c.OUTDOOR:
  4972. 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)
  4973. }
  4974. return t.promise()
  4975. }
  4976. }
  4977. ,
  4978. n.prototype.atEndOfTour = function() {
  4979. //return this.currentItem >= this.nItems - 1
  4980. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4981. if(end){
  4982. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4983. if(heroLocations){
  4984. end = this.currentItem[1] >= heroLocations.length - 1
  4985. }
  4986. }
  4987. return end;
  4988. }
  4989. ,
  4990. n.prototype.firstDestination = function() {
  4991. //return 0 < this.nItems ? 0 : null
  4992. return 0 < this.nItems ? [0,0]: null
  4993. }
  4994. ,
  4995. n.prototype.finalDestination = function() {
  4996. //return 0 < this.nItems ? this.nItems - 1 : null
  4997. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4998. }
  4999. ,
  5000. n.prototype.goPrev = function() {
  5001. this.tourAdvance(-1)
  5002. }
  5003. ,
  5004. n.prototype.goNext = function() {
  5005. this.tourAdvance(1)
  5006. }
  5007. ,
  5008. n.prototype.setDestinationItem = function(e) {
  5009. this.destinationItem = e,
  5010. this.emit("update.controls")
  5011. }
  5012. ,
  5013. n.prototype.setCurrentItem = function(e) {
  5014. this.currentItem = e,
  5015. this.emit("update.controls")
  5016. }
  5017. ,
  5018. n.prototype.nextItem = function(currentItem) {
  5019. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5020. if(currentItem == void 0)return this.firstDestination()
  5021. var currentLocation = this.model.heroLocations[currentItem[0]];
  5022. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5023. var item;
  5024. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5025. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5026. }else{
  5027. item = [currentItem[0] , currentItem[1]+1]
  5028. }
  5029. if(item[0] >= this.nItems ){
  5030. item = this.firstDestination()
  5031. }
  5032. return item;
  5033. //暂时不理会endlessLoop,默认为false
  5034. }
  5035. ,
  5036. n.prototype.prevItem = function(currentItem) {
  5037. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5038. if(currentItem == void 0)return this.firstDestination()
  5039. var item;
  5040. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5041. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5042. else{
  5043. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5044. if(this.currentItem[1] == 0){//子目录中第一个
  5045. return [currentItem[0] - 1, lastChildNum-1]
  5046. }else{
  5047. return [currentItem[0], currentItem[1]-1]
  5048. }
  5049. }
  5050. }
  5051. ,
  5052. n.prototype.tourAdvance = function(e) {//e是1或-1
  5053. A.debug("tourAdvance(" + e + ")")
  5054. if(null === this.currentItem || void 0 === this.currentItem){
  5055. this.setDestinationItem(this.firstDestination())
  5056. }else{
  5057. var item
  5058. if(e == 1){
  5059. item = this.nextItem(this.currentItem)
  5060. }else if(e == -1){
  5061. item = this.prevItem(this.currentItem)
  5062. }
  5063. this.setDestinationItem(item)
  5064. }
  5065. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5066. this.useSpecialTransition("reverse-looping to end")
  5067. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5068. this.useSpecialTransition("looping back to start")
  5069. }
  5070. /* var momentTour = this.getMomentTour(this.destinationItem);
  5071. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5072. var zoomLevel = this.player.zoomLevel;
  5073. this.player.zoomEnabled = true;
  5074. var zoom = function(e, d) {
  5075. this.player.zoomTo((1-e)*zoomLevel, true)
  5076. }.bind(this)
  5077. s.start(zoom, 1500, function(){
  5078. }, 0, d.easeOutQuad, "zoom")
  5079. } */
  5080. this.goToDestination()
  5081. }
  5082. ,
  5083. n.prototype.getMomentTour = function(destinationItem) {//add
  5084. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5085. if(!destinationItem) return wholeMomentTour
  5086. else{
  5087. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5088. if(currentLocation.momentTour)return currentLocation.momentTour;
  5089. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5090. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5091. }
  5092. }
  5093. t.exports = n
  5094. }
  5095. ).call(this, "/js/director.js")
  5096. }
  5097. , {
  5098. "./analytics": 4,
  5099. "./enum/BlackoutStyle": 18,
  5100. "./enum/ControlEvents": 21,
  5101. "./enum/DirectorEvents": 23,
  5102. "./enum/ModelManagerEvents": 33,
  5103. "./enum/PathDiscardMode": 38,
  5104. "./enum/PathDisplayMode": 39,
  5105. "./enum/PlayerEvents": 40,
  5106. "./enum/Viewmode": 51,
  5107. "./enum/WarpStyle": 52,
  5108. "./model/ModelManager": 140,
  5109. "./player": 155,
  5110. "./settings": 166,
  5111. "./util/logger": 189,
  5112. "./util/transitions": 195,
  5113. events: 202,
  5114. three: 217
  5115. }],
  5116. 16: [function(e, t, i) {
  5117. "use strict";
  5118. var n = e("three")
  5119. , r = e("./enum/Viewmode")
  5120. , o = (e("./settings"),
  5121. e("./util/transitions"))
  5122. , a = e("./enum/PlayerEvents")
  5123. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5124. , l = new n.ShaderPass(n.VerticalBlurShader);
  5125. l.renderToScreen = !0;
  5126. var c = $("#player").width() / $("#player").height();
  5127. isNaN(c) && (c = 1);
  5128. var h = {
  5129. currentBlur: 0,
  5130. aspect: c,
  5131. blurStrength: 1,
  5132. hblurPass: s,
  5133. vblurPass: l,
  5134. bindEvents: function(e) {
  5135. e.on(a.ModeChanged, function(e, t) {
  5136. e === r.PANORAMA && (o.cancel(h.blur),
  5137. o.cancel(h.addBlur),
  5138. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5139. })
  5140. },
  5141. blur: function(e) {
  5142. h.currentBlur = e;
  5143. var t = e * h.blurStrength;
  5144. l.uniforms.v.value = t / 512 * h.aspect,
  5145. s.uniforms.h.value = t / 512
  5146. },
  5147. addBlur: function(e) {
  5148. e = Math.max(e, h.currentBlur),
  5149. h.blur(e)
  5150. },
  5151. removeBlur: function(e) {
  5152. e = Math.min(1 - e, h.currentBlur),
  5153. h.blur(e)
  5154. }
  5155. };
  5156. h.blur(0),
  5157. t.exports = h
  5158. }
  5159. , {
  5160. "./enum/PlayerEvents": 40,
  5161. "./enum/Viewmode": 51,
  5162. "./settings": 166,
  5163. "./util/transitions": 195,
  5164. three: 217
  5165. }],
  5166. 17: [function(e, t, i) {
  5167. "use strict";
  5168. t.exports = {
  5169. UNKNOWN: 0,
  5170. ALIGNED: 1,
  5171. UNALIGNED: 2,
  5172. PLACED: 3
  5173. }
  5174. }
  5175. , {}],
  5176. 18: [function(e, t, i) {
  5177. "use strict";
  5178. t.exports = {
  5179. NONE: 0,
  5180. MIDDLE: 1,
  5181. END: 2,
  5182. BEGINNING: 3,
  5183. FADEIN: 4
  5184. }
  5185. }
  5186. , {}],
  5187. 19: [function(e, t, i) {
  5188. "use strict";
  5189. var n = e("three");
  5190. t.exports = {
  5191. newBlue: new n.Color(4967932),
  5192. altBlue: new n.Color(47355),
  5193. tagDefault: new n.Color(223357),
  5194. classicBlue: new n.Color(53759),
  5195. mpYellow: new n.Color(16502016),
  5196. mpOrange: new n.Color(16428055),
  5197. mpBlue: new n.Color(12096),
  5198. mpLtGrey: new n.Color(13751252),
  5199. mpDkGrey: new n.Color(10000019),
  5200. mpRed: new n.Color(12525854),
  5201. mpOrangeDesat: new n.Color(16764529),
  5202. mpBlueDesat: new n.Color(4034734),
  5203. mpRedDesat: new n.Color(14705505),
  5204. white: new n.Color(16777215),
  5205. black: new n.Color(0),
  5206. _desat: function(e, t) {
  5207. var i = t || .3
  5208. , r = (new n.Color).copy(e).getHSL();
  5209. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5210. },
  5211. _darken: function(e, t) {
  5212. var i = t || .2
  5213. , r = e.getHSL();
  5214. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5215. }
  5216. }
  5217. }
  5218. , {
  5219. three: 217
  5220. }],
  5221. 20: [function(e, t, i) {
  5222. "use strict";
  5223. t.exports = {
  5224. NONE: -1,
  5225. ROTATE: 0,
  5226. DOLLY: 1,
  5227. PAN: 2,
  5228. ROTATE_DOLLY: 3,
  5229. PAN_DOLLY: 4
  5230. }
  5231. }
  5232. , {}],
  5233. 21: [function(e, t, i) {
  5234. "use strict";
  5235. t.exports = {
  5236. Move: "move",
  5237. InteractionDirect: "interaction.direct",
  5238. InteractionKey: "interaction.key",
  5239. InteractionGui: "interaction.gui",
  5240. FlyInDirection: "fly.direction",
  5241. InputStart: "input.start",
  5242. Pinch: "input.pinch",
  5243. Scroll: "input.scroll",
  5244. AutoPanInterrupt: "autopan.interrupt",
  5245. AutoPanComplete: "autopan.complete",
  5246. AutoPanClamped: "autopan.clamped",
  5247. LongTap: "longtap"
  5248. }
  5249. }
  5250. , {}],
  5251. 22: [function(e, t, i) {
  5252. "use strict";
  5253. t.exports = Object.freeze({
  5254. FORWARD: "FORWARD",
  5255. LEFT: "LEFT",
  5256. RIGHT: "RIGHT",
  5257. BACK: "BACK",
  5258. UP: "UP",
  5259. DOWN: "DOWN"
  5260. })
  5261. }
  5262. , {}],
  5263. 23: [function(e, t, i) {
  5264. "use strict";
  5265. t.exports = {
  5266. ActionInterrupted: "action.interrupted",
  5267. TourStart: "tour.start",
  5268. TourEnd: "tour.end",
  5269. StartModeChange: "mode.startChange"
  5270. }
  5271. }
  5272. , {}],
  5273. 24: [function(e, t, i) {
  5274. "use strict";
  5275. t.exports = Object.freeze({
  5276. None: 0,
  5277. Queued: 1,
  5278. ForceQueued: 2,
  5279. Downloading: 3,
  5280. Downloaded: 4,
  5281. DownloadFailed: 5
  5282. })
  5283. }
  5284. , {}],
  5285. 25: [function(e, t, i) {
  5286. "use strict";
  5287. t.exports = {
  5288. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5289. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5290. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5291. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5292. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5293. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5294. }
  5295. }
  5296. , {}],
  5297. 26: [function(e, t, i) {
  5298. "use strict";
  5299. t.exports = {
  5300. Texture2D: 0,
  5301. TextureCube: 1
  5302. }
  5303. }
  5304. , {}],
  5305. 27: [function(e, t, i) {
  5306. "use strict";
  5307. t.exports = {
  5308. SMALL: "small",
  5309. LARGE: "large"
  5310. }
  5311. }
  5312. , {}],
  5313. 28: [function(e, t, i) {
  5314. "use strict";
  5315. var n = e("./Viewmode")
  5316. , r = {
  5317. LANDING: {},
  5318. NAVIGATION: "navigation",
  5319. MORE_HELP: "moreHelp",
  5320. TOUR_INTERACTION: {}
  5321. };
  5322. r.LANDING[n.PANORAMA] = "panorama.landing",
  5323. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5324. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5325. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5326. r.TOUR_INTERACTION.standard = "standard.tour",
  5327. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5328. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5329. t.exports = r
  5330. }
  5331. , {
  5332. "./Viewmode": 51
  5333. }],
  5334. 29: [function(e, t, i) {
  5335. "use strict";
  5336. var n = {
  5337. UP: 1,
  5338. DOWN: -1,
  5339. LEFT: "L",
  5340. RIGHT: "R",
  5341. FORWARD: "F",
  5342. BACK: "B",
  5343. reverse: {},
  5344. opposite: function(e) {
  5345. return this.reverse[e.toString()]
  5346. }
  5347. };
  5348. !function() {
  5349. n.reverse[n.UP] = n.DOWN,
  5350. n.reverse[n.DOWN] = n.UP,
  5351. n.reverse[n.LEFT] = n.RIGHT,
  5352. n.reverse[n.RIGHT] = n.LEFT,
  5353. n.reverse[n.FORWARD] = n.BACK,
  5354. n.reverse[n.BACK] = n.FORWARD
  5355. }(),
  5356. t.exports = n
  5357. }
  5358. , {}],
  5359. 30: [function(e, t, i) {
  5360. "use strict";
  5361. var n = e("../util/browser")
  5362. , r = {
  5363. ZERO: 48,
  5364. ONE: 49,
  5365. TWO: 50,
  5366. THREE: 51,
  5367. FOUR: 52,
  5368. FIVE: 53,
  5369. SIX: 54,
  5370. SEVEN: 55,
  5371. EIGHT: 56,
  5372. NINE: 57,
  5373. LEFTARROW: 37,
  5374. UPARROW: 38,
  5375. RIGHTARROW: 39,
  5376. DOWNARROW: 40,
  5377. A: 65,
  5378. B: 66,
  5379. C: 67,
  5380. D: 68,
  5381. E: 69,
  5382. F: 70,
  5383. G: 71,
  5384. H: 72,
  5385. I: 73,
  5386. J: 74,
  5387. K: 75,
  5388. L: 76,
  5389. M: 77,
  5390. N: 78,
  5391. O: 79,
  5392. P: 80,
  5393. Q: 81,
  5394. R: 82,
  5395. S: 83,
  5396. T: 84,
  5397. U: 85,
  5398. V: 86,
  5399. W: 87,
  5400. X: 88,
  5401. Y: 89,
  5402. Z: 90,
  5403. SPACE: 32,
  5404. RETURN: 13,
  5405. SEMICOLON: 186,
  5406. PLUSEQUALS: 187,
  5407. DASHUNDERSCORE: 189,
  5408. OPENBRACKET: 219
  5409. };
  5410. n.detectFirefox() && (r.SEMICOLON = 59,
  5411. r.PLUSEQUALS = 61,
  5412. r.DASHUNDERSCORE = 173),
  5413. t.exports = r
  5414. }
  5415. , {
  5416. "../util/browser": 182
  5417. }],
  5418. 31: [function(e, t, i) {
  5419. "use strict";
  5420. t.exports = {
  5421. EN_US: "en-US",
  5422. ES_MX: "es-MX",
  5423. FR_FR: "fr-FR",
  5424. DE_DE: "de-DE",
  5425. RU_RU: "ru-RU",
  5426. CN_CN: "cn-CN",
  5427. JP_JP: "jp-JP"
  5428. }
  5429. }
  5430. , {}],
  5431. 32: [function(e, t, i) {
  5432. "use strict";
  5433. t.exports = {
  5434. TagActivated: "tag.activated",
  5435. TagDismissed: "tag.dismissed",
  5436. TagNavigation: "tag.navigation"
  5437. }
  5438. }
  5439. , {}],
  5440. 33: [function(e, t, i) {
  5441. "use strict";
  5442. t.exports = {
  5443. ModelAdded: "model-added",
  5444. ActiveModelChanged: "active-model-changed"
  5445. }
  5446. }
  5447. , {}],
  5448. 34: [function(e, t, i) {
  5449. "use strict";
  5450. t.exports = {
  5451. LEFT: 0,
  5452. MIDDLE: 1,
  5453. RIGHT: 2
  5454. }
  5455. }
  5456. , {}],
  5457. 35: [function(e, t, i) {
  5458. "use strict";
  5459. t.exports = {
  5460. PanoRenderComplete: "panorama.render.complete",
  5461. TileRenderFailure: "panorama.tile.render.failed",
  5462. TileRenderSuccess: "panorama.tile.render.success",
  5463. TileUploadAttempted: "panorama.tile.upload.attempted",
  5464. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5465. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5466. }
  5467. }
  5468. , {}],
  5469. 36: [function(e, t, i) {
  5470. "use strict";
  5471. t.exports = {
  5472. BASE: 1,
  5473. STANDARD: 2,
  5474. HIGH: 3,
  5475. ULTRAHIGH: 4
  5476. }
  5477. }
  5478. , {}],
  5479. 37: [function(e, t, i) {
  5480. "use strict";
  5481. t.exports = {
  5482. LoadComplete: "panorama.load.complete",
  5483. LoadFailed: "panorama.load.failed",
  5484. TileLoaded: "panorama.tile.loaded"
  5485. }
  5486. }
  5487. , {}],
  5488. 38: [function(e, t, i) {
  5489. "use strict";
  5490. t.exports = Object.freeze({
  5491. Standard: 0,
  5492. Slow: 1,
  5493. Retain: 2
  5494. })
  5495. }
  5496. , {}],
  5497. 39: [function(e, t, i) {
  5498. "use strict";
  5499. t.exports = Object.freeze({
  5500. Show: 0,
  5501. Hide: 1,
  5502. Retain: 2
  5503. })
  5504. }
  5505. , {}],
  5506. 40: [function(e, t, i) {
  5507. "use strict";
  5508. t.exports = {
  5509. Move: "move",
  5510. MoveComplete: "move.complete",
  5511. ModeChanged: "mode.changed",
  5512. ModeChanging: "mode.changing",
  5513. PanoChosen: "pano.chosen",
  5514. ClosestPanoChanging: "closest.pano.changing",
  5515. WarpStarted: "warp.started",
  5516. WarpInterrupted: "warp.interrupted",
  5517. WarpEnded: "warp.ended",
  5518. FlyinFinished: "flyin.finished",
  5519. FlyingStarted: "flying.started",
  5520. FlyingInterrupted: "flying.interrupted",
  5521. FlyingEnded: "flying.ended",
  5522. Ready: "ready",
  5523. StartInside: "start.inside",
  5524. StartOutside: "start.outside",
  5525. ViewChanged: "view.changed",
  5526. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5527. InputStart: "input.start"
  5528. }
  5529. }
  5530. , {}],
  5531. 41: [function(e, t, i) {
  5532. "use strict";
  5533. t.exports = Object.freeze({
  5534. DEFAULT: 0,
  5535. PANOMARKERS: 1,
  5536. RETICULE: 2,
  5537. TAG: 3
  5538. })
  5539. }
  5540. , {}],
  5541. 42: [function(e, t, i) {
  5542. "use strict";
  5543. t.exports = {
  5544. visibleFloor: 1,
  5545. ghostFloor: 3,
  5546. boundingSkybox: 1,
  5547. panoMarker: 2,
  5548. reticule: 3,
  5549. tagStem: 4,
  5550. tagDisc: 5,
  5551. ribbon: 100
  5552. }
  5553. }
  5554. , {}],
  5555. 43: [function(e, t, i) {
  5556. "use strict";
  5557. t.exports = {
  5558. ContextCreated: "scene-renderer-context-created",
  5559. AfterRender: "after-render",
  5560. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5561. }
  5562. }
  5563. , {}],
  5564. 44: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. IDLE: "idle",
  5568. BROWSE: "browse",
  5569. EXAMINE: "examine"
  5570. }
  5571. }
  5572. , {}],
  5573. 45: [function(e, t, i) {
  5574. "use strict";
  5575. t.exports = {
  5576. TileDownloadSuccess: "tiledownloader.download.success",
  5577. TileDownloadFailure: "tiledownloader.download.failure",
  5578. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5579. }
  5580. }
  5581. , {}],
  5582. 46: [function(e, t, i) {
  5583. "use strict";
  5584. t.exports = {
  5585. CardboardAndroid: "googlevr",
  5586. GearVR: "gearvr",
  5587. CardboardIOS: "googlevrios",
  5588. Cardboard: "googlevr"
  5589. }
  5590. }
  5591. , {}],
  5592. 47: [function(e, t, i) {
  5593. "use strict";
  5594. t.exports = {
  5595. NONE: 0,
  5596. CONTEXTUAL: 1,
  5597. ANDROID: 2
  5598. }
  5599. }
  5600. , {}],
  5601. 48: [function(e, t, i) {
  5602. "use strict";
  5603. var n = {
  5604. Title: 0,
  5605. Cardboard: 1
  5606. }
  5607. , r = {
  5608. Title: 0,
  5609. Cardboard: 1,
  5610. Gear: 2
  5611. };
  5612. !function() {
  5613. [n, r].forEach(function(e) {
  5614. e.pageCount = Object.keys(e).length
  5615. })
  5616. }(),
  5617. t.exports.ios = n,
  5618. t.exports.standard = r
  5619. }
  5620. , {}],
  5621. 49: [function(e, t, i) {
  5622. "use strict";
  5623. t.exports = {
  5624. Android: "android",
  5625. IOS: "ios",
  5626. Desktop: "desktop",
  5627. UnsupportedAndroid: "android-unsupported"
  5628. }
  5629. }
  5630. , {}],
  5631. 50: [function(e, t, i) {
  5632. "use strict";
  5633. var n = e("three");
  5634. t.exports = {
  5635. UP: new n.Vector3(0,1,0),
  5636. DOWN: new n.Vector3(0,-1,0),
  5637. LEFT: new n.Vector3(-1,0,0),
  5638. RIGHT: new n.Vector3(1,0,0),
  5639. FORWARD: new n.Vector3(0,0,-1),
  5640. BACK: new n.Vector3(0,0,1)
  5641. }
  5642. }
  5643. , {
  5644. three: 217
  5645. }],
  5646. 51: [function(e, t, i) {
  5647. "use strict";
  5648. var n = e("../exception/ViewmodeConvertException")
  5649. , r = e("./coreViewmodes")
  5650. , o = e("../util/common")
  5651. , a = {
  5652. MESH: "mesh",
  5653. OUTDOOR: "outdoor",
  5654. TRANSITIONING: "transitioning",
  5655. toInt: function(e) {
  5656. switch (e) {
  5657. case this.PANORAMA:
  5658. return 1;
  5659. case this.DOLLHOUSE:
  5660. return 2;
  5661. case this.FLOORPLAN:
  5662. return 3;
  5663. case this.OUTDOOR:
  5664. return 4;
  5665. case this.TRANSITIONING:
  5666. return -1
  5667. }
  5668. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5669. },
  5670. fromInt: function(e) {
  5671. switch (e) {
  5672. case "1":
  5673. case 1:
  5674. return this.PANORAMA;
  5675. case "2":
  5676. case 2:
  5677. return this.DOLLHOUSE;
  5678. case "3":
  5679. case 3:
  5680. return this.FLOORPLAN;
  5681. case "4":
  5682. case 4:
  5683. return this.OUTDOOR
  5684. }
  5685. throw new n("No known conversion for int to viewmode for int: " + e)
  5686. },
  5687. convertWorkshopModeInt: function(e) {
  5688. switch (e) {
  5689. case "0":
  5690. case 0:
  5691. case undefined: //xzw add
  5692. return this.PANORAMA;
  5693. case "1":
  5694. case 1:
  5695. return this.FLOORPLAN;
  5696. case "2":
  5697. case 2:
  5698. return this.DOLLHOUSE;
  5699. case "3":
  5700. case 3:
  5701. return this.MESH
  5702. }
  5703. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5704. }
  5705. };
  5706. o.extendObject(a, r),
  5707. t.exports = a
  5708. }
  5709. , {
  5710. "../exception/ViewmodeConvertException": 58,
  5711. "../util/common": 185,
  5712. "./coreViewmodes": 54
  5713. }],
  5714. 52: [function(e, t, i) {
  5715. "use strict";
  5716. t.exports = {
  5717. BLACK: "black",
  5718. STD: "std",
  5719. WALK: "walk"
  5720. }
  5721. }
  5722. , {}],
  5723. 53: [function(e, t, i) {
  5724. "use strict";
  5725. t.exports = {
  5726. ZoomIn: "zoom.in",
  5727. ZoomOut: "zoom.out",
  5728. ZoomMax: "zoom.max",
  5729. ZoomMin: "zoom.min"
  5730. }
  5731. }
  5732. , {}],
  5733. 54: [function(e, t, i) {
  5734. "use strict";
  5735. t.exports = {
  5736. PANORAMA: "panorama",
  5737. DOLLHOUSE: "dollhouse",
  5738. FLOORPLAN: "floorplan"
  5739. }
  5740. }
  5741. , {}],
  5742. 55: [function(e, t, i) {
  5743. "use strict";
  5744. function n(e) {
  5745. this.message = e
  5746. }
  5747. t.exports = n
  5748. }
  5749. , {}],
  5750. 56: [function(e, t, i) {
  5751. "use strict";
  5752. function n(e) {
  5753. r.call(this, e)
  5754. }
  5755. var r = e("./BasicException");
  5756. n.prototype = Object.create(r.prototype),
  5757. t.exports = n
  5758. }
  5759. , {
  5760. "./BasicException": 55
  5761. }],
  5762. 57: [function(e, t, i) {
  5763. "use strict";
  5764. function n(e) {
  5765. r.call(this, e)
  5766. }
  5767. var r = e("./BasicException");
  5768. n.prototype = Object.create(r.prototype),
  5769. t.exports = n
  5770. }
  5771. , {
  5772. "./BasicException": 55
  5773. }],
  5774. 58: [function(e, t, i) {
  5775. "use strict";
  5776. function n(e) {
  5777. r.call(this, e)
  5778. }
  5779. var r = e("./BasicException");
  5780. n.prototype = Object.create(r.prototype),
  5781. t.exports = n
  5782. }
  5783. , {
  5784. "./BasicException": 55
  5785. }],
  5786. 59: [function(e, t, i) {
  5787. (function(i) {
  5788. "use strict";
  5789. function n(e) {
  5790. var t = {};
  5791. if (e) {
  5792. var i = e.flags;
  5793. if (i)
  5794. for (var n in i)
  5795. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5796. return t
  5797. }
  5798. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5799. null
  5800. }
  5801. var r = e("./util/ajax")
  5802. , o = e("./util/showcase")
  5803. , a = e("./util/logger")
  5804. , s = ""
  5805. , l = new a(i)
  5806. , c = {};
  5807. t.exports = {
  5808. loadFeatureFlags: function(e) {
  5809. var t = $.Deferred();
  5810. return r.get(e.urlBase + s, {
  5811. responseType: "json",
  5812. prefetchFrom: "user",
  5813. auth: o.getAuthorizationHeader()
  5814. }).done(function(e) {
  5815. c = n(e),
  5816. c ? t.resolve(c) : t.reject("loading-failed")
  5817. }).fail(function() {
  5818. l.debug("Retrieval of feature flags failed."),
  5819. t.reject("loading-failed")
  5820. }),
  5821. t.promise()
  5822. },
  5823. getFlags: function() {
  5824. return c
  5825. },
  5826. updateDependentSettings: function(e, t) {
  5827. e = e || c,
  5828. e.labels && (t.labels.enabled = !0),
  5829. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5830. e.showcase_sdk && (t.sdkInit = !0),
  5831. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5832. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5833. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5834. e.hide_sc_sharing && (t.share.enabled = !1)
  5835. }
  5836. }
  5837. }
  5838. ).call(this, "/js/featureflags.js")
  5839. }
  5840. , {
  5841. "./util/ajax": 181,
  5842. "./util/logger": 189,
  5843. "./util/showcase": 193
  5844. }],
  5845. 60: [function(e, t, i) {
  5846. "use strict";
  5847. var n = (e("../util/common"),
  5848. {
  5849. status: 0,
  5850. set: function(e) {
  5851. if (isNaN(e))
  5852. return !1;
  5853. var t = $('.progressbar');
  5854. 0 > e && (e = 0);
  5855. e > 100 && (e = 100);
  5856. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5857. var barperc = e*width;
  5858. var perc = Math.round(e);
  5859. var labelpos = (parseInt(barperc)-15);
  5860. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5861. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5862. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5863. this.status = e
  5864. },
  5865. done: function(e) {
  5866. return e || this.status ? (this.status = null,
  5867. this.set(100)) : this
  5868. }
  5869. });
  5870. t.exports.circleLoader = n
  5871. }
  5872. , {
  5873. "../util/common": 185
  5874. }],
  5875. 61: [function(e, t, i) {
  5876. "use strict";
  5877. t.exports = Object.freeze({
  5878. CLOSE: "modal.closer.close"
  5879. })
  5880. }
  5881. , {}],
  5882. 62: [function(e, t, i) {
  5883. "use strict";
  5884. function n(e, t) {
  5885. t && (t.stopPropagation(),
  5886. t.preventDefault()),
  5887. e && this.emit(l.CLOSE, e),
  5888. g.reset()
  5889. }
  5890. function r(e, t) {
  5891. function i() {
  5892. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5893. t !== f && (f = t,
  5894. t ? (e.classList.add("closeByFooter"),
  5895. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5896. h.classList.remove("closeByFooter")))
  5897. }
  5898. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5899. }
  5900. var o = e("../../settings")
  5901. , a = (e("../../tag/Media/MediaEvent"),
  5902. e("../../util/browser"))
  5903. , s = e("../../util/common")
  5904. , l = e("./ModalCloserEvent")
  5905. , c = e("events").EventEmitter
  5906. , h = document.getElementsByClassName("footer")[0]
  5907. , u = h.querySelectorAll(".close")[0]
  5908. , d = null
  5909. , p = null
  5910. , f = null
  5911. , g = (a.isMobile(),
  5912. {
  5913. open: function(e) {
  5914. e && (r(e),
  5915. d && u.removeEventListener("click", d, !0),
  5916. d = n.bind(this, e.id),
  5917. u.addEventListener("click", d, !0),
  5918. p && window.removeEventListener("resize", p, !0),
  5919. p = r.bind(this, e),
  5920. window.addEventListener("resize", p, !0))
  5921. },
  5922. reset: function() {
  5923. h.classList.remove("closeByFooter"),
  5924. u.removeEventListener("click", d, !0),
  5925. window.removeEventListener("resize", p, !0),
  5926. d = p = f = null
  5927. }
  5928. });
  5929. s.extendObject(g, c.prototype),
  5930. t.exports = g
  5931. }
  5932. , {
  5933. "../../tag/Media/MediaEvent": 131,
  5934. "../../settings": 166,
  5935. "../../util/browser": 182,
  5936. "../../util/common": 185,
  5937. "./ModalCloserEvent": 61,
  5938. events: 202
  5939. }],
  5940. 63: [function(e, t, i) {
  5941. "use strict";
  5942. function n(e, t, i) {
  5943. var n = new r.GUI({
  5944. width: 400
  5945. })
  5946. , u = n.addFolder("Flydown from Dollhouse");
  5947. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5948. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5949. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5950. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5951. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5952. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5953. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5954. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5955. var d = n.addFolder("Transition between panos");
  5956. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5957. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5958. h.transition.flyTime = 0,
  5959. d.__controllers.forEach(function(e) {
  5960. e.updateDisplay()
  5961. })
  5962. }),
  5963. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5964. h.transition.flySpeed = 0,
  5965. d.__controllers.forEach(function(e) {
  5966. e.updateDisplay()
  5967. })
  5968. }),
  5969. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5970. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5971. d.add(h.transition, "movementEasing", Object.keys(a));
  5972. var p = n.addFolder("Path Display");
  5973. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5974. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5975. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5976. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5977. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5978. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5979. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5980. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5981. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5982. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5983. h.path.color = l[h.path.color],
  5984. h.path.colorUp = l._desat(h.path.color),
  5985. h.path.colorDown = l.darken(h.path.color)
  5986. }),
  5987. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5988. h.reticuleColor = l[h.reticuleColor]
  5989. });
  5990. var f = n.addFolder("Warping")
  5991. , g = f.addFolder("Warp/Teleport");
  5992. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5993. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5994. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5995. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5996. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5997. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5998. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5999. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6000. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6001. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6002. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6003. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6004. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6005. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6006. h.path.typ = c[h.path.typ]
  6007. }),
  6008. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6009. t.endlessLoop = h.warp.loop
  6010. }),
  6011. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6012. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6013. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6014. var m = f.addFolder("Long Warp Only");
  6015. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6016. h.warp.flySpeed = 0,
  6017. m.__controllers.forEach(function(e) {
  6018. e.updateDisplay()
  6019. })
  6020. }),
  6021. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6022. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6023. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6024. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6025. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6026. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6027. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6028. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6029. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6030. var v = n.addFolder("Warp Esoterica");
  6031. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6032. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6033. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6034. h.warp.minWarpTime = 0,
  6035. v.__controllers.forEach(function(e) {
  6036. e.updateDisplay()
  6037. })
  6038. }),
  6039. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6040. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6041. v.add(h.warp, "movementEasing", Object.keys(a));
  6042. var A = n.addFolder("Misc");
  6043. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6044. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6045. }),
  6046. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6047. i.cameras[s.PANORAMA].fov = h.insideFOV
  6048. }),
  6049. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6050. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6051. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6052. var y = n.addFolder("Navigation");
  6053. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6054. h.navigation.panoScores || e.panos.forEach(function(e) {
  6055. e.floor.remove(e.text3d),
  6056. e.text3d = null
  6057. })
  6058. }),
  6059. y.add(h.navigation, "mouseDirection"),
  6060. y.add(h.navigation, "filterStrictness", 0, 1),
  6061. y.add(h.navigation, "angleFactor", -60, 0),
  6062. y.add(h.navigation, "directionFactor", 1, 20),
  6063. y.add(h.navigation, "distanceFactor", -5, 5),
  6064. y.add(h.navigation, "optionalityFactor", .1, 10);
  6065. var C = n.addFolder("tags")
  6066. , I = C.addFolder("Tag Creation");
  6067. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6068. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6069. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6070. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6071. var E = C.addFolder("Visibility");
  6072. E.add(h.tags.visibility, "anyDistance"),
  6073. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6074. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6075. E.add(h.tags.visibility, "hideViaFloor"),
  6076. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6077. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6078. var b = C.addFolder("Disc Parameters");
  6079. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6080. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6081. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6082. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6083. }),
  6084. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6085. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6086. }),
  6087. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6088. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6089. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6090. var w = C.addFolder("Navigate");
  6091. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6092. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6093. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6094. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6095. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6096. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6097. var _ = n.addFolder("Debug");
  6098. _.add(h, "wireframe").onFinishChange(function() {
  6099. e.chunks.forEach(function(t) {
  6100. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6101. t.wireframeTwin.material.depthWrite = !1,
  6102. t.wireframeTwin.material.depthTest = !1,
  6103. t.wireframeTwin.material.opacity = .5,
  6104. t.wireframeTwin.material.transparent = !0),
  6105. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6106. })
  6107. }),
  6108. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6109. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6110. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6111. e.skybox.wireframe = null)
  6112. }),
  6113. _.add(h, "showSweeps").onFinishChange(function() {
  6114. e.setSweepVisibility(h.showSweeps)
  6115. }),
  6116. _.add(h, "showMesh").onFinishChange(function() {
  6117. e.chunks.forEach(function(e) {
  6118. e.visible = h.showMesh
  6119. })
  6120. }),
  6121. _.add(h, "showFloors").onFinishChange(function() {
  6122. e.floors.forEach(function(e) {
  6123. e.collider.children.forEach(function(e) {
  6124. e.material.visible = h.showFloors
  6125. })
  6126. })
  6127. }),
  6128. _.add(h, "showSkyboxes").onFinishChange(function() {
  6129. e.panos.forEach(function(e) {
  6130. e.skyboxMesh.visible = h.showSkyboxes
  6131. })
  6132. }),
  6133. _.add(h, "showNeighbors").onChange(function() {}),
  6134. _.add(e, "alpha", 0, 1)
  6135. }
  6136. var r = e("../lib/dat.gui")
  6137. , o = e("three")
  6138. , a = e("../util/easing")
  6139. , s = e("../enum/Viewmode")
  6140. , l = e("../enum/Colors")
  6141. , c = e("../enum/WarpStyle")
  6142. , h = e("../settings");
  6143. e("../tag/tag");
  6144. r.GUI.prototype.removeFolder = function(e) {
  6145. var t = this.__folders[e];
  6146. t && (t.close(),
  6147. this.__ul.removeChild(t.domElement.parentNode),
  6148. delete this.__folders[e],
  6149. this.onResize())
  6150. }
  6151. ,
  6152. t.exports.toggle = n
  6153. }
  6154. , {
  6155. "../enum/Colors": 19,
  6156. "../enum/Viewmode": 51,
  6157. "../enum/WarpStyle": 52,
  6158. "../lib/dat.gui": 93,
  6159. "../tag/tag": 123,
  6160. "../settings": 166,
  6161. "../util/easing": 186,
  6162. three: 217
  6163. }],
  6164. 64: [function(e, t, i) {
  6165. (function(i) {
  6166. "use strict";
  6167. function n(e, t, i, n) {
  6168. $(".gui-error .error-problem-text").text(e),
  6169. $(".gui-error .error-solution-text").text(t),
  6170. $(".gui-error .error-explanation").text(i),
  6171. $(".gui-error .error-actions").html(n),
  6172. $(window).resize(),
  6173. $(".gui-error").fadeIn(),
  6174. $("#bottom-logo").fadeIn()
  6175. }
  6176. function r(e) {
  6177. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  6178. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6179. s.isMobile() || $("[rel=tiletip]").tooltip({
  6180. placement: "bottom",
  6181. delay: {
  6182. show: 50,
  6183. hide: 0
  6184. },
  6185. trigger: "hover",
  6186. viewport: {
  6187. selector: "body",
  6188. padding: 10
  6189. }
  6190. })
  6191. }
  6192. function o() {
  6193. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6194. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6195. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6196. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6197. e.preventDefault(),
  6198. e.stopPropagation(),
  6199. r(" ")
  6200. })
  6201. }
  6202. function a(e) {
  6203. if ($("head title").text(c.pageTitle),
  6204. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6205. $("#gui-loading").fadeOut(250),
  6206. $("#quick-blackout").hide(),
  6207. l.track("showcase_error", {
  6208. error_key: e
  6209. }),
  6210. h.locale || h.init(),
  6211. "webgl-unsupported" === e)
  6212. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6213. else if ("webgl-ios" === e)
  6214. 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>.");
  6215. else if ("webgl-safari" === e)
  6216. 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>.");
  6217. else if ("webgl-generic" === e)
  6218. o();
  6219. else if ("missing-urls" === e)
  6220. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6221. else if ("loading-failed" === e)
  6222. 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>.");
  6223. else {
  6224. if ("loading-failed-maintenance" !== e)
  6225. return void d.error("Unhandled error: " + e);
  6226. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6227. }
  6228. }
  6229. var s = e("./../util/browser")
  6230. , l = e("./../analytics")
  6231. , c = e("./../settings")
  6232. , h = e("../localization/localize")
  6233. , u = e("./../util/logger")
  6234. , d = new u(i)
  6235. , p = '"https://support.port.com/hc/articles/208220058"';
  6236. t.exports.error = a
  6237. }
  6238. ).call(this, "/js/gui/error.js")
  6239. }
  6240. , {
  6241. "../localization/localize": 108,
  6242. "./../analytics": 4,
  6243. "./../settings": 166,
  6244. "./../util/browser": 182,
  6245. "./../util/logger": 189
  6246. }],
  6247. 65: [function(e, t, i) {
  6248. (function(i) {
  6249. "use strict";
  6250. function n() {
  6251. Ue = [],
  6252. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6253. Ue.push(".hideTarget", ".pinTop.right")
  6254. }
  6255. function r() {
  6256. for (var e in je)
  6257. if (je.hasOwnProperty(e)) {
  6258. var t = je[e];
  6259. if (!t.visible)
  6260. for (var i = 0; i < t.elements.length; i++)
  6261. $(t.elements[i]).hide()
  6262. }
  6263. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6264. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6265. n()
  6266. }
  6267. function o(e, t) {
  6268. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6269. $("#gui-zoomin").toggle(i),
  6270. $("#gui-zoomout").toggle(i)
  6271. }
  6272. function a() {
  6273. c(),
  6274. $(".pinBottom").toggleClass("open"),
  6275. $("#drawer").toggleClass("open"),
  6276. $(".footer").toggleClass("open"),
  6277. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6278. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6279. ie.resetDrawer()),
  6280. setTimeout(function() {
  6281. $("#pullTab").toggleClass("opened");
  6282. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6283. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6284. }
  6285. function s(e) {
  6286. var t;
  6287. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6288. t = e.position().top + e.outerHeight(),
  6289. e.attr("style", "display: none"));
  6290. var i = $("#player").outerHeight()
  6291. , n = i - 130;
  6292. return n < t + 25
  6293. }
  6294. function l(e) {
  6295. "touchstart" === e.type && e.preventDefault(),
  6296. e.stopPropagation()
  6297. }
  6298. function c() {
  6299. W && (W.reload(),
  6300. W.init())
  6301. }
  6302. function h(e) {
  6303. ne.show(e),
  6304. r()
  6305. }
  6306. function u(e) {
  6307. ne.progress(e)
  6308. }
  6309. function d(e, t, i) {
  6310. var n = t.player;
  6311. $("#gui-thumb").fadeOut(2500),
  6312. ne.hide(function() {
  6313. Ge = !1
  6314. }),
  6315. me.init(e, i),
  6316. de.finishSetup(Object.keys(e.tags).length),
  6317. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6318. var s = function() {
  6319. i.dismissExaminedTag(),
  6320. i.disableHovering()
  6321. };
  6322. Ae.on(ye.OPENED, s),
  6323. Ce.on(Me.OPENED, s),
  6324. he.on(ue.OPENED, s),
  6325. fe.on(ge.OPENED, s);
  6326. var l = i.enableHovering.bind(i);
  6327. if (Ae.on(ye.CLOSED, l),
  6328. Ce.on(Me.CLOSED, l),
  6329. he.on(ue.CLOSED, l),
  6330. fe.on(ge.CLOSED, l),
  6331. Q.labels.enabled && Object.keys(e.labels).length,
  6332. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6333. C(e.currentFloor, n.mode)),
  6334. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6335. r(),
  6336. o(t, t.player),
  6337. $("#gui").fadeIn(1500),
  6338. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6339. a(),
  6340. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6341. }, 2e3),
  6342. !K.isMobile())
  6343. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6344. $(c[h]).addClass("hasHover");
  6345. O(e),
  6346. de.setupToggling();
  6347. //xzw:
  6348. window.editHotPanel && editHotPanel();
  6349. //czj
  6350. navBorderRadius(e);
  6351. //czj 编辑界面
  6352. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6353. window.EditTools && new EditTools(n.sceneRenderer);
  6354. }
  6355. function navBorderRadius(e){
  6356. var pullTab = $("#pullTab"),
  6357. mobileRadius = {
  6358. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6359. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6360. },
  6361. topRadius = {
  6362. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6363. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6364. };
  6365. function BorderRadius(bottom,top){
  6366. $("#gui-modes-map > div:visible:last").css(bottom);
  6367. if(pullTab.is(':visible')){
  6368. $(".viewContainer > div:visible:first").css(top);
  6369. }else{
  6370. $("#gui-modes-map > div:visible:first").css(top);
  6371. }
  6372. }
  6373. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6374. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6375. }else{
  6376. BorderRadius(topRadius.bottom,topRadius.top);
  6377. }
  6378. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6379. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6380. window.specialScene && specialScene.special().afterImplement();
  6381. }
  6382. }
  6383. function p(e) {
  6384. e || (e = 0),
  6385. We = !1,
  6386. window.setTimeout(function() {
  6387. We || (ze = !0,
  6388. $("#gui-spinner").stop(!0, !0).show())
  6389. }
  6390. .bind(this), e)
  6391. }
  6392. function f() {
  6393. $("#gui-spinner").stop(!0, !0),
  6394. $("#gui-spinner").fadeOut(1e3),
  6395. We = !0,
  6396. ze = !1
  6397. }
  6398. function g(e, t) {
  6399. var i = e.mode
  6400. , n = t || e.currentPano;
  6401. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6402. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6403. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6404. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6405. Q.show360Views.enabled && !n.isAligned() ? (
  6406. $(".gui-floor").addClass("hidden"),
  6407. $("#gui-modes-outside").addClass("desktop-only")) : (
  6408. $(".gui-floor").removeClass("hidden"),
  6409. $("#gui-modes-outside").removeClass("desktop-only")),
  6410. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6411. Be = i,
  6412. $("#gui-modes-outside").addClass("hidden"),
  6413. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6414. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6415. setTimeout(()=>{
  6416. // console.log(1111111,$('#gui-modes-inside').attr('class'));
  6417. if($('#gui-modes-inside').attr('class')==='active'){
  6418. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6419. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6420. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6421. }
  6422. },500)
  6423. }
  6424. function m(e, t) {
  6425. var i = t.player;
  6426. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6427. l(e),
  6428. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6429. J.track("USER", {
  6430. event_type: "showcase_gui",
  6431. gui_action: "click_inside_mode_button"
  6432. }),
  6433. t.changeMode(_e.PANORAMA);
  6434. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6435. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6436. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6437. }),
  6438. $("#gui-modes-outside").find("a").on("click", function(e) {
  6439. l(e),
  6440. J.track("showcase_gui", {
  6441. gui_action: "click_outside_mode_button"
  6442. }),
  6443. t.changeMode(Be)
  6444. }),
  6445. $("#gui-modes-floorplan").on("click", function(e) {
  6446. l(e),
  6447. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6448. gui_action: "click_floorplan_mode_button"
  6449. }),
  6450. t.changeMode(_e.FLOORPLAN));
  6451. $('#gui-modes-inside img').attr('src','images/inside.png')
  6452. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6453. $('#gui-modes-floorplan img').attr('src','images/floor1.png')
  6454. }),
  6455. $("#gui-modes-dollhouse").on("click", function(e) {
  6456. l(e),
  6457. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6458. gui_action: "click_dollhouse_mode_button"
  6459. }),
  6460. t.changeMode(_e.DOLLHOUSE));
  6461. $('#gui-modes-inside img').attr('src','images/inside.png')
  6462. $('#gui-modes-dollhouse img').attr('src','images/dollhouse1.png')
  6463. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6464. })
  6465. }
  6466. function v(e, t) {
  6467. function i() {
  6468. document.getElementById("vr").classList.remove("hidden"),
  6469. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6470. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6471. $(".improper-embed").toggleClass("hidden", !1),
  6472. r())
  6473. }, function(e) {
  6474. r()
  6475. }) : r()
  6476. }
  6477. function n(i) {
  6478. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6479. Ie.init(e.data, t, i, q),
  6480. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6481. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6482. }
  6483. function r() {
  6484. De.info("WebVR support not found, VR button activates native app VR modal"),
  6485. Ae.init(e.data, q),
  6486. Ae.on(ye.OPENED, function() {
  6487. var e = document.getElementById("vr-modal");
  6488. return function() {
  6489. Ze("vr"),
  6490. le.open(e)
  6491. }
  6492. }()),
  6493. Ae.on(ye.CLOSED, le.reset)
  6494. }
  6495. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6496. /*********************** 方奕卓 VR功能事件监听 ********************/
  6497. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6498. switch (Q.vr.option) {
  6499. case Pe.CONTEXTUAL:
  6500. i();
  6501. break;
  6502. case Pe.ANDROID:
  6503. K.detectAndroid() && i();
  6504. break;
  6505. case Pe.NONE:
  6506. }
  6507. }
  6508. }
  6509. function A(e, t) {
  6510. $("#play").on("mousedown touchstart", function(e) {
  6511. l(e);
  6512. Ze("tour");
  6513. ve.play();
  6514. J.trackAlways("showcase_gui", {
  6515. gui_action: "play_highlights"
  6516. })
  6517. }),
  6518. window.startAndPlay = function(e) {
  6519. // l(e);
  6520. Ze("tour");
  6521. ve.play();
  6522. J.trackAlways("showcase_gui", {
  6523. gui_action: "play_highlights"
  6524. })
  6525. };
  6526. $("#pause").on("mousedown touchstart", function(e) {
  6527. l(e),
  6528. ve.pause(),
  6529. J.trackAlways("showcase_gui", {
  6530. gui_action: "pause_highlights"
  6531. })
  6532. }),
  6533. $("#gui-zoomin").find("a").on("click", function(e) {
  6534. l(e),
  6535. t.player.zoomInIncrementally()
  6536. }),
  6537. $("#gui-zoomout").find("a").on("click", function(e) {
  6538. l(e),
  6539. t.player.zoomOutIncrementally()
  6540. })
  6541. }
  6542. function y(e, t) {
  6543. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6544. if(getQueryVariable('m') === '372') continue;
  6545. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6546. $(".gui-floor").find(".container").prepend(r)
  6547. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6548. }
  6549. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6550. i.on("click", function(e) {
  6551. l(e),
  6552. Ze("floor"),
  6553. i.toggleClass("open")
  6554. }),
  6555. $(".floorChoice").on("click", function(e) {
  6556. l(e);
  6557. var n = $(this).data("index");
  6558. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6559. t.player.gotoFloor(n),
  6560. J.track("showcase_gui", {
  6561. gui_action: "click_floor_select_button",
  6562. interaction_source: "gui"
  6563. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6564. Ze("move"),
  6565. t.allFloors(),
  6566. J.track("showcase_gui", {
  6567. gui_action: "click_toggle_all_floors_button",
  6568. interaction_source: "gui"
  6569. })),
  6570. i.removeClass("open")
  6571. })
  6572. }
  6573. function C(e, t) {
  6574. 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()),
  6575. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6576. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6577. $(".floorChoice").removeClass("active"),
  6578. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6579. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6580. $(".floorChoice").removeClass("active"),
  6581. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6582. }
  6583. function I(e) {
  6584. return e.describe().inTransition
  6585. }
  6586. function b(e, t, i) {
  6587. Fe = e.heroLocations.length;
  6588. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6589. , r = 100 / Fe + "%"
  6590. , o = $("#thumb-container")
  6591. , a = $("#progressBar");
  6592. $("#status").find(".totalSteps").text(Fe);
  6593. for (var s = 0; s < Fe; s++) {
  6594. var c = e.heroLocations[s]
  6595. , h = $(n);
  6596. var thumbUrl
  6597. if(c.heroLocations){//有子项,选第一张截图
  6598. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6599. }else{
  6600. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6601. }
  6602. h.attr("data-index", s)
  6603. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6604. if (c.name) {
  6605. var u = $('<div class="overlay"></div>').text(c.name);
  6606. h.prepend(u)
  6607. }
  6608. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6609. var d = e.panos.get(c.panoId)
  6610. , p = d && !d.isAligned()
  6611. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6612. h.prepend(f)
  6613. }
  6614. o.append(h),
  6615. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6616. }
  6617. j = 144 * Fe,
  6618. Y = 111 * Fe,
  6619. $(".thumbImg").on("mouseover", function() {
  6620. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6621. }),
  6622. $(".thumbImg").on("mouseout", function() {
  6623. t.clearPath()
  6624. }),
  6625. $(".thumbImg").on("click", function(e) {
  6626. l(e);
  6627. var i = $(this);
  6628. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6629. J.trackAlways("showcase_gui", {
  6630. gui_action: "click_highlight"
  6631. }),
  6632. t.goToHighlight([i.data("index"),0])//改
  6633. }),
  6634. $(".previous").find("a").on("click", function(e) {
  6635. l(e),
  6636. J.trackAlways("showcase_gui", {
  6637. gui_action: "prev_highlight"
  6638. }),
  6639. t.prevHighlight()
  6640. }),
  6641. $(".next").find("a").on("click", function(e) {
  6642. l(e),
  6643. J.trackAlways("showcase_gui", {
  6644. gui_action: "next_highlight"
  6645. }),
  6646. t.nextHighlight()
  6647. }),
  6648. $("#drawer").on("mouseleave", function(e) {
  6649. l(e);
  6650. var t;
  6651. try {
  6652. t = new MouseEvent("mouseup",{
  6653. clientX: e.clientX,
  6654. clientY: e.clientY,
  6655. screenX: e.screenX,
  6656. screenY: e.screenY
  6657. })
  6658. } catch (i) {
  6659. t = document.createEvent("MouseEvents"),
  6660. 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)
  6661. }
  6662. document.dispatchEvent(t)
  6663. }),
  6664. W = new Sly($("#scrollFrame"),{
  6665. horizontal: !0,
  6666. itemNav: "centered",
  6667. smart: !0,
  6668. scrollTrap: !0,
  6669. scrollBy: 1,
  6670. mouseDragging: !0,
  6671. touchDragging: !0,
  6672. speed: 300,
  6673. dragHandle: !0,
  6674. dynamicHandle: !0,
  6675. clickBar: !0,
  6676. scrollBar: $("#scroller"),
  6677. activateOn: null
  6678. }).init(),
  6679. W.on("active", function(e, t) {
  6680. Ve = t,
  6681. Ze("tour"),
  6682. $(".step").removeClass("active"),
  6683. $("#status").find(".curIdx").text(t + 1);
  6684. for (var i = 0; i <= t; i++)
  6685. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6686. }),
  6687. w()
  6688. }
  6689. function w() {
  6690. var e = $("#player").width() - 20
  6691. , t = $("#scroller")
  6692. , i = $("#drawer")
  6693. , n = $(".pinBottom");
  6694. if ($("#player").width() < 488 || $("#player").height() < 488)
  6695. t.addClass("hidden"),
  6696. i.addClass("noScroll"),
  6697. n.addClass("noScroll");
  6698. else {
  6699. var r = j > e
  6700. , o = !i.hasClass("noScroll")
  6701. , a = r !== o;
  6702. a && (t.toggleClass("hidden"),
  6703. i.toggleClass("noScroll"),
  6704. n.toggleClass("noScroll"))
  6705. }
  6706. }
  6707. function _(e) {
  6708. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6709. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6710. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6711. }
  6712. function T(e) {
  6713. function t(t, i) {
  6714. return !!e.player_options[t] && e[i || t]
  6715. }
  6716. $(".model-title").text(e.name);
  6717. var i = Q.pageTitle;
  6718. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6719. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6720. document.title = i ,
  6721. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6722. delay: {
  6723. show: 50,
  6724. hide: 0
  6725. },
  6726. trigger: "hover",
  6727. html: !1,
  6728. viewport: {
  6729. selector: "body",
  6730. padding: 10
  6731. }
  6732. }),
  6733. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6734. // 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"),
  6735. de.populate({
  6736. name: t("model_name", "name"),
  6737. coBrand: t("presented_by"),
  6738. description: t("model_summary", "summary") || "暂无内容",
  6739. contactName: t("contact_name"),
  6740. address: t("address"),
  6741. phone: t("contact_phone"),
  6742. formattedPhone: e.formatted_contact_phone,
  6743. email: t("contact_email"),
  6744. url: t("external_url"),
  6745. socialSharing: e.enable_social_sharing && e.is_public
  6746. })
  6747. }
  6748. function x(e, t, i, n, r, o) {
  6749. function a() {
  6750. o.setLoadingStartTime(),
  6751. H(),
  6752. r ? (re.showMessage(t, i, je.coBrand.visible),
  6753. l()) : h(l)
  6754. }
  6755. var s = $.Deferred()
  6756. , l = s.resolve.bind(s);
  6757. return Ge = !0,
  6758. O(e),
  6759. e.data.player_options && _(e.data.player_options),
  6760. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6761. Re.localizeGUI(),
  6762. T(e.data),
  6763. r || $(".quick").addClass("hidden"),
  6764. //e.data.image && !r && E(e.data.image),
  6765. n ? (J.impression(),
  6766. a()) : (o.setWaitingStartTime(),
  6767. oe.show(r, a)),
  6768. s
  6769. }
  6770. function S(e, t, i, n, r, a, s) {
  6771. q = s,
  6772. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6773. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6774. ae.init(),
  6775. re.init(e, a),
  6776. Oe.init(e, t, n),
  6777. $(".icon").on("mouseover", function() {
  6778. t.player && t.player.reticule.hide()
  6779. }),
  6780. m(e, t),
  6781. A(e, t),
  6782. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  6783. Ce.on(Me.OPENED, function() {
  6784. var e = document.getElementById("share-modal");
  6785. return function() {
  6786. Ze("share"),
  6787. le.open(e)
  6788. }
  6789. }()),
  6790. Ce.on(Me.CLOSED, le.reset)),
  6791. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6792. je.tourControls.visible = !1),
  6793. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6794. z(),
  6795. g(i),
  6796. v(e, r),
  6797. e.on("floor.changed", C),
  6798. e.on("waiting", R.bind(this, e)),
  6799. e.on("waiting-done", P.bind(this, e)),
  6800. i.on(xe.ModeChanged, function(e, n) {
  6801. g(i),
  6802. o(t, i),
  6803. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6804. he.updateMode(n)
  6805. }),
  6806. n.on(Se.Move, Ze.bind(this, "move")),
  6807. i.on(xe.Ready, function() {
  6808. ie.init(n, i, i.tagManager, t),
  6809. i.on(xe.ModeChanged, function(e, t) {
  6810. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6811. })
  6812. }),
  6813. i.on(xe.PanoChosen, function(e, t) {
  6814. g(i, t),
  6815. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6816. }),
  6817. le.on(ce.CLOSE, function(e) {
  6818. switch (e) {
  6819. case "vr-modal":
  6820. Ae.dismiss();
  6821. break;
  6822. case "share-modal":
  6823. Ce.hide();
  6824. break;
  6825. case "terms-modal":
  6826. fe.hide()
  6827. }
  6828. });
  6829. var l = $("#play").eq(0)
  6830. , c = $("#pause").eq(0)
  6831. , h = $(".pinBottom").toArray()
  6832. , u = $("#drawer").eq(0)
  6833. , d = $("#playHead").eq(0)
  6834. , p = $("#progressBar").eq(0)
  6835. , f = $("#thumb-container").eq(0)
  6836. , y = f.children()
  6837. , I = p.children();
  6838. t.on("update.controls", function() {
  6839. var n = t.describe();
  6840. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6841. c.show()),
  6842. n.tourInProgress && (h.forEach(function(e) {
  6843. e.classList.add("playing")
  6844. }),
  6845. u.addClass("playing"),
  6846. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6847. c.hide()),
  6848. n.tourInProgress || (ve.stopTour(),
  6849. h.forEach(function(e) {
  6850. e.classList.remove("playing")
  6851. }),
  6852. u.removeClass("playing"),
  6853. d.removeClass("playing")));
  6854. var r, a, s;
  6855. if (null !== n.currentItem) {
  6856. var p, f;
  6857. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6858. n.onTheBus ? (p = "active",
  6859. f = "recent") : (f = "active",
  6860. p = "recent");
  6861. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6862. for (r = 0; r < e.heroLocations.length; r += 1)
  6863. s = y.eq(r),
  6864. a = I.eq(r),
  6865. s.removeClass(f),
  6866. a.removeClass(f),
  6867. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6868. a.addClass(p),
  6869. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6870. a.addClass(p)) : (s.removeClass(p),
  6871. a.removeClass(p))
  6872. } else
  6873. for (r = 0; r < e.heroLocations.length; r += 1)
  6874. s = y.eq(r),
  6875. a = I.eq(r),
  6876. s.removeClass("active recent"),
  6877. a.removeClass("active recent");
  6878. o(t, i)
  6879. }),
  6880. document.addEventListener("keydown", function(n) {
  6881. switch (J.updateInteraction(Se.InteractionKey),
  6882. n.which) {
  6883. case we.ZERO:
  6884. Q.debug && e.toggleAlpha();
  6885. break;
  6886. case we.NINE:
  6887. Q.debug && se.toggle();
  6888. break;
  6889. case we.ONE:
  6890. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6891. break;
  6892. case we.TWO:
  6893. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6894. break;
  6895. case we.THREE:
  6896. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6897. break;
  6898. case we.FOUR:
  6899. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6900. break;
  6901. case we.SPACE:
  6902. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6903. break;
  6904. case we.RETURN:
  6905. Q.debug && e.toggleExplodeUp();
  6906. break;
  6907. case we.P:
  6908. k();
  6909. break;
  6910. case we.U:
  6911. B();
  6912. break;
  6913. case we.X:
  6914. Q.debug && e.toggleExplode();
  6915. break;
  6916. case we.PLUSEQUALS:
  6917. t.player.activatePersistentZooming(!0),
  6918. ie.hideUi();
  6919. break;
  6920. case we.DASHUNDERSCORE:
  6921. t.player.activatePersistentZooming(!1),
  6922. ie.hideUi();
  6923. break;
  6924. case we.SEVEN:
  6925. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6926. break;
  6927. case we.EIGHT:
  6928. t.player.decreaseZoomSpeed();
  6929. break;
  6930. case we.NINE:
  6931. t.player.increaseZoomSpeed()
  6932. }
  6933. return i && i.reticule.hide(),
  6934. !0
  6935. }
  6936. .bind(this)),
  6937. document.addEventListener("keyup", function(e) {
  6938. switch (e.which) {
  6939. case we.PLUSEQUALS:
  6940. t.player.deactivatePersistentZooming();
  6941. break;
  6942. case we.DASHUNDERSCORE:
  6943. t.player.deactivatePersistentZooming()
  6944. }
  6945. }
  6946. .bind(this)),
  6947. F(e),
  6948. L(e, t.player),
  6949. M(i),
  6950. te.setAutoPlay(e.heroCount()),
  6951. he.init(i, a.mode),
  6952. he.on(ue.OPENED, Ze.bind(this, "help")),
  6953. fe.init(),
  6954. fe.on(ge.OPENED, function() {
  6955. var e = document.getElementById("terms-modal");
  6956. return function() {
  6957. Ze("terms"),
  6958. le.open(e)
  6959. }
  6960. }()),
  6961. fe.on(ge.CLOSED, le.reset),
  6962. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6963. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6964. Q.profiling.enabled && se.show(),
  6965. ve.init(t)
  6966. }
  6967. function M(e) {
  6968. var t = function(e, t) {
  6969. $(e).find("a").each(function(e, i) {
  6970. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6971. i.style.pointerEvents = t ? "auto" : "none"
  6972. })
  6973. }
  6974. , i = function() {
  6975. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6976. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6977. };
  6978. e.on(Ne.ZoomMax, function() {
  6979. t("#gui-zoomin", !1),
  6980. t("#gui-zoomout", !0)
  6981. }),
  6982. e.on(Ne.ZoomMin, function() {
  6983. t("#gui-zoomin", !0),
  6984. t("#gui-zoomout", !1)
  6985. }),
  6986. e.on(Ne.ZoomIn, function() {
  6987. t("#gui-zoomout", !0)
  6988. }),
  6989. e.on(Ne.ZoomOut, function() {
  6990. t("#gui-zoomin", !0)
  6991. }),
  6992. i()
  6993. }
  6994. function R(e) {
  6995. O(e)
  6996. }
  6997. function P(e) {
  6998. O(e)
  6999. }
  7000. function O(e) {
  7001. var t = e.waitQueue.length;
  7002. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7003. }
  7004. function L(e, t) {
  7005. He = {
  7006. gui: null,
  7007. visible: !1,
  7008. model: e,
  7009. player: t
  7010. }
  7011. }
  7012. function D(e, t) {
  7013. function i() {
  7014. var i = t.toJSON();
  7015. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7016. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7017. }
  7018. var n = {}
  7019. , r = new Le.GUI({
  7020. autoPlace: !0,
  7021. width: "60%"
  7022. });
  7023. i(),
  7024. t.on(xe.ViewChanged, i),
  7025. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7026. r.domElement.id = "datLinks";
  7027. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7028. return o.forEach(function(e) {
  7029. if (!K.detectSafari()) {
  7030. var t = document.createElement("button");
  7031. t.classList.add("btn-deep-link"),
  7032. t.innerText = Re.MENU_COPY,
  7033. e.nextSibling.appendChild(t);
  7034. var i = function() {
  7035. alert(Re.LINK_ALERT_COPY),
  7036. t.hide()
  7037. };
  7038. t.addEventListener("click", function(e) {
  7039. try {
  7040. var t = e.target.parentNode.childNodes[0];
  7041. t.select();
  7042. var n = document.execCommand("copy");
  7043. t.blur(),
  7044. n || i()
  7045. } catch (e) {
  7046. i()
  7047. }
  7048. })
  7049. }
  7050. }),
  7051. $(r.__closeButton).hide(),
  7052. r
  7053. }
  7054. function N(e) {
  7055. He.gui || (He.gui = D(He.model, He.player)),
  7056. He.visible = e,
  7057. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7058. }
  7059. function B() {
  7060. N(!He.visible)
  7061. }
  7062. function F(e) {
  7063. ke = {
  7064. gui: null,
  7065. visible: !1,
  7066. model: e
  7067. }
  7068. }
  7069. function V(e) {
  7070. var t = new Le.GUI;
  7071. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7072. e.setSweepVisibility(Q.showSweeps)
  7073. }),
  7074. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7075. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7076. Q.transition.flySpeed = 0,
  7077. t.__controllers.forEach(function(e) {
  7078. e.updateDisplay()
  7079. })
  7080. }),
  7081. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7082. $(t.__closeButton).hide(),
  7083. t
  7084. }
  7085. function U(e) {
  7086. ke.gui || (ke.gui = V(ke.model)),
  7087. ke.visible = e,
  7088. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7089. }
  7090. function k() {
  7091. U(!ke.visible)
  7092. }
  7093. function H() {
  7094. function e(e) {
  7095. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7096. }
  7097. $("body").css("touch-action", "none"),
  7098. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7099. // e.preventDefault()
  7100. });
  7101. var t = document.getElementById("terms-text")
  7102. , i = document.getElementById("more-help-wrapper")
  7103. , n = (document.getElementById("navigation-help-wrapper"),
  7104. document.getElementById("help-dialog"),
  7105. document.getElementById("tag-billboards"));
  7106. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7107. document.body.addEventListener("DOMMouseScroll", e)),
  7108. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7109. e.stopPropagation()
  7110. })
  7111. }
  7112. function G(e, t) {
  7113. for (var i = []; e; )
  7114. i.push(e),
  7115. e = e.parentNode;
  7116. for (; t && i.indexOf(t) === -1; )
  7117. t = t.parentNode;
  7118. return t
  7119. }
  7120. function z() {
  7121. var e, t = function(t) {
  7122. e = 0 === t.button || 1 === t.which ? t.target : null
  7123. }, i = function(t) {
  7124. e !== t.target && (e = G(e, t.target));
  7125. var i = document.getElementById("gui-parent");
  7126. if (G(i, e) !== i && (e = null),
  7127. e) {
  7128. var n;
  7129. try {
  7130. n = new MouseEvent("click",t)
  7131. } catch (e) {
  7132. n = document.createEvent("MouseEvents"),
  7133. 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)
  7134. }
  7135. n.syntheticClick = !0,
  7136. e.dispatchEvent(n),
  7137. e = null
  7138. }
  7139. };
  7140. document.body.addEventListener("mousedown", t, !0),
  7141. document.body.addEventListener("mouseup", i, !0),
  7142. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7143. e.syntheticClick || (e.stopPropagation(),
  7144. "A" === e.target.nodeName && e.preventDefault())
  7145. }, !0)
  7146. }
  7147. var W, j, Y, X, Z, q, K = (e("three"),
  7148. e("../util/ajax"),
  7149. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7150. e("../util/camera"),
  7151. e("../util/logger")), te = (e("../objects/Snapshot"),
  7152. 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"),
  7153. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7154. e("../enum/PathDisplayMode"),
  7155. e("../enum/DirectorEvents"),
  7156. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7157. e("../enum/WarpStyle"),
  7158. e("../enum/AlignmentType"),
  7159. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7160. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7161. coBrand: {
  7162. visible: !0,
  7163. elements: [".co-brand", "#loaderCoBrand"]
  7164. },
  7165. help: {
  7166. visible: !0,
  7167. elements: [".nav-help", "#nav-help"]
  7168. },
  7169. tourControls: {
  7170. visible: !0,
  7171. elements: [".next", ".previous", "#play"]
  7172. },
  7173. highlight: {
  7174. visible: !0,
  7175. elements: ["#drawer", "#pullTab"]
  7176. },
  7177. share: {
  7178. visible: !0,
  7179. elements: [".socialButton", "#share"]
  7180. },
  7181. fullScreen: {
  7182. visible: !0,
  7183. elements: ["#gui-fullscreen"]
  7184. },
  7185. floors: {
  7186. visible: !0,
  7187. elements: [".gui-floor"]
  7188. }
  7189. }, Ye = function() {
  7190. var e = document.getElementById("drawer");
  7191. return function() {
  7192. $("#player").height() < 400 && e.classList.contains("open") && a()
  7193. }
  7194. }(), Xe = function() {
  7195. var e = document.getElementById("meta-info");
  7196. return function() {
  7197. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7198. }
  7199. }(), Ze = function(e) {
  7200. function t() {
  7201. u.classList.contains("expand") && de.toggleMeta(!0)
  7202. }
  7203. function i() {
  7204. fe.hide()
  7205. }
  7206. function n() {
  7207. he.close()
  7208. }
  7209. function r() {
  7210. Ae.dismiss()
  7211. }
  7212. function o() {
  7213. p.hasClass("open") && a(!0)
  7214. }
  7215. function l() {
  7216. Ce.hide()
  7217. }
  7218. function c() {
  7219. f.hasClass("open") && f.removeClass("open")
  7220. }
  7221. function h() {
  7222. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7223. }
  7224. var u = document.getElementById("meta-info")
  7225. , d = document.getElementById("interaction-modal")
  7226. , p = $("#drawer").eq(0)
  7227. , f = $(".gui-floor").eq(0)
  7228. , g = $(".vr-popup").eq(0);
  7229. return function(e) {
  7230. switch (e) {
  7231. case "info":
  7232. i(),
  7233. n(),
  7234. Ye(),
  7235. l(),
  7236. c(),
  7237. r(),
  7238. h();
  7239. break;
  7240. case "terms":
  7241. t(),
  7242. n(),
  7243. o(),
  7244. l(),
  7245. c(),
  7246. r(),
  7247. h();
  7248. break;
  7249. case "help":
  7250. t(),
  7251. i(),
  7252. l(),
  7253. c(),
  7254. r(),
  7255. h();
  7256. break;
  7257. case "vr":
  7258. t(),
  7259. i(),
  7260. l(),
  7261. c(),
  7262. n(),
  7263. h(),
  7264. s(g) && o();
  7265. break;
  7266. case "highlights":
  7267. Xe(),
  7268. i(),
  7269. l(),
  7270. c();
  7271. break;
  7272. case "share":
  7273. t(),
  7274. i(),
  7275. n(),
  7276. c(),
  7277. r(),
  7278. h();
  7279. break;
  7280. case "floor":
  7281. i(),
  7282. l(),
  7283. r();
  7284. break;
  7285. case "view":
  7286. c(),
  7287. l(),
  7288. i(),
  7289. r();
  7290. break;
  7291. case "tour":
  7292. i(),
  7293. l(),
  7294. c(),
  7295. r();
  7296. break;
  7297. case "move":
  7298. i(),
  7299. l(),
  7300. c(),
  7301. r();
  7302. break;
  7303. case "resize":
  7304. t(),
  7305. Ye(),
  7306. c();
  7307. break;
  7308. case "tag":
  7309. i(),
  7310. n(),
  7311. l(),
  7312. c(),
  7313. r()
  7314. }
  7315. }
  7316. }();
  7317. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7318. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7319. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7320. setTimeout(function() {
  7321. $(".icon:visible").hide().show(0)
  7322. }, 100)
  7323. }),
  7324. $("#gui-fullscreen").find("a").on("click", function(e) {
  7325. l(e),
  7326. K.requestFullscreen($("body")[0]),
  7327. J.track("showcase_gui", {
  7328. gui_action: "click_enter_fullscreen",
  7329. interaction_source: "gui"
  7330. })
  7331. //czj
  7332. //W.reload()
  7333. }),
  7334. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7335. l(e),
  7336. K.exitFullscreen(),
  7337. J.track("showcase_gui", {
  7338. gui_action: "click_exit_fullscreen",
  7339. interaction_source: "gui"
  7340. })
  7341. })
  7342. $(window).on("resize", function(e) {
  7343. var t = e.target.innerHeight
  7344. , i = e.target.innerWidth;
  7345. t === X && i === Z || (je.highlight.visible && w(),
  7346. Ze("resize"),
  7347. $(".pinTop.right").removeClass("hideUnderMeta"),
  7348. c(),
  7349. X = t,
  7350. Z = i)
  7351. }).resize(),
  7352. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7353. $("#pullTab").on("click", function(e) {
  7354. l(e),
  7355. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7356. gui_action: "hide_highlight_reel"
  7357. }),
  7358. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7359. gui_action: "show_highlight_reel"
  7360. }),
  7361. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7362. a()
  7363. });
  7364. /***********************方奕卓 热点列表事件监听 ************************/
  7365. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7366. $('#hotList').css('display', '');
  7367. $('#hotList').on('click',function(e){
  7368. l(e);
  7369. var hotList = $('#hotListWrap')[0];
  7370. var isActive = hotList.classList.contains('hotListActive');
  7371. if(isActive){
  7372. hotList.classList.remove('hotListActive');
  7373. this.classList.remove('active')
  7374. }else{
  7375. hotList.classList.add('hotListActive');
  7376. this.classList.add('active')
  7377. }
  7378. }),
  7379. $('#hotListContent ul').on('mouseover', function(e){
  7380. l(e);
  7381. var target = e.target;
  7382. var hotList = document.getElementById('hotListWrap');
  7383. if(target.tagName === 'SPAN'){
  7384. var targetParent = target.parentElement.parentElement;
  7385. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7386. hotList.style.width = target.offsetWidth + 116 + 'px';
  7387. }else{
  7388. hotList.style.width = '';
  7389. }
  7390. }else if(target.tagName === 'LI'){
  7391. var targetParent = target.parentElement;
  7392. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7393. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7394. }else{
  7395. hotList.style.width = ''
  7396. }
  7397. }else {
  7398. hotList.style.width = '';
  7399. }
  7400. });
  7401. $('#hotListContent ul').on('click', function(e){
  7402. l(e);
  7403. this.preElem && this.preElem.classList.remove('active');
  7404. if(e.target.tagName === 'SPAN'){
  7405. e.target.parentElement.classList.add('active');
  7406. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7407. this.preElem = e.target.parentElement;
  7408. }else{
  7409. e.target.classList.add('active');
  7410. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7411. this.preElem = e.target;
  7412. }
  7413. })
  7414. $('#hotListClose').on('click', function(e){
  7415. l(e);
  7416. var hotList = $('#hotListWrap')[0];
  7417. hotList.classList.remove('hotListActive');
  7418. $('#hotListContent ul .active').removeClass('active');
  7419. $('#hotList')[0].classList.remove('active')
  7420. })
  7421. }
  7422. /*****************************************************************/
  7423. $("#more-menu-button").on("click", function(e) {
  7424. l(e);
  7425. var t = $("#more-menu");
  7426. t.toggleClass("open")
  7427. }),
  7428. t.exports.init = S,
  7429. t.exports.startLoading = x,
  7430. t.exports.endLoading = d,
  7431. t.exports.onProgress = u
  7432. }
  7433. ).call(this, "/js/gui/gui.js")
  7434. }
  7435. , {
  7436. "../analytics": 4,
  7437. "../controls/serializer": 14,
  7438. "../enum/AlignmentType": 17,
  7439. "../enum/BlackoutStyle": 18,
  7440. "../enum/ControlEvents": 21,
  7441. "../enum/DirectorEvents": 23,
  7442. "../enum/Keys": 30,
  7443. "../enum/PathDiscardMode": 38,
  7444. "../enum/PathDisplayMode": 39,
  7445. "../enum/PlayerEvents": 40,
  7446. "../enum/VROption": 47,
  7447. "../enum/Vectors": 50,
  7448. "../enum/Viewmode": 51,
  7449. "../enum/WarpStyle": 52,
  7450. "../enum/ZoomEvents": 53,
  7451. "../lib/dat.gui": 93,
  7452. "../localization/localize": 108,
  7453. "../tag/Media/MediaEvent": 131,
  7454. "../objects/Snapshot": 153,
  7455. "../settings": 166,
  7456. "../util/ajax": 181,
  7457. "../util/browser": 182,
  7458. "../util/camera": 183,
  7459. "../util/logger": 189,
  7460. "../util/showcase": 193,
  7461. "../util/transitions": 195,
  7462. "./closer/ModalCloserEvent": 61,
  7463. "./closer/modalCloser": 62,
  7464. "./help/HelpEvent": 66,
  7465. "./help/help": 67,
  7466. "./helpManager": 68,
  7467. "./immersiveMode": 69,
  7468. "./konami": 70,
  7469. "./landingScreen": 71,
  7470. "./loadingScreen": 72,
  7471. "./memoryUsage": 73,
  7472. "./playButton": 74,
  7473. "./populateModal": 75,
  7474. "./sharing/ShareEvents": 76,
  7475. "./sharing/modal": 77,
  7476. "./terms/TermsEvent": 78,
  7477. "./terms/terms": 79,
  7478. "./title/TitleEvents": 80,
  7479. "./title/tagToggle": 81,
  7480. "./title/titleBar": 82,
  7481. "./tourInteraction": 84,
  7482. "./vr/vrEvent": 85,
  7483. "./vr/vrModal": 87,
  7484. "./webvr/WebVrEvent": 88,
  7485. "./webvr/webVRgui": 89,
  7486. three: 217
  7487. }],
  7488. 66: [function(e, t, i) {
  7489. "use strict";
  7490. t.exports = Object.freeze({
  7491. OPENED: "help.opened",
  7492. CLOSED: "help.closed"
  7493. })
  7494. }
  7495. , {}],
  7496. 67: [function(e, t, i) {
  7497. "use strict";
  7498. function n() {
  7499. g.on("click", function(e) {
  7500. if (S && S !== l.TRANSITIONING) {
  7501. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7502. t && !M ? R.close() : r()
  7503. }
  7504. }),
  7505. w.on("click", function(e) {
  7506. R.close()
  7507. }),
  7508. E.on("click", function(e) {
  7509. S && S !== l.TRANSITIONING && (s(),
  7510. o())
  7511. }),
  7512. b.on("click", function(e) {
  7513. s(),
  7514. a()
  7515. })
  7516. }
  7517. function r() {
  7518. S && S !== l.TRANSITIONING && (M = !0,
  7519. setTimeout(function() {
  7520. M = !1
  7521. }, d.help.modalStayDuration),
  7522. R.emit(h.OPENED),
  7523. m.addClass("open " + S),
  7524. g.addClass("open"),
  7525. s(),
  7526. o(),
  7527. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7528. y.classList.add("fadeIn"))
  7529. }
  7530. function o() {
  7531. E.addClass("underline-tab"),
  7532. u.fill(_, c.NAVIGATION, S),
  7533. m.addClass(S)
  7534. }
  7535. function a() {
  7536. b.addClass("underline-tab"),
  7537. u.fill(T, c.MORE_HELP),
  7538. m.addClass("more-help")
  7539. }
  7540. function s(e, t) {
  7541. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7542. I.forEach(function(e) {
  7543. e.classList.remove("underline-tab")
  7544. })
  7545. }
  7546. var l = e("../../enum/Viewmode")
  7547. , c = e("../../enum/HelpModalType")
  7548. , h = e("./HelpEvent")
  7549. , u = (e("../helpManager"),
  7550. e("./../populateModal"))
  7551. , d = e("../../settings")
  7552. , p = e("../../util/common")
  7553. , f = e("events").EventEmitter
  7554. , g = $(".footer-help").eq(0)
  7555. , m = $("#help-dialog").eq(0)
  7556. , v = document.querySelector("#quick-logo")
  7557. , A = document.querySelector("#loaderCoBrand")
  7558. , y = document.querySelector("#help-dialog")
  7559. , C = document.querySelector(".footer")
  7560. , I = $(".help-tabs").children().toArray()
  7561. , E = $(".navigation-tab").eq(0)
  7562. , b = $(".more-help-tab").eq(0)
  7563. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7564. m.find(".close").eq(0))
  7565. , _ = m.find(".interactions").toArray()
  7566. , T = m.find(".ui-instructions").toArray()
  7567. , x = l.PANORAMA
  7568. , S = l.PANORAMA
  7569. , M = !1
  7570. , R = {
  7571. init: function(e, t) {
  7572. S = t,
  7573. x = t,
  7574. [y, A, v, C].forEach(function(e) {
  7575. e.classList.add(u.deviceType)
  7576. }),
  7577. n()
  7578. },
  7579. close: function() {
  7580. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7581. g.removeClass("open"),
  7582. m.removeClass("open"),
  7583. y.classList.contains("fadeIn"))) {
  7584. y.classList.remove("fadeIn");
  7585. var e = S === l.TRANSITIONING ? x : S;
  7586. u.clear(_, c.NAVIGATION, e)
  7587. }
  7588. },
  7589. updateMode: function(e) {
  7590. x = S,
  7591. S = e
  7592. }
  7593. };
  7594. p.extendObject(R, f.prototype),
  7595. t.exports = R
  7596. }
  7597. , {
  7598. "../../enum/HelpModalType": 28,
  7599. "../../enum/Viewmode": 51,
  7600. "../../settings": 166,
  7601. "../../util/common": 185,
  7602. "../helpManager": 68,
  7603. "./../populateModal": 75,
  7604. "./HelpEvent": 66,
  7605. events: 202
  7606. }],
  7607. 68: [function(e, t, i) {
  7608. (function(i) {
  7609. "use strict";
  7610. var n = e("../util/browser")
  7611. , r = e("./../util/logger")
  7612. , o = e("./../settings")
  7613. , a = new r(i)
  7614. , s = function() {
  7615. var e;
  7616. try {
  7617. return e = window.localStorage.getItem("visitCount") || "0",
  7618. e = (parseFloat(e) + 1).toString(),
  7619. window.localStorage.setItem("visitCount", e),
  7620. a.debug("visitCount = " + e),
  7621. e
  7622. } catch (t) {
  7623. e = "1",
  7624. a.debug("couldn't set local storage")
  7625. }
  7626. }()
  7627. , l = !1;
  7628. t.exports = {
  7629. isHelpDisabled: function() {
  7630. return "0" === n.valueFromHash("help", null) || l
  7631. },
  7632. isLargeHelpEnabled: function() {
  7633. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7634. },
  7635. isSmallHelpEnabled: function() {
  7636. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7637. },
  7638. isHelpEnabled: function() {
  7639. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7640. },
  7641. setAutoPlay: function(e) {
  7642. l = o.warp.auto >= 0 && e > 1
  7643. }
  7644. }
  7645. }
  7646. ).call(this, "/js/gui/helpManager.js")
  7647. }
  7648. , {
  7649. "../util/browser": 182,
  7650. "./../settings": 166,
  7651. "./../util/logger": 189
  7652. }],
  7653. 69: [function(e, t, i) {
  7654. "use strict";
  7655. function n(e, t, i, n) {
  7656. F = n,
  7657. r(e, t, i, F),
  7658. o(),
  7659. N = t.mode
  7660. }
  7661. function r(e, t, i, n) {
  7662. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7663. e.controls[t].on(v.Move, a),
  7664. e.controls[t].on(v.LongTap, c)
  7665. }),
  7666. M.on("mousewheel DOMMouseScroll", a),
  7667. i.on(m.TagActivated, a),
  7668. i.on(m.TagNavigation, a),
  7669. t.on(A.FlyingEnded, s),
  7670. t.on(A.ModeChanging, function(e, t) {
  7671. B = t !== C.PANORAMA && e !== C.PANORAMA
  7672. }),
  7673. t.on(A.ModeChanged, function(e, i) {
  7674. N = t.mode,
  7675. i !== C.TRANSITIONING ? l() : a("modeChange")
  7676. }),
  7677. n.on(y.TourStart, function() {
  7678. L = !0,
  7679. a()
  7680. }),
  7681. n.on(y.TourEnd, function() {
  7682. L = !1,
  7683. l()
  7684. }),
  7685. n.on(y.ActionInterrupted, function() {
  7686. L = !1
  7687. }),
  7688. R.addEventListener("touchend", function() {
  7689. $("#pullTab").hasClass("opened") && !L && l()
  7690. }, !0)
  7691. }
  7692. function o() {
  7693. p.isMobile() ? (b.forEach(function(e) {
  7694. e.classList.add("mobile")
  7695. }),
  7696. w.click(l)) : (b.forEach(function(e) {
  7697. e.addEventListener("mouseleave", function() {
  7698. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7699. }, !0)
  7700. }),
  7701. M.mouseleave(function() {
  7702. b[0].classList.contains("detectHover") && l()
  7703. }))
  7704. }
  7705. function a(e) {
  7706. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7707. P = !0,
  7708. g.close(),
  7709. h(e),
  7710. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7711. _.hasClass("playing") || (b.forEach(function(e) {
  7712. e.classList.add("detectHover")
  7713. }),
  7714. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7715. }
  7716. function s() {
  7717. _.hasClass("playing") || (clearTimeout(O),
  7718. O = setTimeout(l, f.immersive.timeToShowAgain))
  7719. }
  7720. function l() {
  7721. clearTimeout(O),
  7722. P = !1,
  7723. I.forEach(function(e) {
  7724. e.classList.remove("drawerOpen")
  7725. }),
  7726. L || E.forEach(function(e) {
  7727. e.classList.remove("duringTour")
  7728. }),
  7729. b.forEach(function(e) {
  7730. e.classList.remove("detectHover")
  7731. })
  7732. }
  7733. function c() {
  7734. P ? l() : a(),
  7735. D = !0,
  7736. setTimeout(function() {
  7737. D = !1
  7738. }, f.immersive.uiStayDuration)
  7739. }
  7740. function h(e) {
  7741. !d(e) && L ? E.forEach(function(e) {
  7742. e.classList.remove("drawerOpen"),
  7743. e.classList.add("duringTour")
  7744. }) : _.hasClass("open") ? E.forEach(function(e) {
  7745. e.classList.remove("duringTour"),
  7746. e.classList.add("drawerOpen")
  7747. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7748. e.classList.add("fadeOut")
  7749. })
  7750. }
  7751. function u() {
  7752. T.hasClass("duringTour") || (L = !1,
  7753. a("gui"),
  7754. l())
  7755. }
  7756. function d(e) {
  7757. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7758. }
  7759. var p = e("../util/browser")
  7760. , f = e("../settings")
  7761. , g = e("./help/help")
  7762. , m = e("../enum/tagEvents")
  7763. , v = e("../enum/ControlEvents")
  7764. , A = e("../enum/PlayerEvents")
  7765. , y = e("../enum/DirectorEvents")
  7766. , A = e("../enum/PlayerEvents")
  7767. , C = e("../enum/Viewmode")
  7768. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7769. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7770. , b = $("#hover-bottom, #hover-top").toArray()
  7771. , w = ($("#pullTab").eq(0),
  7772. $("#playHead").eq(0),
  7773. $(".pinBottom-container").eq(0))
  7774. , _ = $("#drawer").eq(0)
  7775. , T = $("#drawer-container").eq(0)
  7776. , x = $("#meta-info").eq(0)
  7777. , S = $(".pinTop.left").eq(0)
  7778. , M = $("#player").eq(0)
  7779. , R = document.getElementById("pullTab")
  7780. , P = !1
  7781. , O = null
  7782. , L = !1
  7783. , D = !1
  7784. , N = null
  7785. , B = !1
  7786. , F = null;
  7787. t.exports.init = n,
  7788. t.exports.hideUi = a,
  7789. t.exports.resetDrawer = u
  7790. }
  7791. , {
  7792. "../enum/ControlEvents": 21,
  7793. "../enum/DirectorEvents": 23,
  7794. "../enum/tagEvents": 32,
  7795. "../enum/PlayerEvents": 40,
  7796. "../enum/Viewmode": 51,
  7797. "../settings": 166,
  7798. "../util/browser": 182,
  7799. "./help/help": 67
  7800. }],
  7801. 70: [function(e, t, i) {
  7802. (function(i) {
  7803. "use strict";
  7804. function n(e, t, i) {
  7805. l.debug("konami has the modelInstance");
  7806. var n = [];
  7807. $(window).on("keydown", function(e) {
  7808. n.push(e.which),
  7809. n.length > o.secretPanelWord.length && n.shift(),
  7810. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7811. o.debug = !0)
  7812. }),
  7813. $(window).on("keydown", function n(r) {
  7814. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7815. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7816. })
  7817. }
  7818. var r = e("./../util/logger")
  7819. , o = e("./../settings")
  7820. , a = e("./debug")
  7821. , s = e("./../util/common")
  7822. , l = (e("./gui"),
  7823. new r(i));
  7824. o.console && $("body").append('<div id="debug-console"></div>'),
  7825. t.exports.init = n
  7826. }
  7827. ).call(this, "/js/gui/konami.js")
  7828. }
  7829. , {
  7830. "./../settings": 166,
  7831. "./../util/common": 185,
  7832. "./../util/logger": 189,
  7833. "./debug": 63,
  7834. "./gui": 65
  7835. }],
  7836. 71: [function(e, t, i) {
  7837. "use strict";
  7838. function n(e, t) {
  7839. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7840. }
  7841. function r(e) {
  7842. var t = $.Deferred();
  7843. e || t.resolve();
  7844. var i = c.startupFlyinDelay;
  7845. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7846. setTimeout(t.resolve.bind(t), i),
  7847. t
  7848. }
  7849. function o(e, t, i) {
  7850. var n = 0;
  7851. c.quickstart.enabled && (a(i),
  7852. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7853. var r = function() {
  7854. e.once(g.Move, l),
  7855. t.once(f.TourStart, l)
  7856. };
  7857. s(n, r)
  7858. }
  7859. function a(e) {
  7860. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7861. v.before(y),
  7862. A = $(".quick-brand").toArray()),*/
  7863. m.addClass("fadeOut"),
  7864. setTimeout(function() {
  7865. A.forEach(function(e) {
  7866. e.classList.add("fadeIn")
  7867. })
  7868. }, c.quickstart.showTextDelay),
  7869. setTimeout(function() {
  7870. A.forEach(function(e) {
  7871. e.classList.add("fadeOut")
  7872. })
  7873. }, c.quickstart.fadeOutDelay),
  7874. !0
  7875. }
  7876. function s(e, t) {
  7877. setTimeout(function() {
  7878. if (h.isHelpEnabled()) {
  7879. if (t(),
  7880. u.init(),
  7881. C.addClass("fadeIn landing " + u.deviceType),
  7882. h.isSmallHelpEnabled())
  7883. return void C.addClass("small");
  7884. u.fill(I, d.LANDING[E]),
  7885. C.addClass(E)
  7886. }
  7887. }, e)
  7888. //csz 用户引导界面
  7889. var helpData = {
  7890. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7891. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7892. }
  7893. var navIcon = $(".nav-icon .icon");
  7894. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7895. function paging(id){
  7896. id.on("click",function(){
  7897. var navPage = null;
  7898. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7899. if(navPage > helpData.length || navPage < 1) return false
  7900. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7901. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7902. }else{
  7903. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7904. }
  7905. })
  7906. };
  7907. paging($(".next-button"));
  7908. paging($(".prev-button"));
  7909. }
  7910. function l() {
  7911. u.clear(I, d.LANDING[E]),
  7912. C.removeClass("fadeIn")
  7913. }
  7914. var c = e("../settings")
  7915. , h = (e("./help/help"),
  7916. e("./helpManager"))
  7917. , u = e("./populateModal")
  7918. , d = e("../enum/HelpModalType")
  7919. , p = e("../enum/Viewmode")
  7920. , f = e("../enum/DirectorEvents")
  7921. , g = e("../enum/PlayerEvents")
  7922. , m = $("#quick-blackout").eq(0)
  7923. , v = $("#quick-logo").eq(0)
  7924. , A = $(".quick-brand").toArray()
  7925. , y = $("#loaderCoBrand").eq(0)
  7926. , C = $("#interaction-modal").eq(0)
  7927. , I = C.find(".interaction").toArray()
  7928. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7929. "");
  7930. t.exports.delayLanding = r,
  7931. t.exports.showMessage = o,
  7932. t.exports.init = n,
  7933. t.exports.dismissModal = l
  7934. }
  7935. , {
  7936. "../enum/DirectorEvents": 23,
  7937. "../enum/HelpModalType": 28,
  7938. "../enum/PlayerEvents": 40,
  7939. "../enum/Viewmode": 51,
  7940. "../settings": 166,
  7941. "./help/help": 67,
  7942. "./helpManager": 68,
  7943. "./populateModal": 75
  7944. }],
  7945. 72: [function(e, t, i) {
  7946. "use strict";
  7947. var n = e("./circleLoader").circleLoader;
  7948. t.exports = {
  7949. element: $("#gui-loading"),
  7950. hide: function(e) {
  7951. n.done(),
  7952. this.element.fadeOut(1500, e)
  7953. },
  7954. show: function(e) {
  7955. this.element.fadeIn(500, function() {
  7956. this.element.css("display", "table"),
  7957. e && e()
  7958. }
  7959. .bind(this))
  7960. },
  7961. progress: function(e) {
  7962. n.set(e)
  7963. }
  7964. }
  7965. }
  7966. , {
  7967. "./circleLoader": 60
  7968. }],
  7969. 73: [function(e, t, i) {
  7970. "use strict";
  7971. var n = e("../settings")
  7972. , r = $("#memory-info")
  7973. , o = r.find("#memory-gpu")
  7974. , a = !1;
  7975. t.exports = {
  7976. show: function() {
  7977. n.profiling.enabled && (r.show(),
  7978. a = !0)
  7979. },
  7980. hide: function() {
  7981. r.hide(),
  7982. a = !1
  7983. },
  7984. toggle: function() {
  7985. a ? this.hide() : this.show()
  7986. },
  7987. update: function(e) {
  7988. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7989. }
  7990. }
  7991. }
  7992. , {
  7993. "../settings": 166
  7994. }],
  7995. 74: [function(e, t, i) {
  7996. "use strict";
  7997. var n = e("../util/browser")
  7998. , r = e("../analytics");
  7999. e("../settings");
  8000. t.exports = {
  8001. show: function(e, t) {
  8002. $("#gui-message").fadeOut(500, function() {
  8003. t()
  8004. })
  8005. }
  8006. }
  8007. }
  8008. , {
  8009. "../analytics": 4,
  8010. "../settings": 166,
  8011. "../util/browser": 182
  8012. }],
  8013. 75: [function(e, t, i) {
  8014. "use strict";
  8015. function n(e, t, i, n) {
  8016. function r(e) {
  8017. return e.classList.contains(a)
  8018. }
  8019. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8020. //for (var a in o) {
  8021. //var s = e.find(r);
  8022. //for (var l in o[a]) {
  8023. //var c = o[a][l];
  8024. //if ("top-info" === l || "bottom-info" === l) {
  8025. //var h = n ? c : "";
  8026. //czj 注释掉第一次打开的用户引导
  8027. //s.querySelector("." + l).textContent = h
  8028. //} else {
  8029. //var u = n ? c : "";
  8030. //, d = s.querySelector("." + l);
  8031. //d.src = u,
  8032. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8033. //}
  8034. //}
  8035. //}
  8036. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8037. // p.forEach(function(e) {
  8038. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8039. // })
  8040. }
  8041. var r = e("../util/browser")
  8042. , o = e("../localization/localize")
  8043. , a = e("../enum/HelpModalType")
  8044. , s = (e("../enum/HelpModalSize"),
  8045. e("../enum/Viewmode"));
  8046. t.exports = {
  8047. init: function() {
  8048. if (!this.hasInitialized) {
  8049. this.hasInitialized = !0,
  8050. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8051. this.assets = {},
  8052. this.assets[a.LANDING[s.PANORAMA]] = {
  8053. desktop: {
  8054. left: {
  8055. "top-info": o.ROTATE,
  8056. "big-image": "images/nav_help_mouse_drag_left.png",
  8057. keyboard: "images/nav_help_keyboard_left_right.png"
  8058. },
  8059. middle: {
  8060. "top-info": o.MOVE,
  8061. "big-image": "images/nav_help_mouse_click.png",
  8062. keyboard: "images/nav_help_keyboard_up_down.png"
  8063. },
  8064. right: {
  8065. "top-info": o.ZOOM,
  8066. "big-image": "images/nav_help_mouse_zoom.png",
  8067. keyboard: "images/nav_help_zoom_keys.png"
  8068. }
  8069. },
  8070. mobile: {
  8071. left: {
  8072. "top-info": o.ROTATE,
  8073. "big-image": "images/nav_help_gesture_drag.png"
  8074. },
  8075. middle: {
  8076. "top-info": o.MOVE,
  8077. "big-image": "images/nav_help_gesture_tap.png"
  8078. },
  8079. right: {
  8080. "top-info": o.ZOOM,
  8081. "big-image": "images/nav_help_gesture_pinch.png"
  8082. }
  8083. }
  8084. },
  8085. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8086. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8087. desktop: {
  8088. left: {
  8089. "top-info": o.ROTATE,
  8090. "big-image": "images/nav_help_mouse_drag_left.png",
  8091. keyboard: "images/nav_help_keyboard_left_right.png"
  8092. },
  8093. middle: {
  8094. "top-info": o.MOVE,
  8095. "big-image": "images/nav_help_mouse_position_right.png"
  8096. }
  8097. },
  8098. mobile: {
  8099. left: {
  8100. "top-info": o.ROTATE,
  8101. "big-image": "images/nav_help_gesture_drag.png"
  8102. },
  8103. middle: {
  8104. "top-info": o.MOVE,
  8105. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8106. }
  8107. }
  8108. },
  8109. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8110. desktop: {
  8111. left: {
  8112. "top-info": o.MOVE,
  8113. "big-image": "images/nav_help_mouse_position_left.png"
  8114. },
  8115. middle: {
  8116. "top-info": o.ROTATE,
  8117. "big-image": "images/nav_help_mouse_drag_right.png",
  8118. keyboard: "images/nav_help_keyboard_left_right.png"
  8119. }
  8120. },
  8121. mobile: {
  8122. left: {
  8123. "top-info": o.MOVE,
  8124. "big-image": "images/nav_help_gesture_position.png"
  8125. },
  8126. middle: {
  8127. "top-info": o.ROTATE,
  8128. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8129. }
  8130. }
  8131. };
  8132. var e = {
  8133. "top-info": o.INSIDE,
  8134. "big-image": "images/nav_help_click_inside.png",
  8135. keyboard: "images/nav_help_inside_key.png"
  8136. };
  8137. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8138. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8139. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8140. var t = {
  8141. "top-info": o.INSIDE,
  8142. "big-image": "images/nav_help_tap_inside.png"
  8143. };
  8144. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8145. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8146. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8147. this.assets[a.NAVIGATION] = {},
  8148. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8149. desktop: {
  8150. left: {
  8151. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8152. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8153. "big-image": "images/nav_help_mouse_drag_left.png",
  8154. keyboard: "images/nav_help_keyboard_left_right.png"
  8155. },
  8156. middle: {
  8157. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8158. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8159. "big-image": "images/nav_help_mouse_click.png",
  8160. keyboard: "images/nav_help_keyboard_up_down.png"
  8161. },
  8162. right: {
  8163. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8164. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8165. "big-image": "images/nav_help_mouse_zoom.png",
  8166. keyboard: "images/nav_help_zoom_keys.png"
  8167. }
  8168. },
  8169. mobile: {
  8170. left: {
  8171. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8172. "big-image": "images/nav_help_gesture_drag.png"
  8173. },
  8174. middle: {
  8175. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8176. "big-image": "images/nav_help_gesture_tap.png"
  8177. },
  8178. right: {
  8179. "top-info": o.HELP_MOBILE_3,
  8180. "big-image": "images/nav_help_gesture_pinch.png"
  8181. }
  8182. }
  8183. },
  8184. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8185. desktop: {
  8186. left: {
  8187. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8188. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8189. "big-image": "images/nav_help_mouse_drag_left.png",
  8190. keyboard: "images/nav_help_keyboard_all.png"
  8191. },
  8192. middle: {
  8193. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8194. "big-image": "images/nav_help_mouse_position_right.png"
  8195. },
  8196. right: {
  8197. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8198. "big-image": "images/nav_help_mouse_zoom.png"
  8199. }
  8200. },
  8201. mobile: {
  8202. left: {
  8203. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8204. "big-image": "images/nav_help_gesture_drag.png"
  8205. },
  8206. middle: {
  8207. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8208. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8209. },
  8210. right: {
  8211. "top-info": o.HELP_MOBILE_3,
  8212. "big-image": "images/nav_help_gesture_pinch.png"
  8213. }
  8214. }
  8215. },
  8216. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8217. desktop: {
  8218. left: {
  8219. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8220. "big-image": "images/nav_help_mouse_position_left.png"
  8221. },
  8222. middle: {
  8223. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8224. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8225. "big-image": "images/nav_help_mouse_drag_right.png",
  8226. keyboard: "images/nav_help_keyboard_left_right.png"
  8227. },
  8228. right: {
  8229. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8230. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8231. "big-image": "images/nav_help_mouse_zoom.png",
  8232. keyboard: "images/nav_help_keyboard_up_down.png"
  8233. }
  8234. },
  8235. mobile: {
  8236. left: {
  8237. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8238. "big-image": "images/nav_help_gesture_position.png"
  8239. },
  8240. middle: {
  8241. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8242. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8243. },
  8244. right: {
  8245. "top-info": o.HELP_MOBILE_3,
  8246. "big-image": "images/nav_help_gesture_pinch.png"
  8247. }
  8248. }
  8249. },
  8250. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8251. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8252. "top-info": o.HELP_DESKTOP_360_2A,
  8253. "bottom-info": o.HELP_DESKTOP_360_2B,
  8254. "big-image": "images/nav_help_click_inside.png",
  8255. keyboard: "images/nav_help_inside_key.png"
  8256. },
  8257. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8258. "top-info": o.HELP_MOBILE_360_2,
  8259. "big-image": "images/nav_help_tap_inside.png"
  8260. },
  8261. this.assets[a.MORE_HELP] = {
  8262. desktop: {
  8263. "more-help-hlr": {
  8264. "top-info": o.HELP_MORE_HLR_A,
  8265. "big-image": "images/nav_help_expand.svg",
  8266. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8267. },
  8268. "more-help-dollhouse": {
  8269. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8270. "big-image": "images/nav_help_dollhouse.svg",
  8271. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8272. },
  8273. "more-help-floors": {
  8274. "top-info": o.HELP_MORE_FLOORS_A,
  8275. "big-image": "images/nav_help_floor picker.svg",
  8276. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8277. },
  8278. "more-help-tag": {
  8279. "top-info": o.HELP_MORE_TAG_A,
  8280. "big-image": "images/nav_help_tag.svg",
  8281. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8282. },
  8283. "more-help-zoom": {
  8284. "top-info": o.HELP_MORE_ZOOM_A,
  8285. "big-image": "images/nav_help_zoom.svg",
  8286. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8287. },
  8288. "more-help-tour": {
  8289. "top-info": o.HELP_MORE_TOUR_A,
  8290. "big-image": "images/nav_help_play.png",
  8291. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8292. },
  8293. "more-help-inside": {
  8294. "top-info": o.HELP_MORE_INSIDE_A,
  8295. "big-image": "images/nav_help_inside.svg",
  8296. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8297. },
  8298. "more-help-vr": {
  8299. "top-info": o.HELP_MORE_VR_A,
  8300. "big-image": "images/nav_help_vr.svg",
  8301. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8302. },
  8303. "more-help-360": {
  8304. "top-info": o.HELP_MORE_360_A,
  8305. "big-image": "images/nav_help_360.svg",
  8306. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8307. },
  8308. "more-help-fullscreen": {
  8309. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8310. "big-image": "images/nav_help_fullscreen.svg",
  8311. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8312. }
  8313. },
  8314. mobile: {
  8315. "more-help-hlr": {
  8316. "top-info": o.HELP_MORE_HLR_A,
  8317. "big-image": "images/nav_help_expand.svg",
  8318. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8319. },
  8320. "more-help-dollhouse": {
  8321. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8322. "big-image": "images/nav_help_dollhouse.svg",
  8323. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8324. },
  8325. "more-help-floors": {
  8326. "top-info": o.HELP_MORE_FLOORS_A,
  8327. "big-image": "images/nav_help_floor picker.svg",
  8328. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8329. },
  8330. "more-help-tag": {
  8331. "top-info": o.HELP_MORE_TAG_A,
  8332. "big-image": "images/nav_help_tag.svg",
  8333. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8334. },
  8335. "more-help-tour": {
  8336. "top-info": o.HELP_MORE_TOUR_A,
  8337. "big-image": "images/nav_help_play.png",
  8338. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8339. },
  8340. "more-help-inside": {
  8341. "top-info": o.HELP_MORE_INSIDE_A,
  8342. "big-image": "images/nav_help_inside.svg",
  8343. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8344. },
  8345. "more-help-vr": {
  8346. "top-info": o.HELP_MORE_VR_A,
  8347. "big-image": "images/webvr.svg",
  8348. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8349. },
  8350. "more-help-360": {
  8351. "top-info": o.HELP_MORE_360_A,
  8352. "big-image": "images/nav_help_360.svg",
  8353. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8354. }
  8355. }
  8356. },
  8357. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8358. desktop: {
  8359. left: {
  8360. "top-info": o.ROTATE,
  8361. "big-image": "images/nav_help_mouse_drag_left.png",
  8362. keyboard: "images/nav_help_keyboard_left_right.png"
  8363. },
  8364. middle: {
  8365. "top-info": o.MOVE,
  8366. "big-image": "images/nav_help_mouse_click.png",
  8367. keyboard: "images/nav_help_keyboard_up_down.png"
  8368. },
  8369. right: {
  8370. "top-info": o.PLAY,
  8371. "big-image": "images/Desktop-help-play-button.svg",
  8372. keyboard: "images/Desktop-help-spacebar-2.svg"
  8373. }
  8374. },
  8375. mobile: {
  8376. left: {
  8377. "top-info": o.ROTATE,
  8378. "big-image": "images/nav_help_gesture_drag.png"
  8379. },
  8380. middle: {
  8381. "top-info": o.MOVE,
  8382. "big-image": "images/nav_help_gesture_tap.png"
  8383. },
  8384. right: {
  8385. "top-info": o.PLAY,
  8386. "big-image": "images/mobile-help-play-button.svg"
  8387. }
  8388. }
  8389. },
  8390. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8391. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8392. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8393. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8394. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8395. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8396. }
  8397. },
  8398. fill: function(e, t, i) {
  8399. n.call(this, e, t, i, !0)
  8400. },
  8401. clear: function(e, t, i) {
  8402. n.call(this, e, t, i, !1)
  8403. }
  8404. }
  8405. }
  8406. , {
  8407. "../enum/HelpModalSize": 27,
  8408. "../enum/HelpModalType": 28,
  8409. "../enum/Viewmode": 51,
  8410. "../localization/localize": 108,
  8411. "../util/browser": 182
  8412. }],
  8413. 76: [function(e, t, i) {
  8414. "use strict";
  8415. t.exports = Object.freeze({
  8416. OPENED: "share.open",
  8417. CLOSED: "share.closed",
  8418. LINK_CLICKED: "share.linked"
  8419. })
  8420. }
  8421. , {}],
  8422. 77: [function(e, t, i) {
  8423. "use strict";
  8424. function n(e) {
  8425. function t(t, i) {
  8426. var n = window.screenY + ($("#player").height() - i) / 2
  8427. , r = window.screenX + ($("#player").width() - t) / 2
  8428. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8429. I.emit(l.LINK_CLICKED, {
  8430. channel: e
  8431. }),
  8432. window.open(C[e], "shareWindow", o)
  8433. }
  8434. switch (e) {
  8435. case y.FACEBOOK:
  8436. t(580, 420);
  8437. break;
  8438. case y.TWITTER:
  8439. t(550, 440);
  8440. break;
  8441. case y.MAIL:
  8442. I.emit(l.LINK_CLICKED, {
  8443. channel: "email"
  8444. }),
  8445. window.open(C[e], "_blank");
  8446. break;
  8447. case y.LINKEDIN:
  8448. }
  8449. }
  8450. function r(e) {
  8451. I.emit(l.LINK_CLICKED, {
  8452. channel: "copylink"
  8453. });
  8454. var t = document.createRange();
  8455. t.selectNodeContents(v);
  8456. var i = window.getSelection();
  8457. i.removeAllRanges(),
  8458. i.addRange(t),
  8459. document.execCommand("copy"),
  8460. A.classList.remove("hidden"),
  8461. v.classList.add("highlighted")
  8462. }
  8463. function o(e) {
  8464. e && (e.stopPropagation(),
  8465. e.target === v) || (window.getSelection().removeAllRanges(),
  8466. v.classList.remove("highlighted"),
  8467. A.classList.add("hidden"))
  8468. }
  8469. var a = e("../../util/browser")
  8470. , s = e("../../localization/localize")
  8471. , l = e("./ShareEvents")
  8472. , c = e("../../util/common")
  8473. , h = e("events").EventEmitter
  8474. , u = document.getElementById("sharing")
  8475. , d = document.getElementById("share-modal")
  8476. , p = document.getElementById("share-close")
  8477. , f = document.getElementById("facebook-share")
  8478. , g = document.getElementById("twitter-share")
  8479. , m = document.getElementById("mail-share")
  8480. , v = document.getElementById("share-url-text")
  8481. , A = document.getElementById("copy-success")
  8482. , y = Object.freeze({
  8483. FACEBOOK: "facebook",
  8484. TWITTER: "twitter",
  8485. MAIL: "mail",
  8486. LINKEDIN: "linkedin"
  8487. })
  8488. , C = {};
  8489. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8490. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8491. C[y.MAIL] = "mailto:?subject=";
  8492. var I = {
  8493. init: function(e) {
  8494. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8495. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8496. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8497. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8498. u.addEventListener("click", this.toggle.bind(this)),
  8499. p.addEventListener("click", this.hide.bind(this)),
  8500. v.addEventListener("click", r),
  8501. d.addEventListener("click", o),
  8502. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8503. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8504. m.addEventListener("click", n.bind(this, y.MAIL)),
  8505. v.textContent = window.location.href + "&utm_source=4",
  8506. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8507. u.classList.remove("hidden")
  8508. },
  8509. show: function() {
  8510. this.emit(l.OPENED),
  8511. d.classList.add("fadeIn")
  8512. },
  8513. hide: function() {
  8514. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8515. document.selection && document.selection.empty(),
  8516. window.getSelection().removeAllRanges(),
  8517. o(),
  8518. d.classList.remove("fadeIn"))
  8519. },
  8520. toggle: function() {
  8521. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8522. }
  8523. };
  8524. c.extendObject(I, h.prototype),
  8525. t.exports = I
  8526. }
  8527. , {
  8528. "../../localization/localize": 108,
  8529. "../../util/browser": 182,
  8530. "../../util/common": 185,
  8531. "./ShareEvents": 76,
  8532. events: 202
  8533. }],
  8534. 78: [function(e, t, i) {
  8535. "use strict";
  8536. t.exports = Object.freeze({
  8537. OPENED: "terms.opened",
  8538. CLOSED: "terms.closed"
  8539. })
  8540. }
  8541. , {}],
  8542. 79: [function(e, t, i) {
  8543. "use strict";
  8544. var n = e("./TermsEvent")
  8545. , r = e("../../localization/localize")
  8546. , o = e("../../analytics")
  8547. , a = e("../../util/ajax")
  8548. , s = e("../../util/common")
  8549. , l = e("events").EventEmitter
  8550. , c = document.getElementById("terms-modal")
  8551. , h = {
  8552. init: function() {
  8553. $(".footer-terms").on("click", function(e) {
  8554. e.preventDefault(),
  8555. this.show()
  8556. }
  8557. .bind(this)),
  8558. $("#terms-modal .close").on("click", this.hide.bind(this))
  8559. },
  8560. show: function() {
  8561. this.emit(n.OPENED),
  8562. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8563. var t = $("#terms-text").html(e);
  8564. o.track("showcase_gui", {
  8565. gui_action: "click_terms_button",
  8566. interaction_source: "gui"
  8567. }),
  8568. t.find("a").attr("target", "_blank")
  8569. }).fail(function() {
  8570. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8571. }),
  8572. c.classList.add("fadeIn")
  8573. },
  8574. hide: function(e) {
  8575. e && e.preventDefault(),
  8576. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8577. c.classList.remove("fadeIn")
  8578. }
  8579. };
  8580. s.extendObject(h, l.prototype),
  8581. t.exports = h
  8582. }
  8583. , {
  8584. "../../analytics": 4,
  8585. "../../localization/localize": 108,
  8586. "../../util/ajax": 181,
  8587. "../../util/common": 185,
  8588. "./TermsEvent": 78,
  8589. events: 202
  8590. }],
  8591. 80: [function(e, t, i) {
  8592. "use strict";
  8593. t.exports = Object.freeze({
  8594. OPEN_INFO: "title.open.info",
  8595. CLOSE_INFO: "title.close.info",
  8596. SHOW_INFO: "title.show.info",
  8597. HIDE_INFO: "title.hide.info",
  8598. LINK_CLICKED: "title.link.click",
  8599. CONTACT_LINK_CLICKED: "title.contact.click",
  8600. ORIGIN_LINK_CLICKED: "title.origin.click"
  8601. })
  8602. }
  8603. , {}],
  8604. 81: [function(e, t, i) {
  8605. "use strict";
  8606. function n(e, t) {
  8607. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8608. }
  8609. function r(e, t) {
  8610. function i(i) {
  8611. e.shouldShowtags = "show" === this.value,
  8612. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8613. }
  8614. document.getElementById("tag-toggles").classList.remove("hidden"),
  8615. document.getElementById("radio-tag-show").checked = !0;
  8616. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8617. n[r].addEventListener("change", i)
  8618. }
  8619. var o = e("../../settings");
  8620. t.exports.init = n
  8621. }
  8622. , {
  8623. "../../settings": 166
  8624. }],
  8625. 82: [function(e, t, i) {
  8626. (function(i) {
  8627. "use strict";
  8628. function n(e, t) {
  8629. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8630. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8631. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8632. document.getElementById("gui-name").classList.add("noCoBrand"),
  8633. document.getElementById("cobrandTitle").classList.add("hidden")),
  8634. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8635. !1)
  8636. }
  8637. function r(e) {
  8638. return e ? (L = !0,
  8639. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8640. }
  8641. function o(e, t, i, n) {
  8642. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8643. return void T.classList.add("hidden");
  8644. L = !0;
  8645. var r = []
  8646. , o = c(r, "<br>");
  8647. if (e && o('<span id="contactName">' + e + "</span>"),
  8648. t) {
  8649. var a = n || t
  8650. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8651. o(s)
  8652. }
  8653. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8654. r[0] = "",
  8655. x.innerHTML = r.join("")
  8656. }
  8657. function a(e) {
  8658. if ("string" == typeof e)
  8659. try {
  8660. e = JSON.parse(e)
  8661. } catch (e) {
  8662. return y.warn("Unable to parse address data"),
  8663. void S.parentElement.classList.add("hidden")
  8664. }
  8665. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8666. return void S.parentElement.classList.add("hidden");
  8667. L = !0;
  8668. var t = []
  8669. , i = c(t, " ");
  8670. e.address_1 && i(e.address_1),
  8671. e.address_2 && i(e.address_2),
  8672. e.city && i(e.city, ", "),
  8673. e.state && i(e.state, ", "),
  8674. e.zip && i(e.zip, e.state ? " " : ", "),
  8675. t[0] = "",
  8676. S.innerText = t.join("")
  8677. }
  8678. function s(e) {
  8679. var t = document.createElement("a");
  8680. return t.id = "url",
  8681. t.target = "_blank",
  8682. t.href = e,
  8683. t.innerText = e,
  8684. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8685. t
  8686. }
  8687. function l(e) {
  8688. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8689. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8690. P.appendChild(s(e)),
  8691. O.forEach(function(e) {
  8692. e.classList.add("share-link")
  8693. }),
  8694. !0)
  8695. }
  8696. function c(e, t) {
  8697. var i = e
  8698. , n = t;
  8699. return function(e, t) {
  8700. i.push(t || n, e)
  8701. }
  8702. }
  8703. function h() {
  8704. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8705. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8706. var e = [].slice.call(_.querySelectorAll("a"));
  8707. e.forEach(function(e) {
  8708. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8709. });
  8710. var t = [].slice.call(T.querySelectorAll("a"));
  8711. t.forEach(function(e) {
  8712. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8713. contact_type: e.getAttribute("id")
  8714. }))
  8715. })
  8716. }
  8717. var u = e("../../util/browser")
  8718. , d = e("../../util/common")
  8719. , p = e("../../util/logger")
  8720. , f = e("../../localization/localize")
  8721. , g = e("./titleBarSettings")
  8722. , m = e("../../settings")
  8723. , v = e("./TitleEvents")
  8724. , A = e("events").EventEmitter
  8725. , y = new p(i)
  8726. , C = document.querySelector(".pinTop.left")
  8727. , I = document.getElementsByClassName("title-container")[0]
  8728. , E = document.getElementById("title-toggle").querySelector("i")
  8729. , b = document.getElementById("meta-info-wrapper")
  8730. , w = document.getElementById("meta-info")
  8731. , _ = document.getElementById("meta-description")
  8732. , T = document.getElementsByClassName("contact-info")[0]
  8733. , x = document.getElementById("contact-data")
  8734. , S = document.getElementById("addressTxt")
  8735. , M = document.getElementById("tag-toggles")
  8736. , R = document.getElementById("share-origin")
  8737. , P = document.getElementById("share-link-wrapper")
  8738. , O = [w, b, I]
  8739. , L = !1
  8740. , D = !1
  8741. , N = {
  8742. populate: function(e) {
  8743. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8744. if (r(e.description),
  8745. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8746. a(e.address),
  8747. L) {
  8748. var t = document.createElement("br");
  8749. M.insertBefore(t, M.firstElementChild)
  8750. }
  8751. e.socialSharing && m.share.enabled && (D = l(e.url))
  8752. }
  8753. },
  8754. finishSetup: function(e) {
  8755. L = L || !!e,
  8756. h(),
  8757. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8758. },
  8759. toggleMeta: function(e, t) {
  8760. var title = document.getElementById("model-title");
  8761. t && t.preventDefault();
  8762. var i = w.classList.contains("expand");
  8763. e && !i || (i ? (O.forEach(function(e) {
  8764. e.classList.remove("expand")
  8765. }),
  8766. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8767. e.classList.add("expand");
  8768. }),
  8769. title.classList.add("expand"),
  8770. this.emit(v.OPEN_INFO)))
  8771. },
  8772. setupToggling: function() {
  8773. b.style.height = w.offsetHeight + "px",
  8774. w.addEventListener("transitionend", function() {
  8775. b.style.height = w.offsetHeight + "px"
  8776. })
  8777. },
  8778. toggleTitle: function(e) {
  8779. e && e.preventDefault(),
  8780. C.classList.contains("closed") ? (C.classList.add("open"),
  8781. E.classList.remove("icon-dpad-right"),
  8782. E.classList.add("icon-dpad-left"),
  8783. this.emit(v.SHOW_INFO),
  8784. setTimeout(function() {
  8785. C.classList.remove("closed"),
  8786. C.classList.remove("open")
  8787. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8788. E.classList.remove("icon-dpad-left"),
  8789. E.classList.add("icon-dpad-right"),
  8790. this.emit(v.HIDE_INFO))
  8791. }
  8792. };
  8793. d.extendObject(N, A.prototype),
  8794. t.exports = N
  8795. }
  8796. ).call(this, "/js/gui/title/titleBar.js")
  8797. }
  8798. , {
  8799. "../../localization/localize": 108,
  8800. "../../settings": 166,
  8801. "../../util/browser": 182,
  8802. "../../util/common": 185,
  8803. "../../util/logger": 189,
  8804. "./TitleEvents": 80,
  8805. "./titleBarSettings": 83,
  8806. events: 202
  8807. }],
  8808. 83: [function(e, t, i) {
  8809. "use strict";
  8810. t.exports = Object.freeze({
  8811. minTooltipCharacters: 19,
  8812. removeAnimationClasses: 500
  8813. })
  8814. }
  8815. , {}],
  8816. 84: [function(e, t, i) {
  8817. "use strict";
  8818. function n(e) {
  8819. C = e,
  8820. P.forEach(function(e) {
  8821. b.addEventListener(e, u.bind(this, !1), !0),
  8822. w.addEventListener(e, u.bind(this, !0), !0),
  8823. E.addEventListener(e, o, !0),
  8824. S.forEach(function(t) {
  8825. t.addEventListener(e, a, !0)
  8826. }),
  8827. $("#drawer img").on(e, a)
  8828. }),
  8829. document.addEventListener("keydown", u.bind(this, !1), !0),
  8830. C.on(v.TourStart, function() {
  8831. E.classList.add("playing")
  8832. })
  8833. }
  8834. function r() {
  8835. C.playTour(),
  8836. I && clearTimeout(I),
  8837. d(),
  8838. _.removeClass("fadeIn")
  8839. }
  8840. function o() {
  8841. E.classList.contains("playing") && (C.stopTour(),
  8842. _.addClass("fadeIn"),
  8843. setTimeout(function() {
  8844. _.removeClass("fadeIn")
  8845. }, p.tourInteraction.showPauseButton),
  8846. O || (clearTimeout(I),
  8847. I = setTimeout(h, p.tourInteraction.showModal)),
  8848. setTimeout(function() {
  8849. E.classList.remove("playing")
  8850. }, p.tourInteraction.allowNextClick))
  8851. }
  8852. function a() {
  8853. C.tourInProgress && (C.stopTour(),
  8854. C.endTourProgress(),
  8855. E.classList.remove("playing"))
  8856. }
  8857. function s() {
  8858. T.is(":visible") ? r() : o()
  8859. }
  8860. function l() {
  8861. x.hasClass("playing") && (clearTimeout(I),
  8862. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8863. }
  8864. function c() {
  8865. E.classList.remove("playing"),
  8866. h()
  8867. }
  8868. function h() {//去掉导览结束时的提示
  8869. /* if (!p.tourInteraction.disabled) {
  8870. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8871. M.addClass("fadeIn tour " + m.deviceType);
  8872. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8873. if (!p.tourInteraction.smallModal) {
  8874. var t;
  8875. 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,
  8876. m.fill(R, A.TOUR_INTERACTION[t]),
  8877. M.addClass(t)
  8878. }
  8879. M.addClass(e)
  8880. } */
  8881. }
  8882. function u(e, t) {
  8883. if (t) {
  8884. var i = "keydown" === t.type
  8885. , n = t.which === f.SPACE || C.tourIsPlaying;
  8886. i && n || e || (O = !0),
  8887. C.atEndOfTour() && d(),
  8888. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8889. d(),
  8890. t.which !== f.SPACE && a()),
  8891. i && n && s()
  8892. }
  8893. }
  8894. function d() {
  8895. M.removeClass("fadeIn")
  8896. }
  8897. var p = (e("../util/browser"),
  8898. e("../settings"))
  8899. , f = e("../enum/Keys")
  8900. , g = e("../enum/Viewmode")
  8901. , m = (e("./helpManager"),
  8902. e("./populateModal"))
  8903. , v = e("../enum/DirectorEvents")
  8904. , A = e("../enum/HelpModalType")
  8905. , y = e("../enum/HelpModalSize")
  8906. , C = null
  8907. , I = null
  8908. , E = document.getElementById("pause-overlay")
  8909. , b = document.getElementById("player")
  8910. , w = document.getElementById("gui")
  8911. , _ = $("#pause-icon").eq(0)
  8912. , T = $("#play").eq(0)
  8913. , x = $("#playHead").eq(0)
  8914. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8915. , M = $("#interaction-modal").eq(0)
  8916. , R = $("#interaction-modal .interaction").toArray()
  8917. , P = ["touchstart", "mousedown", "pointerdown"]
  8918. , O = !1;
  8919. t.exports.init = n,
  8920. t.exports.play = r,
  8921. t.exports.pause = o,
  8922. t.exports.pauseWithoutCTA = a,
  8923. t.exports.togglePlay = s,
  8924. t.exports.stopTour = l,
  8925. t.exports.dismissModal = d
  8926. }
  8927. , {
  8928. "../enum/DirectorEvents": 23,
  8929. "../enum/HelpModalSize": 27,
  8930. "../enum/HelpModalType": 28,
  8931. "../enum/Keys": 30,
  8932. "../enum/Viewmode": 51,
  8933. "../settings": 166,
  8934. "../util/browser": 182,
  8935. "./helpManager": 68,
  8936. "./populateModal": 75
  8937. }],
  8938. 85: [function(e, t, i) {
  8939. "use strict";
  8940. t.exports = Object.freeze({
  8941. OPENED: "vr.modal.opened",
  8942. LAUNCH: "vr.modal.launch",
  8943. CLOSED: "vr.modal.closed",
  8944. NEXT: "vr.modal.next",
  8945. PREV: "vr.modal.prev",
  8946. STORE: "vr.modal.store",
  8947. falseICECHOSEN: "vr.modal.device"
  8948. })
  8949. }
  8950. , {}],
  8951. 86: [function(e, t, i) {
  8952. "use strict";
  8953. function n(e, t, i) {
  8954. function n(e, t, n, r) {
  8955. function o() {
  8956. return p + "&m=" + t + "&display=" + e
  8957. }
  8958. function s() {
  8959. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8960. , t = "&utm_source=" + u
  8961. , n = "&utm_showcase_session_id=" + i;
  8962. return e + t + n
  8963. }
  8964. function l() {
  8965. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8966. }
  8967. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8968. }
  8969. function r(e, t, i, r) {
  8970. var o = "https://api.branch.io/v1/url"
  8971. , a = n(e, t, i, r)
  8972. , s = {
  8973. responseType: "json",
  8974. data: {
  8975. branch_key: h.appConfig.branch_key,
  8976. data: {
  8977. m: t,
  8978. full_url: a,
  8979. $desktop_url: m,
  8980. $og_app_id: "331853976762864119",
  8981. $og_title: i,
  8982. $og_description: r,
  8983. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8984. $canonical_url: window.location.href
  8985. }
  8986. }
  8987. };
  8988. c.post(o, s).done(function(t) {
  8989. f[e] = t.url
  8990. }).fail(function(t) {
  8991. f[e] = t
  8992. }
  8993. .bind(this, a))
  8994. }
  8995. function o(e, t, i) {
  8996. for (var r in s) {
  8997. var o = s[r]
  8998. , a = n(o, e, t, i);
  8999. f[o] = a
  9000. }
  9001. }
  9002. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9003. , d = g + "/vr/dlist/?ret=" + u
  9004. , p = g + "/vr/show/?ret=" + u
  9005. , m = "";
  9006. switch (e) {
  9007. case l.IOS:
  9008. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9009. break;
  9010. default:
  9011. o(t.sid, t.name, t.summary)
  9012. }
  9013. }
  9014. function r(e) {
  9015. var t = f[e];
  9016. window.open(t, "_blank")
  9017. }
  9018. function o(e) {
  9019. var t = u[e];
  9020. window.open(t, "_blank")
  9021. }
  9022. var a = e("../../util/browser")
  9023. , s = e("../../enum/VRApps")
  9024. , l = e("../../enum/VRPlatforms")
  9025. , c = e("../../util/ajax")
  9026. , h = e("../../settings")
  9027. , u = {};
  9028. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9029. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9030. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9031. for (var d in s) {
  9032. var p = s[d];
  9033. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9034. }
  9035. var f = {}
  9036. , g = function() {
  9037. var e = window.location.host;
  9038. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9039. "https://" + e
  9040. }();
  9041. t.exports.init = n,
  9042. t.exports.launch = r,
  9043. t.exports.launchStore = o
  9044. }
  9045. , {
  9046. "../../enum/VRApps": 46,
  9047. "../../enum/VRPlatforms": 49,
  9048. "../../settings": 166,
  9049. "../../util/ajax": 181,
  9050. "../../util/browser": 182
  9051. }],
  9052. 87: [function(e, t, i) {
  9053. "use strict";
  9054. function n(e) {
  9055. var t;
  9056. switch (e) {
  9057. case m.IOS:
  9058. return t = p.iosVersion(),
  9059. t.major > 9 || 9 === t.major && t.minor >= 1;
  9060. case m.Android:
  9061. return t = p.androidVersion(),
  9062. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9063. }
  9064. return !1
  9065. }
  9066. function r(e, t) {
  9067. function i(e) {
  9068. K.emit(A.STORE, {
  9069. type: e
  9070. }),
  9071. f.launchStore(e)
  9072. }
  9073. function r(e) {
  9074. switch (e !== _.pageCount && (a(e),
  9075. N.text(e + 1 + " / " + _.pageCount)),
  9076. e) {
  9077. case _.Title:
  9078. O.css("display", "none"),
  9079. L.text(u[e]),
  9080. o(s);
  9081. break;
  9082. case _.Cardboard:
  9083. O.css("display", "block"),
  9084. L.text(u[e]),
  9085. M.filter(".cardboard").off(),
  9086. M.filter(".gearvr").off(),
  9087. c(e, s),
  9088. h(H, X, Z);
  9089. break;
  9090. case _.Gear:
  9091. L.text(u[e]),
  9092. c(e, s),
  9093. T.addClass("lastPage"),
  9094. h(G, X, Z);
  9095. break;
  9096. case _.pageCount:
  9097. T.removeClass("fadeIn"),
  9098. K.emit(A.CLOSED)
  9099. }
  9100. B.filter("[src='']").hide()
  9101. }
  9102. var s = function() {
  9103. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9104. w = ".show-supported",
  9105. m.Android) : (T.addClass("unsupported"),
  9106. w = ".show-unsupported",
  9107. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9108. w = ".show-ios",
  9109. _ = v.ios,
  9110. m.IOS) : (T.addClass("desktop"),
  9111. w = ".show-desktop",
  9112. m.Desktop)
  9113. }();
  9114. f.init(s, e, t),
  9115. s !== m.Desktop && T.addClass("mobile");
  9116. var l = function(e) {
  9117. K.emit(A.LAUNCH, {
  9118. vr_platform: s,
  9119. vr_app: e
  9120. }),
  9121. f.launch(e)
  9122. };
  9123. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9124. q.gear = l.bind(this, g.GearVR),
  9125. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9126. d(),
  9127. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9128. $(w).show();
  9129. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9130. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9131. s === m.IOS && (u.splice(1, 1),
  9132. y.splice(1, 1)),
  9133. $("#vr").on("click", function(e) {
  9134. e.preventDefault();
  9135. if(!window.vrEnabled) { // 开启VR
  9136. window.vrEnabled = true;
  9137. this.classList.add('active');
  9138. $('#gui div').not('#vrOff').addClass('vrHide');
  9139. $('#vrOffImg').css({'display':'inline-block'});
  9140. }else{
  9141. }
  9142. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  9143. // r(b),
  9144. // T.addClass("fadeIn"),
  9145. // K.emit(A.OPENED))
  9146. });
  9147. $('#vrOff').on('click', function(){
  9148. window.vrEnabled = false;
  9149. $('#gui div').not('#vrOff').removeClass('vrHide');
  9150. $('#vrOffImg').css({'display':'none'});
  9151. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9152. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9153. })
  9154. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9155. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9156. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9157. $("span.modelLink").text(I),
  9158. O.on("click", function(e) {
  9159. K.emit(A.PREV),
  9160. b--,
  9161. r(b)
  9162. }),
  9163. L.on("click", function(e) {
  9164. L.text();
  9165. K.emit(A.NEXT, {
  9166. nextAction: y[b]
  9167. }),
  9168. b++,
  9169. r(b)
  9170. }),
  9171. T.find(".close").on("click", K.dismiss)
  9172. }
  9173. function o(e) {
  9174. switch (e) {
  9175. case m.Android:
  9176. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9177. M.filter(".gearvr").off().on("click", q.gear),
  9178. s(H, G, "logo-button", "same-line");
  9179. break;
  9180. case m.UnsupportedAndroid:
  9181. s("", z, "", "");
  9182. break;
  9183. case m.IOS:
  9184. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9185. s(H, "", "logo-button", "");
  9186. break;
  9187. case m.Desktop:
  9188. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9189. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9190. s(H, G, "logo-button", "same-line"),
  9191. Q.cardboard()
  9192. }
  9193. }
  9194. function a(e) {
  9195. $(".p1, .p2, .p3").hide(),
  9196. x.insertAfter(S),
  9197. T.removeClass("front-page"),
  9198. T.removeClass("details-page"),
  9199. T.removeClass("lastPage"),
  9200. M.removeClass("logo-button"),
  9201. M.removeClass("same-line"),
  9202. S.removeClass("headsetOptions"),
  9203. R.attr("src", ""),
  9204. R.filter(".second").removeClass("gear"),
  9205. R.css("display", "inline-block"),
  9206. R.off(),
  9207. P.filter(".second").css("display", ""),
  9208. D.css("display", "none"),
  9209. $(".p" + (e + 1) + w).show(),
  9210. R.filter(".third").insertBefore(P.filter(".third"))
  9211. }
  9212. function s(e, t, i, n) {
  9213. T.addClass("front-page"),
  9214. R.filter(".first").attr("src", e),
  9215. R.filter(".second").attr("src", t),
  9216. M.filter(".first").addClass(i),
  9217. M.filter(".second").addClass(i),
  9218. M.addClass(n),
  9219. ".show-desktop" === w && S.insertAfter(x)
  9220. }
  9221. function l(e, t, i) {
  9222. S.addClass("headsetOptions"),
  9223. M.off(),
  9224. R.filter(".second").attr("src", t),
  9225. D.css("display", "block"),
  9226. P.filter(".second").css("display", "none"),
  9227. D.on("click", function() {
  9228. a(_.Title),
  9229. o(m.Desktop)
  9230. }),
  9231. e && (K.emit(A.falseICECHOSEN, {
  9232. name: g.GearVR
  9233. }),
  9234. R.filter(".first").attr("src", e),
  9235. R.filter(".second").addClass("gear"),
  9236. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9237. Q.gearvr()),
  9238. i && (K.emit(A.falseICECHOSEN, {
  9239. name: g.Cardboard
  9240. }),
  9241. R.filter(".third").attr("src", i),
  9242. R.filter(".third").show(),
  9243. R.filter(".third").insertAfter(R.filter(".second")),
  9244. R.filter(".third").addClass("link"),
  9245. R.filter(".second").addClass("link"),
  9246. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9247. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9248. Q.cardboard())
  9249. }
  9250. function c(e, t) {
  9251. switch (t) {
  9252. case m.IOS:
  9253. X = Y,
  9254. Z = j;
  9255. break;
  9256. case m.Desktop:
  9257. e === _.Cardboard ? (X = F,
  9258. Z = U,
  9259. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9260. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9261. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9262. Z = "");
  9263. break;
  9264. default:
  9265. e === _.Cardboard ? (X = z,
  9266. Z = j) : (X = k,
  9267. Z = W)
  9268. }
  9269. }
  9270. function h(e, t, i) {
  9271. T.find(".inner").addClass("details-page"),
  9272. T.addClass("details-page"),
  9273. R.filter(".first").attr("src", e),
  9274. R.filter(".second").attr("src", t),
  9275. R.filter(".third").attr("src", i)
  9276. }
  9277. function u() {
  9278. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9279. K.emit(A.CLOSED))
  9280. }
  9281. function d() {
  9282. var e = p.aspectRatio() > 1 && p.isMobile();
  9283. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9284. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9285. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9286. }
  9287. var p = e("../../util/browser")
  9288. , f = e("./vrLink")
  9289. , g = e("../../enum/VRApps")
  9290. , m = e("../../enum/VRPlatforms")
  9291. , v = e("../../enum/VRPages")
  9292. , A = e("./vrEvent")
  9293. , y = (e("../../settings"),
  9294. e("../../constants"))
  9295. , C = e("../../localization/localize")
  9296. , I = e("../../util/common")
  9297. , E = e("events").EventEmitter
  9298. , b = 0
  9299. , w = null
  9300. , _ = v.standard
  9301. , T = $(".vr-popup")
  9302. , x = T.find(".vr-popup-body")
  9303. , S = T.find(".vr-images")
  9304. , M = T.find(".img-container")
  9305. , R = T.find(".vr-sm-image")
  9306. , P = M.find(".vr-img-caption")
  9307. , O = $(".vr-buttons").find(".prev-button")
  9308. , L = $(".vr-buttons").find(".next-button")
  9309. , D = S.find(".front-close")
  9310. , N = $(".vr-page")
  9311. , B = T.find("img")
  9312. , F = "images/apple-store.png"
  9313. , V = "images/badge-oculus.png"
  9314. , U = "images/badge-cardboard.png"
  9315. , k = "images/logo-samsung.png"
  9316. , H = "images/headset-cardboard.png"
  9317. , G = "images/headset-gearvr.png"
  9318. , z = "images/ico-android-robot.png"
  9319. , W = "images/ico-gearvr.png"
  9320. , j = "images/ico-vr.png"
  9321. , Y = "images/apple-logo-white.svg"
  9322. , X = null
  9323. , Z = null
  9324. , q = {}
  9325. , K = {
  9326. init: r,
  9327. dismiss: u,
  9328. isDeviceSupported: n
  9329. };
  9330. I.extendObject(K, E.prototype),
  9331. $(window).resize(d);
  9332. var Q = function() {
  9333. var e = P.filter(".first").find(".cardboard")
  9334. , t = P.filter(".first").find(".gearvr");
  9335. return {
  9336. cardboard: function() {
  9337. t.addClass("hidden"),
  9338. e.removeClass("hidden")
  9339. },
  9340. gearvr: function() {
  9341. e.addClass("hidden"),
  9342. t.removeClass("hidden")
  9343. }
  9344. }
  9345. }();
  9346. t.exports = K
  9347. }
  9348. , {
  9349. "../../constants": 8,
  9350. "../../enum/VRApps": 46,
  9351. "../../enum/VRPages": 48,
  9352. "../../enum/VRPlatforms": 49,
  9353. "../../localization/localize": 108,
  9354. "../../settings": 166,
  9355. "../../util/browser": 182,
  9356. "../../util/common": 185,
  9357. "./vrEvent": 85,
  9358. "./vrLink": 86,
  9359. events: 202
  9360. }],
  9361. 88: [function(e, t, i) {
  9362. "use strict";
  9363. t.exports = Object.freeze({
  9364. OPENED: "webvr.modal.opened",
  9365. SHOW_TERMS: "webvr.footer.show.terms"
  9366. })
  9367. }
  9368. , {}],
  9369. 89: [function(e, t, i) {
  9370. (function(i) {
  9371. "use strict";
  9372. function n(e, t, i, n) {
  9373. function r(e) {
  9374. e.preventDefault(),
  9375. a(e.currentTarget.id)
  9376. }
  9377. function a(e) {
  9378. ne[e](),
  9379. Object.keys(ne).map(function(t, i) {
  9380. $("#" + t).toggleClass("tabs-underlined", t === e)
  9381. })
  9382. }
  9383. y = i,
  9384. v = t,
  9385. w.init(E.Android, e, n),
  9386. m();
  9387. var l = new RegExp("daydream","i")
  9388. , c = l.test(y.displayName);
  9389. c ? (a("tabdaydream"),
  9390. B.filter(".device-headset-side").attr("src", H),
  9391. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9392. B.filter(".device-headset-side").attr("src", Y),
  9393. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9394. $("#vr").on("click", function(e) {
  9395. e.preventDefault(),
  9396. g("click_webvr_button"),
  9397. L.is(":hidden") && (ie.emit(_.OPENED),
  9398. o())
  9399. }),
  9400. $(".webvr-popup .close").on("click", function(e) {
  9401. e.preventDefault(),
  9402. D.hasClass("hidden") ? (g("webvr_help_close"),
  9403. p()) : s()
  9404. }),
  9405. $("#tabcardboard").on("click", r),
  9406. $("#tabdaydream").on("click", r),
  9407. $("#tabnative").on("click", r),
  9408. $(".webvr-popup .open-with-app").on("click", function(e) {
  9409. e.preventDefault(),
  9410. g("webvr_learn_more"),
  9411. a("tabnative"),
  9412. p()
  9413. }),
  9414. $(".webvr-popup .help").on("click", function(e) {
  9415. e.preventDefault(),
  9416. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9417. p()
  9418. }),
  9419. $(".webvr-popup .terms").on("click", function(e) {
  9420. e.preventDefault(),
  9421. g("webvr_click_terms"),
  9422. s(),
  9423. ie.emit(_.SHOW_TERMS)
  9424. }),
  9425. F.on("click", function(e) {
  9426. e.preventDefault(),
  9427. g(ee),
  9428. window.open(J, "_blank")
  9429. }),
  9430. V.on("click", function(e) {
  9431. e.preventDefault(),
  9432. g("webvr_phone_link"),
  9433. window.open(te, "_blank")
  9434. }),
  9435. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9436. e.preventDefault(),
  9437. g("webvr_cardboard_link"),
  9438. w.launch(b.CardboardAndroid)
  9439. }),
  9440. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9441. e.preventDefault(),
  9442. g("webvr_oculus_link"),
  9443. w.launch(b.GearVR)
  9444. })
  9445. }
  9446. function r() {
  9447. function e() {
  9448. y.isPresenting || (f(),
  9449. window.removeEventListener("vrdisplaypresentchange", e))
  9450. }
  9451. R.info("Headset mounted"),
  9452. v.suspend();
  9453. var t = document.createElement("canvas");
  9454. for (t.getContext("webgl"),
  9455. t.className = "webvr-canvas",
  9456. document.bgColor = "#000",
  9457. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9458. document.body.removeChild(document.body.firstChild);
  9459. document.body.appendChild(t),
  9460. g("webvr_enter_app"),
  9461. y.requestPresent([{
  9462. source: t,
  9463. predistorted: !0
  9464. }]).catch(function(t) {
  9465. R.error("Failed to present: " + t),
  9466. g("webvr_exit_calibrate"),
  9467. e()
  9468. }),
  9469. A.then(function() {
  9470. window.dispatchEvent(new Event("vrapp-start"))
  9471. }),
  9472. window.addEventListener("vrdisplaypresentchange", e)
  9473. }
  9474. function o() {
  9475. O.fadeOut(I.guiAnimationSpeed),
  9476. L.fadeIn(I.guiAnimationSpeed),
  9477. a()
  9478. }
  9479. function a() {
  9480. if (!A) {
  9481. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9482. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9483. A = new Promise(function(e, i) {
  9484. var n = document.createElement("script");
  9485. n.type = "text/javascript",
  9486. n.src = t,
  9487. n.onload = e,
  9488. document.head.appendChild(n)
  9489. }
  9490. )
  9491. }
  9492. D.find(".enter-button").on("click", r)
  9493. }
  9494. function s() {
  9495. g("webvr_modal_close"),
  9496. D.find(".enter-button").off("click", r),
  9497. L.fadeOut(I.guiAnimationSpeed, function() {
  9498. D.toggleClass("hidden", !1),
  9499. N.toggleClass("hidden", !0),
  9500. C.exitFullscreen()
  9501. }),
  9502. O.fadeIn(I.guiAnimationSpeed)
  9503. }
  9504. function l() {
  9505. k.toggleClass("hidden", !1),
  9506. U.toggleClass("hidden", !0)
  9507. }
  9508. function c() {
  9509. k.toggleClass("hidden", !0),
  9510. U.toggleClass("hidden", !1)
  9511. }
  9512. function h() {
  9513. B.filter(".device-headset").attr("src", G),
  9514. B.filter(".device-phone").attr("src", z),
  9515. J = Z,
  9516. ee = K,
  9517. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9518. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9519. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9520. c()
  9521. }
  9522. function u() {
  9523. B.filter(".badge-cardboard").attr("src", j),
  9524. B.filter(".badge-oculus").attr("src", X),
  9525. l()
  9526. }
  9527. function d() {
  9528. B.filter(".device-headset").attr("src", Y),
  9529. B.filter(".device-phone").attr("src", W),
  9530. J = q,
  9531. ee = Q,
  9532. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9533. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9534. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9535. c()
  9536. }
  9537. function p() {
  9538. D.toggleClass("hidden"),
  9539. N.toggleClass("hidden")
  9540. }
  9541. function f() {
  9542. R.info("exiting webVR"),
  9543. g("webvr_exit_app"),
  9544. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9545. }
  9546. function g(e) {
  9547. var t = C.isLandscape() ? "landscape" : "portrait";
  9548. T.trackAlways("showcase_gui", {
  9549. gui_action: e,
  9550. orientation: t
  9551. })
  9552. }
  9553. function m() {
  9554. var e = C.isLandscape();
  9555. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9556. }
  9557. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9558. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9559. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9560. init: n
  9561. }, ne = {
  9562. tabcardboard: d,
  9563. tabdaydream: h,
  9564. tabnative: u
  9565. };
  9566. S.extendObject(ie, P.prototype),
  9567. $(window).resize(m),
  9568. t.exports = ie
  9569. }
  9570. ).call(this, "/js/gui/webvr/webVRgui.js")
  9571. }
  9572. , {
  9573. "../../analytics": 4,
  9574. "../../constants": 8,
  9575. "../../enum/VRApps": 46,
  9576. "../../enum/VRPlatforms": 49,
  9577. "../../localization/localize": 108,
  9578. "../../settings": 166,
  9579. "../../util/browser": 182,
  9580. "../../util/common": 185,
  9581. "../../util/logger": 189,
  9582. "./../gui": 65,
  9583. "./../vr/vrLink": 86,
  9584. "./WebVrEvent": 88,
  9585. events: 202
  9586. }],
  9587. 90: [function(e, t, i) {
  9588. "use strict";
  9589. function n(e, t, i, n, o) {
  9590. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9591. this.roomId = o || "",
  9592. this.labelId = e,
  9593. this.position = (new r.Vector3).copy(t),
  9594. this.text = i
  9595. }
  9596. var r = e("three")
  9597. , o = e("../util/browser");
  9598. n.prototype.build = function() {
  9599. var e = window.document.createElement("div");
  9600. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9601. var t = window.document.createElement("div");
  9602. t.setAttribute("class", "gui-floorplan-label-text");
  9603. var i = window.document.createTextNode(this.text);
  9604. t.appendChild(i),
  9605. e.appendChild(t),
  9606. window.document.body.appendChild(e),
  9607. this.labelGui = e,
  9608. this.textBlock = t,
  9609. $(this.labelGui).hide();
  9610. var n = window.getComputedStyle(this.labelGui);
  9611. this.initialTransform = n.transform || n.webkitTransform
  9612. }
  9613. ,
  9614. t.exports = n
  9615. }
  9616. , {
  9617. "../util/browser": 182,
  9618. three: 217
  9619. }],
  9620. 91: [function(e, t, i) {
  9621. "use strict";
  9622. function n() {
  9623. this.player = null,
  9624. this.modelManager = null,
  9625. this.container = null
  9626. }
  9627. var r = e("three")
  9628. , o = (e("../util/common"),
  9629. e("../enum/PlayerEvents"))
  9630. , a = (e("../enum/DirectorEvents"),
  9631. e("../enum/ModelManagerEvents"))
  9632. , s = e("../settings")
  9633. , l = e("../enum/Viewmode")
  9634. , c = (e("../enum/WarpStyle"),
  9635. e("../util/transitions"),
  9636. e("../util/lerp"),
  9637. e("../util/browser"));
  9638. //场景初始化
  9639. n.prototype.init = function(e, t, i) {
  9640. this.player = e,
  9641. this.modelManager = t,
  9642. this.container = i,
  9643. this.updateModel(),
  9644. this.bindEvents()
  9645. }
  9646. ,
  9647. n.prototype.bindEvents = function() {
  9648. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9649. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9650. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9651. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9652. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9653. }
  9654. ,
  9655. n.prototype.updateModel = function() {
  9656. this.model = this.modelManager.getActiveModel()
  9657. }
  9658. ,
  9659. n.prototype.handlePlayerViewChanged = function() {
  9660. this.updateLabelVisibility(),
  9661. this.updateLabelDisplay()
  9662. }
  9663. ,
  9664. n.prototype.getLabelsForFloor = function(e, t) {
  9665. return t = t || [],
  9666. t.length = 0,
  9667. this.model.labels.forEach(function(i) {
  9668. this.labelVisibleForFloor(i, e) && t.push(i)
  9669. }
  9670. .bind(this)),
  9671. t
  9672. }
  9673. ,
  9674. n.prototype.getLabelsForCurrentFloor = function(e) {
  9675. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9676. }
  9677. ,
  9678. n.prototype.labelVisibleForFloor = function(e, t) {
  9679. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9680. if (!this.model.showingLabels || !e.labelGui || !i)
  9681. return !1;
  9682. var n = e.floorId === this.model.floors.size() - 1;
  9683. return this.model.allFloorsVisible ? n : e.floorId === t
  9684. }
  9685. ,
  9686. n.prototype.updateLabelVisibility = function(e) {
  9687. this.model.labels.forEach(function(e) {
  9688. 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)
  9689. }
  9690. .bind(this))
  9691. }
  9692. ,
  9693. n.prototype.showAllLabels = function(e, t) {
  9694. this.model.labels.forEach(function(i) {
  9695. this.showLabel(i, e, t)
  9696. }
  9697. .bind(this))
  9698. }
  9699. ,
  9700. n.prototype.hideAllLabels = function(e, t) {
  9701. this.model.labels.forEach(function(i) {
  9702. this.hideLabel(i, e, t)
  9703. }
  9704. .bind(this))
  9705. }
  9706. ,
  9707. n.prototype.showLabel = function(e, t, i) {
  9708. this.model.showingLabels && (e.visible || (e.visible = !0,
  9709. e.labelGui.style.display = "block",
  9710. e.labelGui.style.opacity = 0,
  9711. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9712. }
  9713. ,
  9714. n.prototype.hideLabel = function(e, t, i) {
  9715. e.visible && (e.visible = !1,
  9716. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9717. }
  9718. ,
  9719. n.prototype.supportedMode = function() {
  9720. return this.player.mode === l.FLOORPLAN
  9721. }
  9722. ,
  9723. n.prototype.updateLabelDisplay = function() {
  9724. var e = (new r.Vector3,
  9725. new r.Vector3,
  9726. []);
  9727. return function() {
  9728. var t = this.player.getLabelScaleFactor()
  9729. , i = .6
  9730. , n = 1.2
  9731. , r = (1 - t) * n + i
  9732. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9733. this.getLabelsForCurrentFloor(e);
  9734. for (var a = 0; a < e.length; a++) {
  9735. var l = e[a];
  9736. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9737. 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)
  9738. }
  9739. }
  9740. }(),
  9741. n.prototype.updateProjectedGuiElement = function() {
  9742. var e = new r.Vector3;
  9743. new r.Vector3;
  9744. return function(t, i, n, r, o) {
  9745. i.style.fontSize = 100 * o + "%";
  9746. var a = $("#player").width()
  9747. , s = $("#player").height()
  9748. , l = .5 * a
  9749. , c = .5 * s;
  9750. e.copy(n),
  9751. e.project(this.player.camera);
  9752. var h = e.x * l + l
  9753. , u = -(e.y * c) + c;
  9754. h -= t.offsetWidth / 2,
  9755. u -= t.offsetHeight / 2,
  9756. t.style.left = h + "px",
  9757. t.style.top = u + "px"
  9758. }
  9759. }(),
  9760. n.prototype.handleStartInside = function(e) {
  9761. this.updateLabelVisibility()
  9762. }
  9763. ,
  9764. n.prototype.handleStartOutside = function() {
  9765. this.updateLabelVisibility()
  9766. }
  9767. ,
  9768. t.exports = n
  9769. }
  9770. , {
  9771. "../enum/DirectorEvents": 23,
  9772. "../enum/ModelManagerEvents": 33,
  9773. "../enum/PlayerEvents": 40,
  9774. "../enum/Viewmode": 51,
  9775. "../enum/WarpStyle": 52,
  9776. "../settings": 166,
  9777. "../util/browser": 182,
  9778. "../util/common": 185,
  9779. "../util/lerp": 188,
  9780. "../util/transitions": 195,
  9781. three: 217
  9782. }],
  9783. 92: [function(e, t, i) {
  9784. "use strict";
  9785. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9786. if (null == this)
  9787. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9788. if ("function" != typeof e)
  9789. throw new TypeError("predicate must be a function");
  9790. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9791. if (t = i[o],
  9792. e.call(r, t, o, i))
  9793. return o;
  9794. return -1
  9795. }
  9796. ),
  9797. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9798. value: function(e) {
  9799. if (null == this)
  9800. throw new TypeError('"this" is null or not defined');
  9801. var t = Object(this)
  9802. , i = t.length >>> 0;
  9803. if ("function" != typeof e)
  9804. throw new TypeError("predicate must be a function");
  9805. for (var n = arguments[1], r = 0; r < i; ) {
  9806. var o = t[r];
  9807. if (e.call(n, o, r, t))
  9808. return o;
  9809. r++
  9810. }
  9811. }
  9812. })
  9813. }
  9814. , {}],
  9815. 93: [function(e, t, i) {
  9816. "use strict";
  9817. var n = n || {};
  9818. t.exports = n,
  9819. n.gui = n.gui || {},
  9820. n.utils = n.utils || {},
  9821. n.controllers = n.controllers || {},
  9822. n.dom = n.dom || {},
  9823. n.color = n.color || {},
  9824. n.utils.css = function() {
  9825. return {
  9826. load: function(e, t) {
  9827. t = t || document;
  9828. var i = t.createElement("link");
  9829. i.type = "text/css",
  9830. i.rel = "stylesheet",
  9831. i.href = e,
  9832. t.getElementsByTagName("head")[0].appendChild(i)
  9833. },
  9834. inject: function(e, t) {
  9835. t = t || document;
  9836. var i = document.createElement("style");
  9837. i.type = "text/css",
  9838. i.innerHTML = e,
  9839. t.getElementsByTagName("head")[0].appendChild(i)
  9840. }
  9841. }
  9842. }(),
  9843. n.utils.common = function() {
  9844. var e = Array.prototype.forEach
  9845. , t = Array.prototype.slice;
  9846. return {
  9847. BREAK: {},
  9848. extend: function(e) {
  9849. return this.each(t.call(arguments, 1), function(t) {
  9850. for (var i in t)
  9851. this.isUndefined(t[i]) || (e[i] = t[i])
  9852. }, this),
  9853. e
  9854. },
  9855. defaults: function(e) {
  9856. return this.each(t.call(arguments, 1), function(t) {
  9857. for (var i in t)
  9858. this.isUndefined(e[i]) && (e[i] = t[i])
  9859. }, this),
  9860. e
  9861. },
  9862. compose: function() {
  9863. var e = t.call(arguments);
  9864. return function() {
  9865. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9866. i = [e[n].apply(this, i)];
  9867. return i[0]
  9868. }
  9869. },
  9870. each: function(t, i, n) {
  9871. if (t)
  9872. if (e && t.forEach && t.forEach === e)
  9873. t.forEach(i, n);
  9874. else if (t.length === t.length + 0) {
  9875. for (var r = 0, o = t.length; r < o; r++)
  9876. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9877. return
  9878. } else
  9879. for (var r in t)
  9880. if (i.call(n, t[r], r) === this.BREAK)
  9881. return
  9882. },
  9883. defer: function(e) {
  9884. setTimeout(e, 0)
  9885. },
  9886. toArray: function(e) {
  9887. return e.toArray ? e.toArray() : t.call(e)
  9888. },
  9889. isUndefined: function(e) {
  9890. return void 0 === e
  9891. },
  9892. isNull: function(e) {
  9893. return null === e
  9894. },
  9895. isNaN: function(e) {
  9896. return e !== e
  9897. },
  9898. isArray: Array.isArray || function(e) {
  9899. return e.constructor === Array
  9900. }
  9901. ,
  9902. isObject: function(e) {
  9903. return e === Object(e)
  9904. },
  9905. isNumber: function(e) {
  9906. return e === e + 0
  9907. },
  9908. isString: function(e) {
  9909. return e === e + ""
  9910. },
  9911. isBoolean: function(e) {
  9912. return e === !1 || e === !0
  9913. },
  9914. isFunction: function(e) {
  9915. return "[object Function]" === Object.prototype.toString.call(e)
  9916. }
  9917. }
  9918. }(),
  9919. n.controllers.Controller = function(e) {
  9920. var t = function(e, t) {
  9921. this.initialValue = e[t],
  9922. this.domElement = document.createElement("div"),
  9923. this.object = e,
  9924. this.property = t,
  9925. this.__onChange = void 0,
  9926. this.__onFinishChange = void 0
  9927. };
  9928. return e.extend(t.prototype, {
  9929. onChange: function(e) {
  9930. return this.__onChange = e,
  9931. this
  9932. },
  9933. onFinishChange: function(e) {
  9934. return this.__onFinishChange = e,
  9935. this
  9936. },
  9937. setValue: function(e) {
  9938. return this.object[this.property] = e,
  9939. this.__onChange && this.__onChange.call(this, e),
  9940. this.updateDisplay(),
  9941. this
  9942. },
  9943. getValue: function() {
  9944. return this.object[this.property]
  9945. },
  9946. updateDisplay: function() {
  9947. return this
  9948. },
  9949. isModified: function() {
  9950. return this.initialValue !== this.getValue()
  9951. }
  9952. }),
  9953. t
  9954. }(n.utils.common),
  9955. n.dom.dom = function(e) {
  9956. function t(t) {
  9957. if ("0" === t || e.isUndefined(t))
  9958. return 0;
  9959. var i = t.match(r);
  9960. return e.isNull(i) ? 0 : parseFloat(i[1])
  9961. }
  9962. var i = {
  9963. HTMLEvents: ["change"],
  9964. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9965. KeyboardEvents: ["keydown"]
  9966. }
  9967. , n = {};
  9968. e.each(i, function(t, i) {
  9969. e.each(t, function(e) {
  9970. n[e] = i
  9971. })
  9972. });
  9973. var r = /(\d+(\.\d+)?)px/
  9974. , o = {
  9975. makeSelectable: function(e, t) {
  9976. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9977. return !1
  9978. }
  9979. : function() {}
  9980. ,
  9981. e.style.MozUserSelect = t ? "auto" : "none",
  9982. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9983. e.unselectable = t ? "on" : "off")
  9984. },
  9985. makeFullscreen: function(t, i, n) {
  9986. e.isUndefined(i) && (i = !0),
  9987. e.isUndefined(n) && (n = !0),
  9988. t.style.position = "absolute",
  9989. i && (t.style.left = 0,
  9990. t.style.right = 0),
  9991. n && (t.style.top = 0,
  9992. t.style.bottom = 0)
  9993. },
  9994. fakeEvent: function(t, i, r, o) {
  9995. r = r || {};
  9996. var a = n[i];
  9997. if (!a)
  9998. throw new Error("Event type " + i + " not supported.");
  9999. var s = document.createEvent(a);
  10000. switch (a) {
  10001. case "MouseEvents":
  10002. var l = r.x || r.clientX || 0
  10003. , c = r.y || r.clientY || 0;
  10004. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10005. break;
  10006. case "KeyboardEvents":
  10007. var h = s.initKeyboardEvent || s.initKeyEvent;
  10008. e.defaults(r, {
  10009. cancelable: !0,
  10010. ctrlKey: !1,
  10011. altKey: !1,
  10012. shiftKey: !1,
  10013. metaKey: !1,
  10014. keyCode: void 0,
  10015. charCode: void 0
  10016. }),
  10017. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10018. break;
  10019. default:
  10020. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10021. }
  10022. e.defaults(s, o),
  10023. t.dispatchEvent(s)
  10024. },
  10025. bind: function(e, t, i, n) {
  10026. return n = n || !1,
  10027. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10028. o
  10029. },
  10030. unbind: function(e, t, i, n) {
  10031. return n = n || !1,
  10032. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10033. o
  10034. },
  10035. addClass: function(e, t) {
  10036. if (void 0 === e.className)
  10037. e.className = t;
  10038. else if (e.className !== t) {
  10039. var i = e.className.split(/ +/);
  10040. i.indexOf(t) == -1 && (i.push(t),
  10041. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10042. }
  10043. return o
  10044. },
  10045. removeClass: function(e, t) {
  10046. if (t)
  10047. if (void 0 === e.className)
  10048. ;
  10049. else if (e.className === t)
  10050. e.removeAttribute("class");
  10051. else {
  10052. var i = e.className.split(/ +/)
  10053. , n = i.indexOf(t);
  10054. n != -1 && (i.splice(n, 1),
  10055. e.className = i.join(" "))
  10056. }
  10057. else
  10058. e.className = void 0;
  10059. return o
  10060. },
  10061. hasClass: function(e, t) {
  10062. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10063. },
  10064. getWidth: function(e) {
  10065. var i = getComputedStyle(e);
  10066. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10067. },
  10068. getHeight: function(e) {
  10069. var i = getComputedStyle(e);
  10070. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10071. },
  10072. getOffset: function(e) {
  10073. var t = {
  10074. left: 0,
  10075. top: 0
  10076. };
  10077. if (e.offsetParent)
  10078. do
  10079. t.left += e.offsetLeft,
  10080. t.top += e.offsetTop;
  10081. while (e = e.offsetParent);return t
  10082. },
  10083. isActive: function(e) {
  10084. return e === document.activeElement && (e.type || e.href)
  10085. }
  10086. };
  10087. return o
  10088. }(n.utils.common),
  10089. n.controllers.OptionController = function(e, t, i) {
  10090. var n = function(e, r, o) {
  10091. n.superclass.call(this, e, r);
  10092. var a = this;
  10093. if (this.__select = document.createElement("select"),
  10094. i.isArray(o)) {
  10095. var s = {};
  10096. i.each(o, function(e) {
  10097. s[e] = e
  10098. }),
  10099. o = s
  10100. }
  10101. i.each(o, function(e, t) {
  10102. var i = document.createElement("option");
  10103. i.innerHTML = t,
  10104. i.setAttribute("value", e),
  10105. a.__select.appendChild(i)
  10106. }),
  10107. this.updateDisplay(),
  10108. t.bind(this.__select, "change", function() {
  10109. var e = this.options[this.selectedIndex].value;
  10110. a.setValue(e)
  10111. }),
  10112. this.domElement.appendChild(this.__select)
  10113. };
  10114. return n.superclass = e,
  10115. i.extend(n.prototype, e.prototype, {
  10116. setValue: function(e) {
  10117. var t = n.superclass.prototype.setValue.call(this, e);
  10118. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10119. t
  10120. },
  10121. updateDisplay: function() {
  10122. return this.__select.value = this.getValue(),
  10123. n.superclass.prototype.updateDisplay.call(this)
  10124. }
  10125. }),
  10126. n
  10127. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10128. n.controllers.NumberController = function(e, t) {
  10129. function i(e) {
  10130. return e = e.toString(),
  10131. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10132. }
  10133. var n = function(e, r, o) {
  10134. n.superclass.call(this, e, r),
  10135. o = o || {},
  10136. this.__min = o.min,
  10137. this.__max = o.max,
  10138. this.__step = o.step,
  10139. 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,
  10140. this.__precision = i(this.__impliedStep)
  10141. };
  10142. return n.superclass = e,
  10143. t.extend(n.prototype, e.prototype, {
  10144. setValue: function(e) {
  10145. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10146. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10147. n.superclass.prototype.setValue.call(this, e)
  10148. },
  10149. min: function(e) {
  10150. return this.__min = e,
  10151. this
  10152. },
  10153. max: function(e) {
  10154. return this.__max = e,
  10155. this
  10156. },
  10157. step: function(e) {
  10158. return this.__step = e,
  10159. this.__impliedStep = e,
  10160. this.__precision = i(e),
  10161. this
  10162. }
  10163. }),
  10164. n
  10165. }(n.controllers.Controller, n.utils.common),
  10166. n.controllers.NumberControllerBox = function(e, t, i) {
  10167. function n(e, t) {
  10168. var i = Math.pow(10, t);
  10169. return Math.round(e * i) / i
  10170. }
  10171. var r = function(e, n, o) {
  10172. function a() {
  10173. var e = parseFloat(d.__input.value);
  10174. i.isNaN(e) || d.setValue(e)
  10175. }
  10176. function s() {
  10177. a(),
  10178. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10179. }
  10180. function l(e) {
  10181. t.bind(window, "mousemove", c),
  10182. t.bind(window, "mouseup", h),
  10183. u = e.clientY
  10184. }
  10185. function c(e) {
  10186. var t = u - e.clientY;
  10187. d.setValue(d.getValue() + t * d.__impliedStep),
  10188. u = e.clientY
  10189. }
  10190. function h() {
  10191. t.unbind(window, "mousemove", c),
  10192. t.unbind(window, "mouseup", h)
  10193. }
  10194. this.__truncationSuspended = !1,
  10195. r.superclass.call(this, e, n, o);
  10196. var u, d = this;
  10197. this.__input = document.createElement("input"),
  10198. this.__input.setAttribute("type", "text"),
  10199. t.bind(this.__input, "change", a),
  10200. t.bind(this.__input, "blur", s),
  10201. t.bind(this.__input, "mousedown", l),
  10202. t.bind(this.__input, "keydown", function(e) {
  10203. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10204. this.blur(),
  10205. d.__truncationSuspended = !1)
  10206. }),
  10207. this.updateDisplay(),
  10208. this.domElement.appendChild(this.__input)
  10209. };
  10210. return r.superclass = e,
  10211. i.extend(r.prototype, e.prototype, {
  10212. updateDisplay: function() {
  10213. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10214. r.superclass.prototype.updateDisplay.call(this)
  10215. }
  10216. }),
  10217. r
  10218. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10219. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10220. function o(e, t, i, n, r) {
  10221. return n + (r - n) * ((e - t) / (i - t))
  10222. }
  10223. var a = function(e, i, n, r, s) {
  10224. function l(e) {
  10225. t.bind(window, "mousemove", c),
  10226. t.bind(window, "mouseup", h),
  10227. c(e)
  10228. }
  10229. function c(e) {
  10230. e.preventDefault();
  10231. var i = t.getOffset(u.__background)
  10232. , n = t.getWidth(u.__background);
  10233. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10234. !1
  10235. }
  10236. function h() {
  10237. t.unbind(window, "mousemove", c),
  10238. t.unbind(window, "mouseup", h),
  10239. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10240. }
  10241. a.superclass.call(this, e, i, {
  10242. min: n,
  10243. max: r,
  10244. step: s
  10245. });
  10246. var u = this;
  10247. this.__background = document.createElement("div"),
  10248. this.__foreground = document.createElement("div"),
  10249. t.bind(this.__background, "mousedown", l),
  10250. t.addClass(this.__background, "slider"),
  10251. t.addClass(this.__foreground, "slider-fg"),
  10252. this.updateDisplay(),
  10253. this.__background.appendChild(this.__foreground),
  10254. this.domElement.appendChild(this.__background)
  10255. };
  10256. return a.superclass = e,
  10257. a.useDefaultStyles = function() {
  10258. i.inject(r)
  10259. }
  10260. ,
  10261. n.extend(a.prototype, e.prototype, {
  10262. updateDisplay: function() {
  10263. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10264. return this.__foreground.style.width = 100 * e + "%",
  10265. a.superclass.prototype.updateDisplay.call(this)
  10266. }
  10267. }),
  10268. a
  10269. }(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}"),
  10270. n.controllers.FunctionController = function(e, t, i) {
  10271. var n = function(e, i, r) {
  10272. n.superclass.call(this, e, i);
  10273. var o = this;
  10274. this.__button = document.createElement("div"),
  10275. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10276. t.bind(this.__button, "click", function(e) {
  10277. return e.preventDefault(),
  10278. o.fire(),
  10279. !1
  10280. }),
  10281. t.addClass(this.__button, "button"),
  10282. this.domElement.appendChild(this.__button)
  10283. };
  10284. return n.superclass = e,
  10285. i.extend(n.prototype, e.prototype, {
  10286. fire: function() {
  10287. this.__onChange && this.__onChange.call(this),
  10288. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10289. this.getValue().call(this.object)
  10290. }
  10291. }),
  10292. n
  10293. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10294. n.controllers.BooleanController = function(e, t, i) {
  10295. var n = function(e, i) {
  10296. function r() {
  10297. o.setValue(!o.__prev)
  10298. }
  10299. n.superclass.call(this, e, i);
  10300. var o = this;
  10301. this.__prev = this.getValue(),
  10302. this.__checkbox = document.createElement("input"),
  10303. this.__checkbox.setAttribute("type", "checkbox"),
  10304. t.bind(this.__checkbox, "change", r, !1),
  10305. this.domElement.appendChild(this.__checkbox),
  10306. this.updateDisplay()
  10307. };
  10308. return n.superclass = e,
  10309. i.extend(n.prototype, e.prototype, {
  10310. setValue: function(e) {
  10311. var t = n.superclass.prototype.setValue.call(this, e);
  10312. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10313. this.__prev = this.getValue(),
  10314. t
  10315. },
  10316. updateDisplay: function() {
  10317. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10318. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10319. n.superclass.prototype.updateDisplay.call(this)
  10320. }
  10321. }),
  10322. n
  10323. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10324. n.color.toString = function(e) {
  10325. return function(t) {
  10326. if (1 == t.a || e.isUndefined(t.a)) {
  10327. for (var i = t.hex.toString(16); i.length < 6; )
  10328. i = "0" + i;
  10329. return "#" + i
  10330. }
  10331. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10332. }
  10333. }(n.utils.common),
  10334. n.color.interpret = function(e, t) {
  10335. var i, n, r = function() {
  10336. n = !1;
  10337. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10338. return t.each(o, function(r) {
  10339. if (r.litmus(e))
  10340. return t.each(r.conversions, function(r, o) {
  10341. if (i = r.read(e),
  10342. n === !1 && i !== !1)
  10343. return n = i,
  10344. i.conversionName = o,
  10345. i.conversion = r,
  10346. t.BREAK
  10347. }),
  10348. t.BREAK
  10349. }),
  10350. n
  10351. }, o = [{
  10352. litmus: t.isString,
  10353. conversions: {
  10354. THREE_CHAR_HEX: {
  10355. read: function(e) {
  10356. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10357. return null !== t && {
  10358. space: "HEX",
  10359. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10360. }
  10361. },
  10362. write: e
  10363. },
  10364. SIX_CHAR_HEX: {
  10365. read: function(e) {
  10366. var t = e.match(/^#([A-F0-9]{6})$/i);
  10367. return null !== t && {
  10368. space: "HEX",
  10369. hex: parseInt("0x" + t[1].toString())
  10370. }
  10371. },
  10372. write: e
  10373. },
  10374. CSS_RGB: {
  10375. read: function(e) {
  10376. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10377. return null !== t && {
  10378. space: "RGB",
  10379. r: parseFloat(t[1]),
  10380. g: parseFloat(t[2]),
  10381. b: parseFloat(t[3])
  10382. }
  10383. },
  10384. write: e
  10385. },
  10386. CSS_RGBA: {
  10387. read: function(e) {
  10388. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10389. return null !== t && {
  10390. space: "RGB",
  10391. r: parseFloat(t[1]),
  10392. g: parseFloat(t[2]),
  10393. b: parseFloat(t[3]),
  10394. a: parseFloat(t[4])
  10395. }
  10396. },
  10397. write: e
  10398. }
  10399. }
  10400. }, {
  10401. litmus: t.isNumber,
  10402. conversions: {
  10403. HEX: {
  10404. read: function(e) {
  10405. return {
  10406. space: "HEX",
  10407. hex: e,
  10408. conversionName: "HEX"
  10409. }
  10410. },
  10411. write: function(e) {
  10412. return e.hex
  10413. }
  10414. }
  10415. }
  10416. }, {
  10417. litmus: t.isArray,
  10418. conversions: {
  10419. RGB_ARRAY: {
  10420. read: function(e) {
  10421. return 3 == e.length && {
  10422. space: "RGB",
  10423. r: e[0],
  10424. g: e[1],
  10425. b: e[2]
  10426. }
  10427. },
  10428. write: function(e) {
  10429. return [e.r, e.g, e.b]
  10430. }
  10431. },
  10432. RGBA_ARRAY: {
  10433. read: function(e) {
  10434. return 4 == e.length && {
  10435. space: "RGB",
  10436. r: e[0],
  10437. g: e[1],
  10438. b: e[2],
  10439. a: e[3]
  10440. }
  10441. },
  10442. write: function(e) {
  10443. return [e.r, e.g, e.b, e.a]
  10444. }
  10445. }
  10446. }
  10447. }, {
  10448. litmus: t.isObject,
  10449. conversions: {
  10450. RGBA_OBJ: {
  10451. read: function(e) {
  10452. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10453. space: "RGB",
  10454. r: e.r,
  10455. g: e.g,
  10456. b: e.b,
  10457. a: e.a
  10458. }
  10459. },
  10460. write: function(e) {
  10461. return {
  10462. r: e.r,
  10463. g: e.g,
  10464. b: e.b,
  10465. a: e.a
  10466. }
  10467. }
  10468. },
  10469. RGB_OBJ: {
  10470. read: function(e) {
  10471. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10472. space: "RGB",
  10473. r: e.r,
  10474. g: e.g,
  10475. b: e.b
  10476. }
  10477. },
  10478. write: function(e) {
  10479. return {
  10480. r: e.r,
  10481. g: e.g,
  10482. b: e.b
  10483. }
  10484. }
  10485. },
  10486. HSVA_OBJ: {
  10487. read: function(e) {
  10488. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10489. space: "HSV",
  10490. h: e.h,
  10491. s: e.s,
  10492. v: e.v,
  10493. a: e.a
  10494. }
  10495. },
  10496. write: function(e) {
  10497. return {
  10498. h: e.h,
  10499. s: e.s,
  10500. v: e.v,
  10501. a: e.a
  10502. }
  10503. }
  10504. },
  10505. HSV_OBJ: {
  10506. read: function(e) {
  10507. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10508. space: "HSV",
  10509. h: e.h,
  10510. s: e.s,
  10511. v: e.v
  10512. }
  10513. },
  10514. write: function(e) {
  10515. return {
  10516. h: e.h,
  10517. s: e.s,
  10518. v: e.v
  10519. }
  10520. }
  10521. }
  10522. }
  10523. }];
  10524. return r
  10525. }(n.color.toString, n.utils.common),
  10526. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10527. function g(e, t, i, o) {
  10528. if (void 0 === t[i])
  10529. throw new Error("Object " + t + ' has no property "' + i + '"');
  10530. var a;
  10531. if (o.color)
  10532. a = new h(t,i);
  10533. else {
  10534. var s = [t, i].concat(o.factoryArgs);
  10535. a = n.apply(e, s)
  10536. }
  10537. o.before instanceof r && (o.before = o.before.__li),
  10538. A(e, a),
  10539. p.addClass(a.domElement, "c");
  10540. var l = document.createElement("span");
  10541. p.addClass(l, "property-name"),
  10542. l.innerHTML = a.property;
  10543. var c = document.createElement("div");
  10544. c.appendChild(l),
  10545. c.appendChild(a.domElement);
  10546. var u = m(e, c, o.before);
  10547. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10548. p.addClass(u, typeof a.getValue()),
  10549. v(e, u, a),
  10550. e.__controllers.push(a),
  10551. a
  10552. }
  10553. function m(e, t, i) {
  10554. var n = document.createElement("li");
  10555. return t && n.appendChild(t),
  10556. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10557. e.onResize(),
  10558. n
  10559. }
  10560. function v(e, t, i) {
  10561. if (i.__li = t,
  10562. i.__gui = e,
  10563. f.extend(i, {
  10564. options: function(t) {
  10565. return arguments.length > 1 ? (i.remove(),
  10566. g(e, i.object, i.property, {
  10567. before: i.__li.nextElementSibling,
  10568. factoryArgs: [f.toArray(arguments)]
  10569. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10570. g(e, i.object, i.property, {
  10571. before: i.__li.nextElementSibling,
  10572. factoryArgs: [t]
  10573. })) : void 0
  10574. },
  10575. name: function(e) {
  10576. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10577. i
  10578. },
  10579. listen: function() {
  10580. return i.__gui.listen(i),
  10581. i
  10582. },
  10583. remove: function() {
  10584. return i.__gui.remove(i),
  10585. i
  10586. }
  10587. }),
  10588. i instanceof l) {
  10589. var n = new s(i.object,i.property,{
  10590. min: i.__min,
  10591. max: i.__max,
  10592. step: i.__step
  10593. });
  10594. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10595. var t = i[e]
  10596. , r = n[e];
  10597. i[e] = n[e] = function() {
  10598. var e = Array.prototype.slice.call(arguments);
  10599. return t.apply(i, e),
  10600. r.apply(n, e)
  10601. }
  10602. }),
  10603. p.addClass(t, "has-slider"),
  10604. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10605. } else if (i instanceof s) {
  10606. var r = function(t) {
  10607. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10608. g(e, i.object, i.property, {
  10609. before: i.__li.nextElementSibling,
  10610. factoryArgs: [i.__min, i.__max, i.__step]
  10611. })) : t
  10612. };
  10613. i.min = f.compose(r, i.min),
  10614. i.max = f.compose(r, i.max)
  10615. } else
  10616. i instanceof o ? (p.bind(t, "click", function() {
  10617. p.fakeEvent(i.__checkbox, "click")
  10618. }),
  10619. p.bind(i.__checkbox, "click", function(e) {
  10620. e.stopPropagation()
  10621. })) : i instanceof a ? (p.bind(t, "click", function() {
  10622. p.fakeEvent(i.__button, "click")
  10623. }),
  10624. p.bind(t, "mouseover", function() {
  10625. p.addClass(i.__button, "hover")
  10626. }),
  10627. p.bind(t, "mouseout", function() {
  10628. p.removeClass(i.__button, "hover")
  10629. })) : i instanceof h && (p.addClass(t, "color"),
  10630. i.updateDisplay = f.compose(function(e) {
  10631. return t.style.borderLeftColor = i.__color.toString(),
  10632. e
  10633. }, i.updateDisplay),
  10634. i.updateDisplay());
  10635. i.setValue = f.compose(function(t) {
  10636. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10637. t
  10638. }, i.setValue)
  10639. }
  10640. function A(e, t) {
  10641. var i = e.getRoot()
  10642. , n = i.__rememberedObjects.indexOf(t.object);
  10643. if (n != -1) {
  10644. var r = i.__rememberedObjectIndecesToControllers[n];
  10645. if (void 0 === r && (r = {},
  10646. i.__rememberedObjectIndecesToControllers[n] = r),
  10647. r[t.property] = t,
  10648. i.load && i.load.remembered) {
  10649. var o, a = i.load.remembered;
  10650. if (a[e.preset])
  10651. o = a[e.preset];
  10652. else {
  10653. if (!a[L])
  10654. return;
  10655. o = a[L]
  10656. }
  10657. if (o[n] && void 0 !== o[n][t.property]) {
  10658. var s = o[n][t.property];
  10659. t.initialValue = s,
  10660. t.setValue(s)
  10661. }
  10662. }
  10663. }
  10664. }
  10665. function y(e, t) {
  10666. return document.location.href + "." + t
  10667. }
  10668. function C(e) {
  10669. var t = e.__save_row = document.createElement("li");
  10670. p.addClass(e.domElement, "has-save"),
  10671. e.__ul.insertBefore(t, e.__ul.firstChild),
  10672. p.addClass(t, "save-row");
  10673. var i = document.createElement("span");
  10674. i.innerHTML = "&nbsp;",
  10675. p.addClass(i, "button gears");
  10676. var n = document.createElement("span");
  10677. n.innerHTML = "Save",
  10678. p.addClass(n, "button"),
  10679. p.addClass(n, "save");
  10680. var r = document.createElement("span");
  10681. r.innerHTML = "New",
  10682. p.addClass(r, "button"),
  10683. p.addClass(r, "save-as");
  10684. var o = document.createElement("span");
  10685. o.innerHTML = "Revert",
  10686. p.addClass(o, "button"),
  10687. p.addClass(o, "revert");
  10688. var a = e.__preset_select = document.createElement("select");
  10689. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10690. w(e, i, i == e.preset)
  10691. }) : w(e, L, !1),
  10692. p.bind(a, "change", function() {
  10693. for (var t = 0; t < e.__preset_select.length; t++)
  10694. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10695. e.preset = this.value
  10696. }),
  10697. t.appendChild(a),
  10698. t.appendChild(i),
  10699. t.appendChild(n),
  10700. t.appendChild(r),
  10701. t.appendChild(o),
  10702. D) {
  10703. var s = document.getElementById("dg-save-locally")
  10704. , l = document.getElementById("dg-local-explain");
  10705. s.style.display = "block";
  10706. var c = document.getElementById("dg-local-storage");
  10707. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10708. var h = function() {
  10709. l.style.display = e.useLocalStorage ? "block" : "none"
  10710. };
  10711. h(),
  10712. p.bind(c, "change", function() {
  10713. e.useLocalStorage = !e.useLocalStorage,
  10714. h()
  10715. })
  10716. }
  10717. var u = document.getElementById("dg-new-constructor");
  10718. p.bind(u, "keydown", function(e) {
  10719. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10720. }),
  10721. p.bind(i, "click", function() {
  10722. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10723. S.show(),
  10724. u.focus(),
  10725. u.select()
  10726. }),
  10727. p.bind(n, "click", function() {
  10728. e.save()
  10729. }),
  10730. p.bind(r, "click", function() {
  10731. var t = prompt("Enter a new preset name.");
  10732. t && e.saveAs(t)
  10733. }),
  10734. p.bind(o, "click", function() {
  10735. e.revert()
  10736. })
  10737. }
  10738. function I(e) {
  10739. function t(t) {
  10740. return t.preventDefault(),
  10741. r = t.clientX,
  10742. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10743. p.bind(window, "mousemove", i),
  10744. p.bind(window, "mouseup", n),
  10745. !1
  10746. }
  10747. function i(t) {
  10748. return t.preventDefault(),
  10749. e.width += r - t.clientX,
  10750. e.onResize(),
  10751. r = t.clientX,
  10752. !1
  10753. }
  10754. function n() {
  10755. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10756. p.unbind(window, "mousemove", i),
  10757. p.unbind(window, "mouseup", n)
  10758. }
  10759. e.__resize_handle = document.createElement("div"),
  10760. f.extend(e.__resize_handle.style, {
  10761. width: "6px",
  10762. marginLeft: "-3px",
  10763. height: "200px",
  10764. cursor: "ew-resize",
  10765. position: "absolute"
  10766. });
  10767. var r;
  10768. p.bind(e.__resize_handle, "mousedown", t),
  10769. p.bind(e.__closeButton, "mousedown", t),
  10770. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10771. }
  10772. function E(e, t) {
  10773. e.domElement.style.width = t + "px",
  10774. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10775. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10776. }
  10777. function b(e, t) {
  10778. var i = {};
  10779. return f.each(e.__rememberedObjects, function(n, r) {
  10780. var o = {}
  10781. , a = e.__rememberedObjectIndecesToControllers[r];
  10782. f.each(a, function(e, i) {
  10783. o[i] = t ? e.initialValue : e.getValue()
  10784. }),
  10785. i[r] = o
  10786. }),
  10787. i
  10788. }
  10789. function w(e, t, i) {
  10790. var n = document.createElement("option");
  10791. n.innerHTML = t,
  10792. n.value = t,
  10793. e.__preset_select.appendChild(n),
  10794. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10795. }
  10796. function _(e) {
  10797. for (var t = 0; t < e.__preset_select.length; t++)
  10798. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10799. }
  10800. function T(e, t) {
  10801. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10802. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10803. }
  10804. function x(e) {
  10805. 0 != e.length && u(function() {
  10806. x(e)
  10807. }),
  10808. f.each(e, function(e) {
  10809. e.updateDisplay()
  10810. })
  10811. }
  10812. e.inject(i);
  10813. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10814. try {
  10815. return "localStorage"in window && null !== window.localStorage
  10816. } catch (e) {
  10817. return !1
  10818. }
  10819. }(), N = !0, B = !1, F = [], V = function(e) {
  10820. function t() {
  10821. var e = i.getRoot();
  10822. e.width += 1,
  10823. f.defer(function() {
  10824. e.width -= 1
  10825. })
  10826. }
  10827. var i = this;
  10828. this.domElement = document.createElement("div"),
  10829. this.__ul = document.createElement("ul"),
  10830. this.domElement.appendChild(this.__ul),
  10831. p.addClass(this.domElement, R),
  10832. this.__folders = {},
  10833. this.__controllers = [],
  10834. this.__rememberedObjects = [],
  10835. this.__rememberedObjectIndecesToControllers = [],
  10836. this.__listening = [],
  10837. e = e || {},
  10838. e = f.defaults(e, {
  10839. autoPlace: !0,
  10840. width: V.DEFAULT_WIDTH
  10841. }),
  10842. e = f.defaults(e, {
  10843. resizable: e.autoPlace,
  10844. hideable: e.autoPlace
  10845. }),
  10846. f.isUndefined(e.load) ? e.load = {
  10847. preset: L
  10848. } : e.preset && (e.load.preset = e.preset),
  10849. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10850. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10851. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10852. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10853. if (Object.defineProperties(this, {
  10854. parent: {
  10855. get: function() {
  10856. return e.parent
  10857. }
  10858. },
  10859. scrollable: {
  10860. get: function() {
  10861. return e.scrollable
  10862. }
  10863. },
  10864. autoPlace: {
  10865. get: function() {
  10866. return e.autoPlace
  10867. }
  10868. },
  10869. preset: {
  10870. get: function() {
  10871. return i.parent ? i.getRoot().preset : e.load.preset
  10872. },
  10873. set: function(t) {
  10874. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10875. _(this),
  10876. i.revert()
  10877. }
  10878. },
  10879. width: {
  10880. get: function() {
  10881. return e.width
  10882. },
  10883. set: function(t) {
  10884. e.width = t,
  10885. E(i, t)
  10886. }
  10887. },
  10888. name: {
  10889. get: function() {
  10890. return e.name
  10891. },
  10892. set: function(t) {
  10893. e.name = t,
  10894. a && (a.innerHTML = e.name)
  10895. }
  10896. },
  10897. closed: {
  10898. get: function() {
  10899. return e.closed
  10900. },
  10901. set: function(t) {
  10902. e.closed = t,
  10903. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10904. this.onResize(),
  10905. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10906. }
  10907. },
  10908. load: {
  10909. get: function() {
  10910. return e.load
  10911. }
  10912. },
  10913. useLocalStorage: {
  10914. get: function() {
  10915. return r
  10916. },
  10917. set: function(e) {
  10918. D && (r = e,
  10919. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10920. localStorage.setItem(y(i, "isLocal"), e))
  10921. }
  10922. }
  10923. }),
  10924. f.isUndefined(e.parent)) {
  10925. if (e.closed = !1,
  10926. p.addClass(this.domElement, V.CLASS_MAIN),
  10927. p.makeSelectable(this.domElement, !1),
  10928. D && r) {
  10929. i.useLocalStorage = !0;
  10930. var o = localStorage.getItem(y(this, "gui"));
  10931. o && (e.load = JSON.parse(o))
  10932. }
  10933. this.__closeButton = document.createElement("div"),
  10934. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10935. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10936. this.domElement.appendChild(this.__closeButton),
  10937. p.bind(this.__closeButton, "click", function() {
  10938. i.closed = !i.closed
  10939. })
  10940. } else {
  10941. void 0 === e.closed && (e.closed = !0);
  10942. var a = document.createTextNode(e.name);
  10943. p.addClass(a, "controller-name");
  10944. var s = m(i, a)
  10945. , l = function(e) {
  10946. return e.preventDefault(),
  10947. i.closed = !i.closed,
  10948. !1
  10949. };
  10950. p.addClass(this.__ul, V.CLASS_CLOSED),
  10951. p.addClass(s, "title"),
  10952. p.bind(s, "click", l),
  10953. e.closed || (this.closed = !1)
  10954. }
  10955. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10956. p.addClass(M, R),
  10957. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10958. document.body.appendChild(M),
  10959. N = !1),
  10960. M.appendChild(this.domElement),
  10961. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10962. this.parent || E(i, e.width)),
  10963. p.bind(window, "resize", function() {
  10964. i.onResize()
  10965. }),
  10966. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10967. i.onResize()
  10968. }),
  10969. p.bind(this.__ul, "transitionend", function() {
  10970. i.onResize()
  10971. }),
  10972. p.bind(this.__ul, "oTransitionEnd", function() {
  10973. i.onResize()
  10974. }),
  10975. this.onResize(),
  10976. e.resizable && I(this),
  10977. n = function() {
  10978. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10979. }
  10980. ,
  10981. this.saveToLocalStorageIfPossible = n;
  10982. i.getRoot();
  10983. e.parent || t()
  10984. };
  10985. return V.toggleHide = function() {
  10986. B = !B,
  10987. f.each(F, function(e) {
  10988. e.domElement.style.zIndex = B ? -999 : 999,
  10989. e.domElement.style.opacity = B ? 0 : 1
  10990. })
  10991. }
  10992. ,
  10993. V.CLASS_AUTO_PLACE = "a",
  10994. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10995. V.CLASS_MAIN = "main",
  10996. V.CLASS_CONTROLLER_ROW = "cr",
  10997. V.CLASS_TOO_TALL = "taller-than-window",
  10998. V.CLASS_CLOSED = "closed",
  10999. V.CLASS_CLOSE_BUTTON = "close-button",
  11000. V.CLASS_DRAG = "drag",
  11001. V.DEFAULT_WIDTH = 245,
  11002. V.TEXT_CLOSED = "Close Controls",
  11003. V.TEXT_OPEN = "Open Controls",
  11004. p.bind(window, "keydown", function(e) {
  11005. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11006. }, !1),
  11007. f.extend(V.prototype, {
  11008. add: function(e, t) {
  11009. return g(this, e, t, {
  11010. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11011. })
  11012. },
  11013. addColor: function(e, t) {
  11014. return g(this, e, t, {
  11015. color: !0
  11016. })
  11017. },
  11018. remove: function(e) {
  11019. this.__ul.removeChild(e.__li),
  11020. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11021. var t = this;
  11022. f.defer(function() {
  11023. t.onResize()
  11024. })
  11025. },
  11026. destroy: function() {
  11027. this.autoPlace && M.removeChild(this.domElement)
  11028. },
  11029. addFolder: function(e) {
  11030. if (void 0 !== this.__folders[e])
  11031. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11032. var t = {
  11033. name: e,
  11034. parent: this
  11035. };
  11036. t.autoPlace = this.autoPlace,
  11037. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11038. t.load = this.load.folders[e]);
  11039. var i = new V(t);
  11040. this.__folders[e] = i;
  11041. var n = m(this, i.domElement);
  11042. return p.addClass(n, "folder"),
  11043. i
  11044. },
  11045. open: function() {
  11046. this.closed = !1
  11047. },
  11048. close: function() {
  11049. this.closed = !0
  11050. },
  11051. onResize: function() {
  11052. var e = this.getRoot();
  11053. if (e.scrollable) {
  11054. var t = p.getOffset(e.__ul).top
  11055. , i = 0;
  11056. f.each(e.__ul.childNodes, function(t) {
  11057. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11058. }),
  11059. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11060. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11061. e.__ul.style.height = "auto")
  11062. }
  11063. e.__resize_handle && f.defer(function() {
  11064. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11065. }),
  11066. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11067. },
  11068. remember: function() {
  11069. if (f.isUndefined(S) && (S = new d,
  11070. S.domElement.innerHTML = t),
  11071. this.parent)
  11072. throw new Error("You can only call remember on a top level GUI.");
  11073. var e = this;
  11074. f.each(Array.prototype.slice.call(arguments), function(t) {
  11075. 0 == e.__rememberedObjects.length && C(e),
  11076. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11077. }),
  11078. this.autoPlace && E(this, this.width)
  11079. },
  11080. getRoot: function() {
  11081. for (var e = this; e.parent; )
  11082. e = e.parent;
  11083. return e
  11084. },
  11085. getSaveObject: function() {
  11086. var e = this.load;
  11087. return e.closed = this.closed,
  11088. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11089. e.remembered || (e.remembered = {}),
  11090. e.remembered[this.preset] = b(this)),
  11091. e.folders = {},
  11092. f.each(this.__folders, function(t, i) {
  11093. e.folders[i] = t.getSaveObject()
  11094. }),
  11095. e
  11096. },
  11097. save: function() {
  11098. this.load.remembered || (this.load.remembered = {}),
  11099. this.load.remembered[this.preset] = b(this),
  11100. T(this, !1),
  11101. this.saveToLocalStorageIfPossible()
  11102. },
  11103. saveAs: function(e) {
  11104. this.load.remembered || (this.load.remembered = {},
  11105. this.load.remembered[L] = b(this, !0)),
  11106. this.load.remembered[e] = b(this),
  11107. this.preset = e,
  11108. w(this, e, !0),
  11109. this.saveToLocalStorageIfPossible()
  11110. },
  11111. revert: function(e) {
  11112. f.each(this.__controllers, function(t) {
  11113. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11114. }, this),
  11115. f.each(this.__folders, function(e) {
  11116. e.revert(e)
  11117. }),
  11118. e || T(this.getRoot(), !1)
  11119. },
  11120. listen: function(e) {
  11121. var t = 0 == this.__listening.length;
  11122. this.__listening.push(e),
  11123. t && x(this.__listening)
  11124. }
  11125. }),
  11126. V
  11127. }(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) {
  11128. return function(s, l) {
  11129. var c = s[l];
  11130. 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,{
  11131. min: arguments[2],
  11132. max: arguments[3]
  11133. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11134. }
  11135. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11136. var n = function(e, i) {
  11137. function r() {
  11138. a.setValue(a.__input.value)
  11139. }
  11140. function o() {
  11141. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11142. }
  11143. n.superclass.call(this, e, i);
  11144. var a = this;
  11145. this.__input = document.createElement("input"),
  11146. this.__input.setAttribute("type", "text"),
  11147. t.bind(this.__input, "keyup", r),
  11148. t.bind(this.__input, "change", r),
  11149. t.bind(this.__input, "blur", o),
  11150. t.bind(this.__input, "keydown", function(e) {
  11151. 13 === e.keyCode && this.blur()
  11152. }),
  11153. this.updateDisplay(),
  11154. this.domElement.appendChild(this.__input)
  11155. };
  11156. return n.superclass = e,
  11157. i.extend(n.prototype, e.prototype, {
  11158. updateDisplay: function() {
  11159. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11160. n.superclass.prototype.updateDisplay.call(this)
  11161. }
  11162. }),
  11163. n
  11164. }(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) {
  11165. function o(e, t, i, n) {
  11166. e.style.background = "",
  11167. r.each(l, function(r) {
  11168. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11169. })
  11170. }
  11171. function a(e) {
  11172. e.style.background = "",
  11173. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11174. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11175. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11176. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11177. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11178. }
  11179. var s = function(e, l) {
  11180. function c(e) {
  11181. p(e),
  11182. t.bind(window, "mousemove", p),
  11183. t.bind(window, "mouseup", h)
  11184. }
  11185. function h() {
  11186. t.unbind(window, "mousemove", p),
  11187. t.unbind(window, "mouseup", h)
  11188. }
  11189. function u() {
  11190. var e = n(this.value);
  11191. e !== !1 ? (g.__color.__state = e,
  11192. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11193. }
  11194. function d() {
  11195. t.unbind(window, "mousemove", f),
  11196. t.unbind(window, "mouseup", d)
  11197. }
  11198. function p(e) {
  11199. e.preventDefault();
  11200. var i = t.getWidth(g.__saturation_field)
  11201. , n = t.getOffset(g.__saturation_field)
  11202. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11203. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11204. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11205. r > 1 ? r = 1 : r < 0 && (r = 0),
  11206. g.__color.v = o,
  11207. g.__color.s = r,
  11208. g.setValue(g.__color.toOriginal()),
  11209. !1
  11210. }
  11211. function f(e) {
  11212. e.preventDefault();
  11213. var i = t.getHeight(g.__hue_field)
  11214. , n = t.getOffset(g.__hue_field)
  11215. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11216. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11217. g.__color.h = 360 * r,
  11218. g.setValue(g.__color.toOriginal()),
  11219. !1
  11220. }
  11221. s.superclass.call(this, e, l),
  11222. this.__color = new i(this.getValue()),
  11223. this.__temp = new i(0);
  11224. var g = this;
  11225. this.domElement = document.createElement("div"),
  11226. t.makeSelectable(this.domElement, !1),
  11227. this.__selector = document.createElement("div"),
  11228. this.__selector.className = "selector",
  11229. this.__saturation_field = document.createElement("div"),
  11230. this.__saturation_field.className = "saturation-field",
  11231. this.__field_knob = document.createElement("div"),
  11232. this.__field_knob.className = "field-knob",
  11233. this.__field_knob_border = "2px solid ",
  11234. this.__hue_knob = document.createElement("div"),
  11235. this.__hue_knob.className = "hue-knob",
  11236. this.__hue_field = document.createElement("div"),
  11237. this.__hue_field.className = "hue-field",
  11238. this.__input = document.createElement("input"),
  11239. this.__input.type = "text",
  11240. this.__input_textShadow = "0 1px 1px ",
  11241. t.bind(this.__input, "keydown", function(e) {
  11242. 13 === e.keyCode && u.call(this)
  11243. }),
  11244. t.bind(this.__input, "blur", u),
  11245. t.bind(this.__selector, "mousedown", function(e) {
  11246. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11247. t.removeClass(g.__selector, "drag")
  11248. })
  11249. });
  11250. var m = document.createElement("div");
  11251. r.extend(this.__selector.style, {
  11252. width: "122px",
  11253. height: "102px",
  11254. padding: "3px",
  11255. backgroundColor: "#222",
  11256. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11257. }),
  11258. r.extend(this.__field_knob.style, {
  11259. position: "absolute",
  11260. width: "12px",
  11261. height: "12px",
  11262. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11263. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11264. borderRadius: "12px",
  11265. zIndex: 1
  11266. }),
  11267. r.extend(this.__hue_knob.style, {
  11268. position: "absolute",
  11269. width: "15px",
  11270. height: "2px",
  11271. borderRight: "4px solid #fff",
  11272. zIndex: 1
  11273. }),
  11274. r.extend(this.__saturation_field.style, {
  11275. width: "100px",
  11276. height: "100px",
  11277. border: "1px solid #555",
  11278. marginRight: "3px",
  11279. display: "inline-block",
  11280. cursor: "pointer"
  11281. }),
  11282. r.extend(m.style, {
  11283. width: "100%",
  11284. height: "100%",
  11285. background: "none"
  11286. }),
  11287. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11288. r.extend(this.__hue_field.style, {
  11289. width: "15px",
  11290. height: "100px",
  11291. display: "inline-block",
  11292. border: "1px solid #555",
  11293. cursor: "ns-resize"
  11294. }),
  11295. a(this.__hue_field),
  11296. r.extend(this.__input.style, {
  11297. outline: "none",
  11298. textAlign: "center",
  11299. color: "#fff",
  11300. border: 0,
  11301. fontWeight: "bold",
  11302. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11303. }),
  11304. t.bind(this.__saturation_field, "mousedown", c),
  11305. t.bind(this.__field_knob, "mousedown", c),
  11306. t.bind(this.__hue_field, "mousedown", function(e) {
  11307. f(e),
  11308. t.bind(window, "mousemove", f),
  11309. t.bind(window, "mouseup", d)
  11310. }),
  11311. this.__saturation_field.appendChild(m),
  11312. this.__selector.appendChild(this.__field_knob),
  11313. this.__selector.appendChild(this.__saturation_field),
  11314. this.__selector.appendChild(this.__hue_field),
  11315. this.__hue_field.appendChild(this.__hue_knob),
  11316. this.domElement.appendChild(this.__input),
  11317. this.domElement.appendChild(this.__selector),
  11318. this.updateDisplay()
  11319. };
  11320. s.superclass = e,
  11321. r.extend(s.prototype, e.prototype, {
  11322. updateDisplay: function() {
  11323. var e = n(this.getValue());
  11324. if (e !== !1) {
  11325. var t = !1;
  11326. r.each(i.COMPONENTS, function(i) {
  11327. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11328. return t = !0,
  11329. {}
  11330. }, this),
  11331. t && r.extend(this.__color.__state, e)
  11332. }
  11333. r.extend(this.__temp.__state, this.__color.__state),
  11334. this.__temp.a = 1;
  11335. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11336. , s = 255 - a;
  11337. r.extend(this.__field_knob.style, {
  11338. marginLeft: 100 * this.__color.s - 7 + "px",
  11339. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11340. backgroundColor: this.__temp.toString(),
  11341. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11342. }),
  11343. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11344. this.__temp.s = 1,
  11345. this.__temp.v = 1,
  11346. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11347. r.extend(this.__input.style, {
  11348. backgroundColor: this.__input.value = this.__color.toString(),
  11349. color: "rgb(" + a + "," + a + "," + a + ")",
  11350. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11351. })
  11352. }
  11353. });
  11354. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11355. return s
  11356. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11357. function r(e, t, i) {
  11358. Object.defineProperty(e, t, {
  11359. get: function() {
  11360. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11361. this.__state[t])
  11362. },
  11363. set: function(e) {
  11364. "RGB" !== this.__state.space && (a(this, t, i),
  11365. this.__state.space = "RGB"),
  11366. this.__state[t] = e
  11367. }
  11368. })
  11369. }
  11370. function o(e, t) {
  11371. Object.defineProperty(e, t, {
  11372. get: function() {
  11373. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11374. this.__state[t])
  11375. },
  11376. set: function(e) {
  11377. "HSV" !== this.__state.space && (s(this),
  11378. this.__state.space = "HSV"),
  11379. this.__state[t] = e
  11380. }
  11381. })
  11382. }
  11383. function a(e, i, r) {
  11384. if ("HEX" === e.__state.space)
  11385. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11386. else {
  11387. if ("HSV" !== e.__state.space)
  11388. throw "Corrupted color state";
  11389. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11390. }
  11391. }
  11392. function s(e) {
  11393. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11394. n.extend(e.__state, {
  11395. s: i.s,
  11396. v: i.v
  11397. }),
  11398. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11399. }
  11400. var l = function() {
  11401. if (this.__state = e.apply(this, arguments),
  11402. this.__state === !1)
  11403. throw "Failed to interpret color arguments";
  11404. this.__state.a = this.__state.a || 1
  11405. };
  11406. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11407. n.extend(l.prototype, {
  11408. toString: function() {
  11409. return i(this)
  11410. },
  11411. toOriginal: function() {
  11412. return this.__state.conversion.write(this)
  11413. }
  11414. }),
  11415. r(l.prototype, "r", 2),
  11416. r(l.prototype, "g", 1),
  11417. r(l.prototype, "b", 0),
  11418. o(l.prototype, "h"),
  11419. o(l.prototype, "s"),
  11420. o(l.prototype, "v"),
  11421. Object.defineProperty(l.prototype, "a", {
  11422. get: function() {
  11423. return this.__state.a
  11424. },
  11425. set: function(e) {
  11426. this.__state.a = e
  11427. }
  11428. }),
  11429. Object.defineProperty(l.prototype, "hex", {
  11430. get: function() {
  11431. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11432. this.__state.hex
  11433. },
  11434. set: function(e) {
  11435. this.__state.space = "HEX",
  11436. this.__state.hex = e
  11437. }
  11438. }),
  11439. l
  11440. }(n.color.interpret, n.color.math = function() {
  11441. var e;
  11442. return {
  11443. hsv_to_rgb: function(e, t, i) {
  11444. var n = Math.floor(e / 60) % 6
  11445. , r = e / 60 - Math.floor(e / 60)
  11446. , o = i * (1 - t)
  11447. , a = i * (1 - r * t)
  11448. , s = i * (1 - (1 - r) * t)
  11449. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11450. return {
  11451. r: 255 * l[0],
  11452. g: 255 * l[1],
  11453. b: 255 * l[2]
  11454. }
  11455. },
  11456. rgb_to_hsv: function(e, t, i) {
  11457. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11458. return 0 == a ? {
  11459. h: NaN,
  11460. s: 0,
  11461. v: 0
  11462. } : (r = s / a,
  11463. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11464. n /= 6,
  11465. n < 0 && (n += 1),
  11466. {
  11467. h: 360 * n,
  11468. s: r,
  11469. v: a / 255
  11470. })
  11471. },
  11472. rgb_to_hex: function(e, t, i) {
  11473. var n = this.hex_with_component(0, 2, e);
  11474. return n = this.hex_with_component(n, 1, t),
  11475. n = this.hex_with_component(n, 0, i)
  11476. },
  11477. component_from_hex: function(e, t) {
  11478. return e >> 8 * t & 255
  11479. },
  11480. hex_with_component: function(t, i, n) {
  11481. return n << (e = 8 * i) | t & ~(255 << e)
  11482. }
  11483. }
  11484. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11485. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11486. window.setTimeout(e, 1e3 / 60)
  11487. }
  11488. }(), n.dom.CenteredDiv = function(e, t) {
  11489. var i = function() {
  11490. this.backgroundElement = document.createElement("div"),
  11491. t.extend(this.backgroundElement.style, {
  11492. backgroundColor: "rgba(0,0,0,0.8)",
  11493. top: 0,
  11494. left: 0,
  11495. display: "none",
  11496. zIndex: "1000",
  11497. opacity: 0,
  11498. WebkitTransition: "opacity 0.2s linear"
  11499. }),
  11500. e.makeFullscreen(this.backgroundElement),
  11501. this.backgroundElement.style.position = "fixed",
  11502. this.domElement = document.createElement("div"),
  11503. t.extend(this.domElement.style, {
  11504. position: "fixed",
  11505. display: "none",
  11506. zIndex: "1001",
  11507. opacity: 0,
  11508. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11509. }),
  11510. document.body.appendChild(this.backgroundElement),
  11511. document.body.appendChild(this.domElement);
  11512. var i = this;
  11513. e.bind(this.backgroundElement, "click", function() {
  11514. i.hide()
  11515. })
  11516. };
  11517. return i.prototype.show = function() {
  11518. var e = this;
  11519. this.backgroundElement.style.display = "block",
  11520. this.domElement.style.display = "block",
  11521. this.domElement.style.opacity = 0,
  11522. this.domElement.style.webkitTransform = "scale(1.1)",
  11523. this.layout(),
  11524. t.defer(function() {
  11525. e.backgroundElement.style.opacity = 1,
  11526. e.domElement.style.opacity = 1,
  11527. e.domElement.style.webkitTransform = "scale(1)"
  11528. })
  11529. }
  11530. ,
  11531. i.prototype.hide = function() {
  11532. var t = this
  11533. , i = function() {
  11534. t.domElement.style.display = "none",
  11535. t.backgroundElement.style.display = "none",
  11536. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11537. e.unbind(t.domElement, "transitionend", i),
  11538. e.unbind(t.domElement, "oTransitionEnd", i)
  11539. };
  11540. e.bind(this.domElement, "webkitTransitionEnd", i),
  11541. e.bind(this.domElement, "transitionend", i),
  11542. e.bind(this.domElement, "oTransitionEnd", i),
  11543. this.backgroundElement.style.opacity = 0,
  11544. this.domElement.style.opacity = 0,
  11545. this.domElement.style.webkitTransform = "scale(1.1)"
  11546. }
  11547. ,
  11548. i.prototype.layout = function() {
  11549. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11550. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11551. }
  11552. ,
  11553. i
  11554. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11555. }
  11556. , {}],
  11557. 94: [function(e, t, i) {
  11558. (function(e) {
  11559. "use strict";
  11560. function i(t) {
  11561. function i(e) {
  11562. 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++) {
  11563. var n = _((t[i] * e + 50) / 100);
  11564. n < 1 ? n = 1 : n > 255 && (n = 255),
  11565. T[G[i]] = n
  11566. }
  11567. 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++) {
  11568. var a = _((r[o] * e + 50) / 100);
  11569. a < 1 ? a = 1 : a > 255 && (a = 255),
  11570. x[G[o]] = a
  11571. }
  11572. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11573. for (var h = 0; h < 8; h++)
  11574. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11575. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11576. l++
  11577. }
  11578. function n(e, t) {
  11579. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11580. for (var a = 1; a <= e[o]; a++)
  11581. r[t[n]] = [],
  11582. r[t[n]][0] = i,
  11583. r[t[n]][1] = o,
  11584. n++,
  11585. i++;
  11586. i *= 2
  11587. }
  11588. return r
  11589. }
  11590. function r() {
  11591. C = n(z, W),
  11592. I = n(X, Z),
  11593. E = n(j, Y),
  11594. b = n(q, K)
  11595. }
  11596. function o() {
  11597. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11598. for (var n = e; n < t; n++)
  11599. P[32767 + n] = i,
  11600. R[32767 + n] = [],
  11601. R[32767 + n][1] = i,
  11602. R[32767 + n][0] = n;
  11603. for (var r = -(t - 1); r <= -e; r++)
  11604. P[32767 + r] = i,
  11605. R[32767 + r] = [],
  11606. R[32767 + r][1] = i,
  11607. R[32767 + r][0] = t - 1 + r;
  11608. e <<= 1,
  11609. t <<= 1
  11610. }
  11611. }
  11612. function a() {
  11613. for (var e = 0; e < 256; e++)
  11614. H[e] = 19595 * e,
  11615. H[e + 256 >> 0] = 38470 * e,
  11616. H[e + 512 >> 0] = 7471 * e + 32768,
  11617. H[e + 768 >> 0] = -11059 * e,
  11618. H[e + 1024 >> 0] = -21709 * e,
  11619. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11620. H[e + 1536 >> 0] = -27439 * e,
  11621. H[e + 1792 >> 0] = -5329 * e
  11622. }
  11623. function s(e) {
  11624. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11625. t & 1 << i && (N |= 1 << B),
  11626. i--,
  11627. B--,
  11628. B < 0 && (255 == N ? (l(255),
  11629. l(0)) : l(N),
  11630. B = 7,
  11631. N = 0)
  11632. }
  11633. function l(e) {
  11634. D.push(e)
  11635. }
  11636. function c(e) {
  11637. l(e >> 8 & 255),
  11638. l(255 & e)
  11639. }
  11640. function h(e, t) {
  11641. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11642. for (h = 0; h < d; ++h) {
  11643. i = e[u],
  11644. n = e[u + 1],
  11645. r = e[u + 2],
  11646. o = e[u + 3],
  11647. a = e[u + 4],
  11648. s = e[u + 5],
  11649. l = e[u + 6],
  11650. c = e[u + 7];
  11651. var f = i + c
  11652. , g = i - c
  11653. , m = n + l
  11654. , v = n - l
  11655. , A = r + s
  11656. , y = r - s
  11657. , C = o + a
  11658. , I = o - a
  11659. , E = f + C
  11660. , b = f - C
  11661. , w = m + A
  11662. , _ = m - A;
  11663. e[u] = E + w,
  11664. e[u + 4] = E - w;
  11665. var T = .707106781 * (_ + b);
  11666. e[u + 2] = b + T,
  11667. e[u + 6] = b - T,
  11668. E = I + y,
  11669. w = y + v,
  11670. _ = v + g;
  11671. var x = .382683433 * (E - _)
  11672. , S = .5411961 * E + x
  11673. , M = 1.306562965 * _ + x
  11674. , R = .707106781 * w
  11675. , P = g + R
  11676. , L = g - R;
  11677. e[u + 5] = L + S,
  11678. e[u + 3] = L - S,
  11679. e[u + 1] = P + M,
  11680. e[u + 7] = P - M,
  11681. u += 8
  11682. }
  11683. for (u = 0,
  11684. h = 0; h < d; ++h) {
  11685. i = e[u],
  11686. n = e[u + 8],
  11687. r = e[u + 16],
  11688. o = e[u + 24],
  11689. a = e[u + 32],
  11690. s = e[u + 40],
  11691. l = e[u + 48],
  11692. c = e[u + 56];
  11693. var D = i + c
  11694. , N = i - c
  11695. , B = n + l
  11696. , F = n - l
  11697. , V = r + s
  11698. , U = r - s
  11699. , k = o + a
  11700. , H = o - a
  11701. , G = D + k
  11702. , z = D - k
  11703. , W = B + V
  11704. , j = B - V;
  11705. e[u] = G + W,
  11706. e[u + 32] = G - W;
  11707. var Y = .707106781 * (j + z);
  11708. e[u + 16] = z + Y,
  11709. e[u + 48] = z - Y,
  11710. G = H + U,
  11711. W = U + F,
  11712. j = F + N;
  11713. var X = .382683433 * (G - j)
  11714. , Z = .5411961 * G + X
  11715. , q = 1.306562965 * j + X
  11716. , K = .707106781 * W
  11717. , Q = N + K
  11718. , J = N - K;
  11719. e[u + 40] = J + Z,
  11720. e[u + 24] = J - Z,
  11721. e[u + 8] = Q + q,
  11722. e[u + 56] = Q - q,
  11723. u++
  11724. }
  11725. var $;
  11726. for (h = 0; h < p; ++h)
  11727. $ = e[h] * t[h],
  11728. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11729. return O
  11730. }
  11731. function u() {
  11732. c(65504),
  11733. c(16),
  11734. l(74),
  11735. l(70),
  11736. l(73),
  11737. l(70),
  11738. l(0),
  11739. l(1),
  11740. l(1),
  11741. l(0),
  11742. c(1),
  11743. c(1),
  11744. l(0),
  11745. l(0)
  11746. }
  11747. function d(e, t) {
  11748. c(65472),
  11749. c(17),
  11750. l(8),
  11751. c(t),
  11752. c(e),
  11753. l(3),
  11754. l(1),
  11755. l(17),
  11756. l(0),
  11757. l(2),
  11758. l(17),
  11759. l(1),
  11760. l(3),
  11761. l(17),
  11762. l(1)
  11763. }
  11764. function p() {
  11765. c(65499),
  11766. c(132),
  11767. l(0);
  11768. for (var e = 0; e < 64; e++)
  11769. l(T[e]);
  11770. l(1);
  11771. for (var t = 0; t < 64; t++)
  11772. l(x[t])
  11773. }
  11774. function f() {
  11775. c(65476),
  11776. c(418),
  11777. l(0);
  11778. for (var e = 0; e < 16; e++)
  11779. l(z[e + 1]);
  11780. for (var t = 0; t <= 11; t++)
  11781. l(W[t]);
  11782. l(16);
  11783. for (var i = 0; i < 16; i++)
  11784. l(j[i + 1]);
  11785. for (var n = 0; n <= 161; n++)
  11786. l(Y[n]);
  11787. l(1);
  11788. for (var r = 0; r < 16; r++)
  11789. l(X[r + 1]);
  11790. for (var o = 0; o <= 11; o++)
  11791. l(Z[o]);
  11792. l(17);
  11793. for (var a = 0; a < 16; a++)
  11794. l(q[a + 1]);
  11795. for (var s = 0; s <= 161; s++)
  11796. l(K[s])
  11797. }
  11798. function g() {
  11799. c(65498),
  11800. c(12),
  11801. l(3),
  11802. l(1),
  11803. l(0),
  11804. l(2),
  11805. l(17),
  11806. l(3),
  11807. l(17),
  11808. l(0),
  11809. l(63),
  11810. l(0)
  11811. }
  11812. function m(e, t, i, n, r) {
  11813. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11814. L[G[f]] = p[f];
  11815. var g = L[0] - i;
  11816. i = L[0],
  11817. 0 == g ? s(n[0]) : (o = 32767 + g,
  11818. s(n[P[o]]),
  11819. s(R[o]));
  11820. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11821. ;
  11822. if (0 == m)
  11823. return s(a),
  11824. i;
  11825. for (var v, A = 1; A <= m; ) {
  11826. for (var y = A; 0 == L[A] && A <= m; ++A)
  11827. ;
  11828. var C = A - y;
  11829. if (C >= c) {
  11830. v = C >> 4;
  11831. for (var I = 1; I <= v; ++I)
  11832. s(l);
  11833. C &= 15
  11834. }
  11835. o = 32767 + L[A],
  11836. s(r[(C << 4) + P[o]]),
  11837. s(R[o]),
  11838. A++
  11839. }
  11840. return m != u && s(a),
  11841. i
  11842. }
  11843. function v() {
  11844. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11845. k[t] = e(t)
  11846. }
  11847. function A(e) {
  11848. if (e <= 0 && (e = 1),
  11849. e > 100 && (e = 100),
  11850. w != e) {
  11851. var t = 0;
  11852. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11853. i(t),
  11854. w = e
  11855. }
  11856. }
  11857. function y() {
  11858. var e = (new Date).getTime();
  11859. t || (t = 50),
  11860. v(),
  11861. r(),
  11862. o(),
  11863. a(),
  11864. A(t);
  11865. (new Date).getTime() - e
  11866. }
  11867. var C, I, E, b, w, _ = (Math.round,
  11868. 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];
  11869. this.encode = function(t, i) {
  11870. var n = ((new Date).getTime(),
  11871. i.quality);
  11872. n && A(n),
  11873. D = new Array,
  11874. N = 0,
  11875. B = 7,
  11876. c(65496),
  11877. u(),
  11878. p(),
  11879. d(t.width, t.height),
  11880. f(),
  11881. g();
  11882. var r = 0
  11883. , o = 0
  11884. , a = 0;
  11885. N = 0,
  11886. B = 7,
  11887. this.encode.displayName = "_encode_";
  11888. 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; ) {
  11889. for (l = 0; l < G; ) {
  11890. for (w = G * z + l,
  11891. _ = w,
  11892. T = -1,
  11893. x = 0,
  11894. R = 0; R < 64; R++)
  11895. x = (k ? 63 - R : R) >> 3,
  11896. T = 4 * (7 & R),
  11897. _ = w + x * G + T,
  11898. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11899. l + T >= G && (_ -= l + T - G + 4),
  11900. h = P[_++],
  11901. v = P[_++],
  11902. y = P[_++],
  11903. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11904. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11905. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11906. r = m(F, S, r, C, E),
  11907. o = m(V, M, o, I, b),
  11908. a = m(U, M, a, I, b),
  11909. l += 32
  11910. }
  11911. z += W
  11912. }
  11913. if (B >= 0) {
  11914. var j = [];
  11915. j[1] = B + 1,
  11916. j[0] = (1 << B + 1) - 1,
  11917. s(j)
  11918. }
  11919. return c(65497),
  11920. new e(D)
  11921. }
  11922. ,
  11923. y()
  11924. }
  11925. function n(e, t) {
  11926. t = t || {},
  11927. t.quality = t.quality || 50;
  11928. var n = t.quality
  11929. , r = new i(n)
  11930. , o = r.encode(e, t);
  11931. return {
  11932. data: o,
  11933. width: e.width,
  11934. height: e.height
  11935. }
  11936. }
  11937. t.exports.encode = n
  11938. }
  11939. ).call(this, e("buffer").Buffer)
  11940. }
  11941. , {
  11942. buffer: 198
  11943. }],
  11944. 95: [function(e, t, i) {
  11945. "use strict";
  11946. !function() {
  11947. if ("performance"in window == !1 && (window.performance = {}),
  11948. Date.now = Date.now || function() {
  11949. return (new Date).getTime()
  11950. }
  11951. ,
  11952. "now"in window.performance == !1) {
  11953. var e = Date.now();
  11954. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11955. window.performance.now = function() {
  11956. return Date.now() - e
  11957. }
  11958. }
  11959. }()
  11960. }
  11961. , {}],
  11962. 96: [function(e, t, i) {
  11963. "use strict";
  11964. var n = e("three");
  11965. n.EffectComposer = function(e, t) {
  11966. if (this.renderer = e,
  11967. void 0 === t) {
  11968. var i = {
  11969. minFilter: n.LinearFilter,
  11970. magFilter: n.LinearFilter,
  11971. format: n.RGBAFormat,
  11972. stencilBuffer: !1
  11973. }
  11974. , r = e.getSize();
  11975. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11976. }
  11977. this.renderTarget1 = t,
  11978. this.renderTarget2 = t.clone(),
  11979. this.writeBuffer = this.renderTarget1,
  11980. this.readBuffer = this.renderTarget2,
  11981. this.passes = [],
  11982. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11983. this.copyPass = new n.ShaderPass(n.CopyShader)
  11984. }
  11985. ,
  11986. n.EffectComposer.prototype = {
  11987. swapBuffers: function() {
  11988. var e = this.readBuffer;
  11989. this.readBuffer = this.writeBuffer,
  11990. this.writeBuffer = e
  11991. },
  11992. addPass: function(e) {
  11993. this.passes.push(e)
  11994. },
  11995. insertPass: function(e, t) {
  11996. this.passes.splice(t, 0, e)
  11997. },
  11998. render: function(e) {
  11999. this.writeBuffer = this.renderTarget1,
  12000. this.readBuffer = this.renderTarget2;
  12001. var t, i, r = !1, o = this.passes.length;
  12002. for (i = 0; i < o; i++)
  12003. if (t = this.passes[i],
  12004. t.enabled) {
  12005. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12006. t.needsSwap) {
  12007. if (r) {
  12008. var a = this.renderer.context;
  12009. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12010. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12011. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12012. }
  12013. this.swapBuffers()
  12014. }
  12015. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12016. }
  12017. },
  12018. reset: function(e) {
  12019. if (void 0 === e) {
  12020. var t = this.renderer.getSize();
  12021. e = this.renderTarget1.clone(),
  12022. e.setSize(t.width, t.height)
  12023. }
  12024. this.renderTarget1.dispose(),
  12025. this.renderTarget2.dispose(),
  12026. this.renderTarget1 = e,
  12027. this.renderTarget2 = e.clone(),
  12028. this.writeBuffer = this.renderTarget1,
  12029. this.readBuffer = this.renderTarget2
  12030. },
  12031. setSize: function(e, t) {
  12032. this.renderTarget1.setSize(e, t),
  12033. this.renderTarget2.setSize(e, t)
  12034. }
  12035. }
  12036. }
  12037. , {
  12038. three: 217
  12039. }],
  12040. 97: [function(e, t, i) {
  12041. "use strict";
  12042. var n = e("three");
  12043. n.MaskPass = function(e, t) {
  12044. this.scene = e,
  12045. this.camera = t,
  12046. this.enabled = !0,
  12047. this.clear = !0,
  12048. this.needsSwap = !1,
  12049. this.inverse = !1
  12050. }
  12051. ,
  12052. n.MaskPass.prototype = {
  12053. render: function(e, t, i, n) {
  12054. var r = e.context;
  12055. r.colorMask(!1, !1, !1, !1),
  12056. r.depthMask(!1);
  12057. var o, a;
  12058. this.inverse ? (o = 0,
  12059. a = 1) : (o = 1,
  12060. a = 0),
  12061. r.enable(r.STENCIL_TEST),
  12062. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12063. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12064. r.clearStencil(a),
  12065. e.render(this.scene, this.camera, i, this.clear),
  12066. e.render(this.scene, this.camera, t, this.clear),
  12067. r.colorMask(!0, !0, !0, !0),
  12068. r.depthMask(!0),
  12069. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12070. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12071. }
  12072. },
  12073. n.ClearMaskPass = function() {
  12074. this.enabled = !0
  12075. }
  12076. ,
  12077. n.ClearMaskPass.prototype = {
  12078. render: function(e, t, i, n) {
  12079. var r = e.context;
  12080. r.disable(r.STENCIL_TEST)
  12081. }
  12082. }
  12083. }
  12084. , {
  12085. three: 217
  12086. }],
  12087. 98: [function(e, t, i) {
  12088. "use strict";
  12089. var n = e("three");
  12090. n.RenderPass = function(e, t, i, r, o) {
  12091. this.scene = e,
  12092. this.camera = t,
  12093. this.overrideMaterial = i,
  12094. this.clearColor = r,
  12095. this.clearAlpha = void 0 !== o ? o : 1,
  12096. this.oldClearColor = new n.Color,
  12097. this.oldClearAlpha = 1,
  12098. this.enabled = !0,
  12099. this.clear = !0,
  12100. this.needsSwap = !1
  12101. }
  12102. ,
  12103. n.RenderPass.prototype = {
  12104. render: function(e, t, i, n) {
  12105. this.scene.overrideMaterial = this.overrideMaterial,
  12106. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12107. this.oldClearAlpha = e.getClearAlpha(),
  12108. e.setClearColor(this.clearColor, this.clearAlpha)),
  12109. e.render(this.scene, this.camera, i, this.clear),
  12110. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12111. this.scene.overrideMaterial = null
  12112. }
  12113. }
  12114. }
  12115. , {
  12116. three: 217
  12117. }],
  12118. 99: [function(e, t, i) {
  12119. "use strict";
  12120. var n = e("three");
  12121. n.ShaderPass = function(e, t) {
  12122. this.textureID = void 0 !== t ? t : "tDiffuse",
  12123. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12124. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12125. this.material = new n.ShaderMaterial({
  12126. defines: e.defines || {},
  12127. uniforms: this.uniforms,
  12128. vertexShader: e.vertexShader,
  12129. fragmentShader: e.fragmentShader
  12130. })),
  12131. this.renderToScreen = !1,
  12132. this.enabled = !0,
  12133. this.needsSwap = !0,
  12134. this.clear = !1,
  12135. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12136. this.scene = new n.Scene,
  12137. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12138. this.scene.add(this.quad)
  12139. }
  12140. ,
  12141. n.ShaderPass.prototype = {
  12142. render: function(e, t, i, n) {
  12143. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12144. this.quad.material = this.material,
  12145. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12146. }
  12147. }
  12148. }
  12149. , {
  12150. three: 217
  12151. }],
  12152. 100: [function(e, t, i) {
  12153. "use strict";
  12154. var n = e("three");
  12155. n.CopyShader = {
  12156. uniforms: {
  12157. tDiffuse: {
  12158. type: "t",
  12159. value: null
  12160. },
  12161. opacity: {
  12162. type: "f",
  12163. value: 1
  12164. }
  12165. },
  12166. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12167. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12168. }
  12169. }
  12170. , {
  12171. three: 217
  12172. }],
  12173. 101: [function(e, t, i) {
  12174. "use strict";
  12175. var n = e("three");
  12176. n.HorizontalBlurShader = {
  12177. uniforms: {
  12178. tDiffuse: {
  12179. type: "t",
  12180. value: null
  12181. },
  12182. h: {
  12183. type: "f",
  12184. value: 1 / 512
  12185. }
  12186. },
  12187. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12188. 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")
  12189. }
  12190. }
  12191. , {
  12192. three: 217
  12193. }],
  12194. 102: [function(e, t, i) {
  12195. "use strict";
  12196. var n = e("three");
  12197. n.VerticalBlurShader = {
  12198. uniforms: {
  12199. tDiffuse: {
  12200. type: "t",
  12201. value: null
  12202. },
  12203. v: {
  12204. type: "f",
  12205. value: 1 / 512
  12206. }
  12207. },
  12208. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12209. 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")
  12210. }
  12211. }
  12212. , {
  12213. three: 217
  12214. }],
  12215. 103: [function(e, t, i) {
  12216. "use strict";
  12217. var n = e("three");
  12218. !function() {
  12219. if ("performance"in window == 0 && (window.performance = {}),
  12220. "now"in window.performance == 0) {
  12221. var e = Date.now();
  12222. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12223. window.performance.now = function() {
  12224. return Date.now() - e
  12225. }
  12226. }
  12227. }(),
  12228. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12229. var t, i = this.extensions, r = this.context;
  12230. if (e === n.RepeatWrapping)
  12231. return r.REPEAT;
  12232. if (e === n.ClampToEdgeWrapping)
  12233. return r.CLAMP_TO_EDGE;
  12234. if (e === n.MirroredRepeatWrapping)
  12235. return r.MIRRORED_REPEAT;
  12236. if (e === n.NearestFilter)
  12237. return r.NEAREST;
  12238. if (e === n.NearestMipMapNearestFilter)
  12239. return r.NEAREST_MIPMAP_NEAREST;
  12240. if (e === n.NearestMipMapLinearFilter)
  12241. return r.NEAREST_MIPMAP_LINEAR;
  12242. if (e === n.LinearFilter)
  12243. return r.LINEAR;
  12244. if (e === n.LinearMipMapNearestFilter)
  12245. return r.LINEAR_MIPMAP_NEAREST;
  12246. if (e === n.LinearMipMapLinearFilter)
  12247. return r.LINEAR_MIPMAP_LINEAR;
  12248. if (e === n.UnsignedByteType)
  12249. return r.UNSIGNED_BYTE;
  12250. if (e === n.UnsignedShort4444Type)
  12251. return r.UNSIGNED_SHORT_4_4_4_4;
  12252. if (e === n.UnsignedShort5551Type)
  12253. return r.UNSIGNED_SHORT_5_5_5_1;
  12254. if (e === n.UnsignedShort565Type)
  12255. return r.UNSIGNED_SHORT_5_6_5;
  12256. if (e === n.ByteType)
  12257. return r.BYTE;
  12258. if (e === n.ShortType)
  12259. return r.SHORT;
  12260. if (e === n.UnsignedShortType)
  12261. return r.UNSIGNED_SHORT;
  12262. if (e === n.IntType)
  12263. return r.INT;
  12264. if (e === n.UnsignedIntType)
  12265. return r.UNSIGNED_INT;
  12266. if (e === n.FloatType)
  12267. return r.FLOAT;
  12268. if (t = i.get("OES_texture_half_float"),
  12269. null !== t && e === n.HalfFloatType)
  12270. return t.HALF_FLOAT_OES;
  12271. if (e === n.AlphaFormat)
  12272. return r.ALPHA;
  12273. if (e === n.RGBFormat)
  12274. return r.RGB;
  12275. if (e === n.RGBAFormat)
  12276. return r.RGBA;
  12277. if (e === n.LuminanceFormat)
  12278. return r.LUMINANCE;
  12279. if (e === n.LuminanceAlphaFormat)
  12280. return r.LUMINANCE_ALPHA;
  12281. if (e === n.AddEquation)
  12282. return r.FUNC_ADD;
  12283. if (e === n.SubtractEquation)
  12284. return r.FUNC_SUBTRACT;
  12285. if (e === n.ReverseSubtractEquation)
  12286. return r.FUNC_REVERSE_SUBTRACT;
  12287. if (e === n.ZeroFactor)
  12288. return r.ZERO;
  12289. if (e === n.OneFactor)
  12290. return r.ONE;
  12291. if (e === n.SrcColorFactor)
  12292. return r.SRC_COLOR;
  12293. if (e === n.OneMinusSrcColorFactor)
  12294. return r.ONE_MINUS_SRC_COLOR;
  12295. if (e === n.SrcAlphaFactor)
  12296. return r.SRC_ALPHA;
  12297. if (e === n.OneMinusSrcAlphaFactor)
  12298. return r.ONE_MINUS_SRC_ALPHA;
  12299. if (e === n.DstAlphaFactor)
  12300. return r.DST_ALPHA;
  12301. if (e === n.OneMinusDstAlphaFactor)
  12302. return r.ONE_MINUS_DST_ALPHA;
  12303. if (e === n.DstColorFactor)
  12304. return r.DST_COLOR;
  12305. if (e === n.OneMinusDstColorFactor)
  12306. return r.ONE_MINUS_DST_COLOR;
  12307. if (e === n.SrcAlphaSaturateFactor)
  12308. return r.SRC_ALPHA_SATURATE;
  12309. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12310. null !== t) {
  12311. if (e === n.RGB_S3TC_DXT1_Format)
  12312. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12313. if (e === n.RGBA_S3TC_DXT1_Format)
  12314. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12315. if (e === n.RGBA_S3TC_DXT3_Format)
  12316. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12317. if (e === n.RGBA_S3TC_DXT5_Format)
  12318. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12319. }
  12320. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12321. null !== t) {
  12322. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12323. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12324. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12325. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12326. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12327. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12328. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12329. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12330. }
  12331. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12332. null !== t && e === n.RGB_ETC1_Format)
  12333. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12334. if (t = i.get("EXT_blend_minmax"),
  12335. null !== t) {
  12336. if (e === n.MinEquation)
  12337. return t.MIN_EXT;
  12338. if (e === n.MaxEquation)
  12339. return t.MAX_EXT
  12340. }
  12341. return 0
  12342. }
  12343. ,
  12344. n.WebGLState = function(e, t, i) {
  12345. var r = this
  12346. , o = new n.Vector4
  12347. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12348. , s = new Uint8Array(a)
  12349. , l = new Uint8Array(a)
  12350. , c = new Uint8Array(a)
  12351. , h = {}
  12352. , u = null
  12353. , d = null
  12354. , p = null
  12355. , f = null
  12356. , g = null
  12357. , m = null
  12358. , v = null
  12359. , A = null
  12360. , y = !1
  12361. , C = null
  12362. , I = null
  12363. , E = null
  12364. , b = null
  12365. , w = null
  12366. , _ = null
  12367. , T = null
  12368. , x = null
  12369. , S = null
  12370. , M = null
  12371. , R = null
  12372. , P = null
  12373. , O = null
  12374. , L = null
  12375. , D = null
  12376. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12377. , B = void 0
  12378. , F = {}
  12379. , V = new n.Vector4
  12380. , U = null
  12381. , k = null
  12382. , H = new n.Vector4
  12383. , G = new n.Vector4;
  12384. this.init = function() {
  12385. this.clearColor(0, 0, 0, 1),
  12386. this.clearDepth(1),
  12387. this.clearStencil(0),
  12388. this.enable(e.DEPTH_TEST),
  12389. e.depthFunc(e.LEQUAL),
  12390. e.frontFace(e.CCW),
  12391. e.cullFace(e.BACK),
  12392. this.enable(e.CULL_FACE),
  12393. this.enable(e.BLEND),
  12394. e.blendEquation(e.FUNC_ADD),
  12395. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12396. }
  12397. ,
  12398. this.initAttributes = function() {
  12399. for (var e = 0, t = s.length; e < t; e++)
  12400. s[e] = 0
  12401. }
  12402. ,
  12403. this.enableAttribute = function(i) {
  12404. if (s[i] = 1,
  12405. 0 === l[i] && (e.enableVertexAttribArray(i),
  12406. l[i] = 1),
  12407. 0 !== c[i]) {
  12408. var n = t.get("ANGLE_instanced_arrays");
  12409. n.vertexAttribDivisorANGLE(i, 0),
  12410. c[i] = 0
  12411. }
  12412. }
  12413. ,
  12414. this.enableAttributeAndDivisor = function(t, i, n) {
  12415. s[t] = 1,
  12416. 0 === l[t] && (e.enableVertexAttribArray(t),
  12417. l[t] = 1),
  12418. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12419. c[t] = i)
  12420. }
  12421. ,
  12422. this.disableUnusedAttributes = function() {
  12423. for (var t = 0, i = l.length; t < i; t++)
  12424. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12425. l[t] = 0)
  12426. }
  12427. ,
  12428. this.enable = function(t) {
  12429. h[t] !== !0 && (e.enable(t),
  12430. h[t] = !0)
  12431. }
  12432. ,
  12433. this.disable = function(t) {
  12434. h[t] !== !1 && (e.disable(t),
  12435. h[t] = !1)
  12436. }
  12437. ,
  12438. this.getCompressedTextureFormats = function() {
  12439. if (null === u && (u = [],
  12440. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12441. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12442. u.push(i[n]);
  12443. return u
  12444. }
  12445. ,
  12446. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12447. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12448. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12449. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12450. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12451. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12452. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12453. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12454. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12455. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12456. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12457. d = t,
  12458. y = h),
  12459. t === n.CustomBlending ? (s = s || r,
  12460. l = l || o,
  12461. c = c || a,
  12462. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12463. p = r,
  12464. m = s),
  12465. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12466. f = o,
  12467. g = a,
  12468. v = l,
  12469. A = c)) : (p = null,
  12470. f = null,
  12471. g = null,
  12472. m = null,
  12473. v = null,
  12474. A = null)
  12475. }
  12476. ,
  12477. this.setDepthFunc = function(t) {
  12478. if (C !== t) {
  12479. if (t)
  12480. switch (t) {
  12481. case n.NeverDepth:
  12482. e.depthFunc(e.NEVER);
  12483. break;
  12484. case n.AlwaysDepth:
  12485. e.depthFunc(e.ALWAYS);
  12486. break;
  12487. case n.LessDepth:
  12488. e.depthFunc(e.LESS);
  12489. break;
  12490. case n.LessEqualDepth:
  12491. e.depthFunc(e.LEQUAL);
  12492. break;
  12493. case n.EqualDepth:
  12494. e.depthFunc(e.EQUAL);
  12495. break;
  12496. case n.GreaterEqualDepth:
  12497. e.depthFunc(e.GEQUAL);
  12498. break;
  12499. case n.GreaterDepth:
  12500. e.depthFunc(e.GREATER);
  12501. break;
  12502. case n.NotEqualDepth:
  12503. e.depthFunc(e.NOTEQUAL);
  12504. break;
  12505. default:
  12506. e.depthFunc(e.LEQUAL)
  12507. }
  12508. else
  12509. e.depthFunc(e.LEQUAL);
  12510. C = t
  12511. }
  12512. }
  12513. ,
  12514. this.setDepthTest = function(t) {
  12515. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12516. }
  12517. ,
  12518. this.setDepthWrite = function(t) {
  12519. I !== t && (e.depthMask(t),
  12520. I = t)
  12521. }
  12522. ,
  12523. this.setColorWrite = function(t) {
  12524. E !== t && (e.colorMask(t, t, t, t),
  12525. E = t)
  12526. }
  12527. ,
  12528. this.setStencilFunc = function(t, i, n) {
  12529. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12530. w = t,
  12531. _ = i,
  12532. T = n)
  12533. }
  12534. ,
  12535. this.setStencilOp = function(t, i, n) {
  12536. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12537. x = t,
  12538. S = i,
  12539. M = n)
  12540. }
  12541. ,
  12542. this.setStencilTest = function(t) {
  12543. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12544. }
  12545. ,
  12546. this.setStencilWrite = function(t) {
  12547. b !== t && (e.stencilMask(t),
  12548. b = t)
  12549. }
  12550. ,
  12551. this.setFlipSided = function(t) {
  12552. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12553. R = t)
  12554. }
  12555. ,
  12556. this.setLineWidth = function(t) {
  12557. t !== P && (e.lineWidth(t),
  12558. P = t)
  12559. }
  12560. ,
  12561. this.setPolygonOffset = function(t, i, n) {
  12562. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12563. !t || O === i && L === n || (e.polygonOffset(i, n),
  12564. O = i,
  12565. L = n)
  12566. }
  12567. ,
  12568. this.getScissorTest = function() {
  12569. return D
  12570. }
  12571. ,
  12572. this.setScissorTest = function(t) {
  12573. D = t,
  12574. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12575. }
  12576. ,
  12577. this.activeTexture = function(t) {
  12578. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12579. B !== t && (e.activeTexture(t),
  12580. B = t)
  12581. }
  12582. ,
  12583. this.bindTexture = function(t, i) {
  12584. void 0 === B && r.activeTexture();
  12585. var n = F[B];
  12586. void 0 === n && (n = {
  12587. type: void 0,
  12588. texture: void 0
  12589. },
  12590. F[B] = n),
  12591. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12592. n.type = t,
  12593. n.texture = i)
  12594. }
  12595. ,
  12596. this.compressedTexImage2D = function() {
  12597. try {
  12598. e.compressedTexImage2D.apply(e, arguments)
  12599. } catch (e) {
  12600. console.error(e)
  12601. }
  12602. }
  12603. ,
  12604. this.texImage2D = function() {
  12605. try {
  12606. e.texImage2D.apply(e, arguments)
  12607. } catch (e) {
  12608. console.error(e)
  12609. }
  12610. }
  12611. ,
  12612. this.clearColor = function(t, i, n, r) {
  12613. o.set(t, i, n, r),
  12614. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12615. V.copy(o))
  12616. }
  12617. ,
  12618. this.clearDepth = function(t) {
  12619. U !== t && (e.clearDepth(t),
  12620. U = t)
  12621. }
  12622. ,
  12623. this.clearStencil = function(t) {
  12624. k !== t && (e.clearStencil(t),
  12625. k = t)
  12626. }
  12627. ,
  12628. this.scissor = function(t) {
  12629. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12630. H.copy(t))
  12631. }
  12632. ,
  12633. this.viewport = function(t) {
  12634. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12635. G.copy(t))
  12636. }
  12637. ,
  12638. this.reset = function() {
  12639. for (var t = 0; t < l.length; t++)
  12640. 1 === l[t] && (e.disableVertexAttribArray(t),
  12641. l[t] = 0);
  12642. h = {},
  12643. u = null,
  12644. B = void 0,
  12645. F = {},
  12646. d = null,
  12647. E = null,
  12648. I = null,
  12649. b = null,
  12650. R = null
  12651. }
  12652. }
  12653. }
  12654. , {
  12655. three: 217
  12656. }],
  12657. 104: [function(e, t, i) {
  12658. (function(i, n) {
  12659. "use strict";
  12660. function r(e) {
  12661. this.urls = e;
  12662. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12663. this.builder = a.loadProto(t),
  12664. this.decoder = this.builder.build("binary_mesh")
  12665. }
  12666. var o = e("three")
  12667. , a = e("protobufjs")
  12668. , s = e("../util/logger")
  12669. , l = (e("../util/common"),
  12670. e("../util/ajax"))
  12671. , c = e("../objects/Chunk")
  12672. , h = new s(n);
  12673. r.prototype = {
  12674. constructor: r,
  12675. load: function(e, t, i, n) {
  12676. return h.time("download"),
  12677. l.get(e, {
  12678. responseType: "arraybuffer"
  12679. }).done(function(r) {
  12680. h.timeEnd("download"),
  12681. this.parse(r, e, t, i, n)
  12682. }
  12683. .bind(this)).fail(n)
  12684. },
  12685. parse: function(e, t, i, n, r) {
  12686. var o = this.readProtobuf(e);
  12687. if (!o)
  12688. return r();
  12689. try {
  12690. h.time("convert to webgl"),
  12691. this.convertProtobufToSceneObject(o, t, i, n, r),
  12692. h.timeEnd("convert to webgl")
  12693. } catch (e) {
  12694. return h.error("failed parsing .dam"),
  12695. h.error(e.message),
  12696. r()
  12697. }
  12698. },
  12699. readProtobuf: function(e) {
  12700. var t;
  12701. try {
  12702. h.time("parse proto"),
  12703. t = this.decoder.decode(e),
  12704. h.timeEnd("parse proto")
  12705. } catch (e) {
  12706. return h.error("failed parsing proto for .dam"),
  12707. h.error(e.message),
  12708. null
  12709. }
  12710. return t
  12711. },
  12712. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12713. function a(e) {
  12714. var i = new o.BufferGeometry;
  12715. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12716. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12717. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12718. i.applyMatrix(s),
  12719. i.computeBoundingBox(),
  12720. new c({
  12721. geometry: i,
  12722. textureName: e.material_name,
  12723. name: e.chunk_name,
  12724. meshUrl: t
  12725. })
  12726. }
  12727. if (0 === e.chunk.length)
  12728. return h.warn("No chunks in damfile..."),
  12729. i([]);
  12730. var s = new o.Matrix4;
  12731. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12732. var l = e.chunk.map(a);
  12733. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12734. r())
  12735. }
  12736. },
  12737. t.exports = r
  12738. }
  12739. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12740. }
  12741. , {
  12742. "../objects/Chunk": 144,
  12743. "../util/ajax": 181,
  12744. "../util/common": 185,
  12745. "../util/logger": 189,
  12746. buffer: 198,
  12747. protobufjs: 214,
  12748. three: 217
  12749. }],
  12750. 105: [function(e, t, i) {
  12751. (function(i) {
  12752. "use strict";
  12753. var n = (e("three"),
  12754. e("../settings"),
  12755. e("../util/browser"),
  12756. e("./DamLoader"))
  12757. , r = e("../util/logger")
  12758. , o = (e("../ab"),
  12759. new r(i));
  12760. t.exports = {
  12761. getLoaders: function() {
  12762. return [["_50k", ".dam", n], ["", ".dam", n]]
  12763. },
  12764. load: function(e, t, i, n, r, a) {
  12765. var s = this.getLoaders();
  12766. a = a || 0;
  12767. var l = s[a];
  12768. if (!l)
  12769. return void (r && r("No suitable model file found..."));
  12770. var c = l[0]
  12771. , h = l[1]
  12772. , u = new l[2](t)
  12773. , d = t.get(e + c + h);
  12774. d ? (o.debug("Trying " + c + h),
  12775. u.load(d, i, n, function() {
  12776. this.load(e, t, i, n, r, ++a)
  12777. }
  12778. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12779. this.load(e, t, i, n, r, ++a))
  12780. }
  12781. }
  12782. }
  12783. ).call(this, "/js/loaders/ModelLoader.js")
  12784. }
  12785. , {
  12786. "../ab": 3,
  12787. "../settings": 166,
  12788. "../util/browser": 182,
  12789. "../util/logger": 189,
  12790. "./DamLoader": 104,
  12791. three: 217
  12792. }],
  12793. 106: [function(e, t, i) {
  12794. (function(i) {
  12795. "use strict";
  12796. var n = e("../util/common")
  12797. , r = e("../util/texture")
  12798. , o = e("../util/browser")
  12799. , a = e("../util/logger")
  12800. , s = e("../settings")
  12801. , l = new a(i);
  12802. t.exports = {
  12803. load: function(e, t) {
  12804. function i(e, i) {
  12805. e || (t.push(i),
  12806. p++,
  12807. d.notify(p, a),
  12808. p === a && d.resolve())
  12809. }
  12810. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12811. return $.when();
  12812. var a = n.countUnique(e.chunks.map(function(e) {
  12813. return e.textureName
  12814. }))
  12815. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12816. , h = "_50k" === c ? "high" : "low";
  12817. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12818. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12819. h = "low"));
  12820. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12821. , d = $.Deferred()
  12822. , p = 0;
  12823. return e.chunks.forEach(function(t) {
  12824. if (!t.material.map && t.textureName) {
  12825. var n = e.urls.get(u + t.textureName);
  12826. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12827. }
  12828. }),
  12829. d.promise()
  12830. }
  12831. }
  12832. }
  12833. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12834. }
  12835. , {
  12836. "../settings": 166,
  12837. "../util/browser": 182,
  12838. "../util/common": 185,
  12839. "../util/logger": 189,
  12840. "../util/texture": 194
  12841. }],
  12842. 107: [function(e, t, i) {
  12843. (function(i, n) {
  12844. "use strict";
  12845. function r(e) {
  12846. this.model = e,
  12847. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12848. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12849. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12850. , n = o.loadProto(t);
  12851. this.decoder = n.build("VisionModeldata")
  12852. }
  12853. var o = e("protobufjs")
  12854. , a = e("../util/ajax")
  12855. , s = (e("../util/common"),
  12856. e("../util/math"))
  12857. , l = e("../util/logger")
  12858. , c = new l(n);
  12859. r.prototype.load = function() {
  12860. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12861. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12862. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12863. $.when([]))
  12864. }
  12865. ,
  12866. r.prototype.loadVisionModelData = function() {
  12867. return a.get(this.modelDataPath, {
  12868. responseType: "arraybuffer"
  12869. }).then(function(e) {
  12870. var t;
  12871. try {
  12872. t = this.decoder.decode(e)
  12873. } catch (e) {
  12874. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12875. this.loadSweepLocationsCSV()
  12876. }
  12877. var i = t.sweepLocations.map(function(e) {
  12878. return {
  12879. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12880. position: {
  12881. x: e.pose.translation.x,
  12882. y: e.pose.translation.y,
  12883. z: e.pose.translation.z
  12884. },
  12885. quaternion: {
  12886. x: e.pose.rotation.x,
  12887. y: e.pose.rotation.y,
  12888. z: e.pose.rotation.z,
  12889. w: e.pose.rotation.w
  12890. },
  12891. puck: {
  12892. x: e.puck.x,
  12893. y: e.puck.y,
  12894. z: e.puck.z
  12895. },
  12896. floor: e.group,
  12897. neighbours: e.visibles,
  12898. alignmentType: e.alignment_type
  12899. }
  12900. }).map(function(e) {
  12901. return e.position = s.convertVisionVector(e.position),
  12902. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12903. e.puck = s.convertVisionVector(e.puck),
  12904. e
  12905. });
  12906. return i.forEach(function(e) {
  12907. e.neighbours = e.neighbours.map(function(e) {
  12908. return i[e].uuid
  12909. })
  12910. }),
  12911. i
  12912. }
  12913. .bind(this), function() {
  12914. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12915. this.loadSweepLocationsCSV()
  12916. }
  12917. .bind(this))
  12918. }
  12919. ,
  12920. r.prototype.loadSweepLocationsCSV = function() {
  12921. return a.get(this.sweepLocationsPath).then(function(e) {
  12922. var t = e.split("\n").map(function(e) {
  12923. return e.split(", ")
  12924. }).filter(function(e) {
  12925. return e.length > 1
  12926. }).map(function(e) {
  12927. return {
  12928. uuid: e[0],
  12929. position: {
  12930. x: parseFloat(e[1]),
  12931. y: parseFloat(e[2]),
  12932. z: parseFloat(e[3])
  12933. },
  12934. quaternion: {
  12935. x: parseFloat(e[4]),
  12936. y: parseFloat(e[5]),
  12937. z: parseFloat(e[6]),
  12938. w: parseFloat(e[7])
  12939. }
  12940. }
  12941. }).map(function(e) {
  12942. return e.position = s.convertVisionVector(e.position),
  12943. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12944. e
  12945. });
  12946. return t
  12947. }).fail(function() {
  12948. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12949. })
  12950. }
  12951. ,
  12952. t.exports = r
  12953. }
  12954. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12955. }
  12956. , {
  12957. "../util/ajax": 181,
  12958. "../util/common": 185,
  12959. "../util/logger": 189,
  12960. "../util/math": 190,
  12961. buffer: 198,
  12962. protobufjs: 214
  12963. }],
  12964. 108: [function(e, t, i) {
  12965. (function(i) {
  12966. "use strict";
  12967. function n() {
  12968. this.locale = null
  12969. }
  12970. var r = e("../settings")
  12971. , o = e("../util/common")
  12972. , a = e("../util/logger")
  12973. , s = e("../enum/Locale")
  12974. , l = new a(i);
  12975. n.prototype.init = function() {
  12976. var t;
  12977. switch (r.languageTag) {
  12978. case null:
  12979. case "en":
  12980. case s.EN_US:
  12981. this.locale = s.EN_US,
  12982. t = e("./strings-en-US");
  12983. break;
  12984. case "es":
  12985. case s.ES_MX:
  12986. this.locale = s.ES_MX,
  12987. t = e("./strings-es-MX");
  12988. break;
  12989. case "fr":
  12990. case s.FR_FR:
  12991. this.locale = s.FR_FR,
  12992. t = e("./strings-fr-FR");
  12993. break;
  12994. case "de":
  12995. case s.DE_DE:
  12996. this.locale = s.DE_DE,
  12997. t = e("./strings-de-DE");
  12998. break;
  12999. case "ru":
  13000. case s.RU_RU:
  13001. this.locale = s.RU_RU,
  13002. t = e("./strings-ru-RU");
  13003. break;
  13004. case "cn":
  13005. case s.CN_CN:
  13006. this.locale = s.CN_CN,
  13007. t = e("./strings-cn-CN");
  13008. break;
  13009. case "jp":
  13010. case s.JP_JP:
  13011. this.locale = s.JP_JP,
  13012. t = e("./strings-jp-JP");
  13013. break;
  13014. default:
  13015. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13016. this.locale = s.EN_US,
  13017. t = e("./strings-en-US")
  13018. }
  13019. l.info("Using locale '" + this.locale + "'"),
  13020. o.extendObject(this, t)
  13021. }
  13022. ,
  13023. n.prototype.localizeGUI = function() {
  13024. var e = document.querySelector("#gui-parent");
  13025. this.localizeTree(e),
  13026. this.localizeLoadingText()
  13027. }
  13028. ,
  13029. n.prototype.localizeLoadingText = function() {
  13030. // var e = document.querySelector("#loader-cont")
  13031. // , t = e.getAttribute("title");
  13032. // e.removeAttribute("title"),
  13033. // e.setAttribute("data-status", t),
  13034. // e.classList.add(this.locale),
  13035. document.querySelector("#help-dialog").classList.add(this.locale),
  13036. document.querySelector("#interaction-modal").classList.add(this.locale),
  13037. document.querySelector("#gui").classList.add(this.locale);
  13038. }
  13039. ,
  13040. n.prototype.localizeTree = function(e) {
  13041. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13042. if (e.nodeType === Node.TEXT_NODE)
  13043. t = e.data.match(n),
  13044. t && (i = t[1],
  13045. e.data = this.localizeText(i) || i);
  13046. else if (e.nodeType === Node.ELEMENT_NODE) {
  13047. var r = e.getAttribute("title");
  13048. r && (t = r.match(n),
  13049. t && (i = t[1],
  13050. e.setAttribute("title", this.localizeText(i) || i)))
  13051. }
  13052. for (e = e.firstChild; e; )
  13053. this.localizeTree(e),
  13054. e = e.nextSibling
  13055. }
  13056. ,
  13057. n.prototype.localizeText = function(t) {
  13058. var i = this[t];
  13059. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13060. i = e("./strings-en-US")[t]),
  13061. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13062. i
  13063. }
  13064. ,
  13065. t.exports = new n
  13066. }
  13067. ).call(this, "/js/localization/localize.js")
  13068. }
  13069. , {
  13070. "../enum/Locale": 31,
  13071. "../settings": 166,
  13072. "../util/common": 185,
  13073. "../util/logger": 189,
  13074. "./strings-cn-CN": 109,
  13075. "./strings-de-DE": 110,
  13076. "./strings-en-US": 111,
  13077. "./strings-es-MX": 112,
  13078. "./strings-fr-FR": 113,
  13079. "./strings-jp-JP": 114,
  13080. "./strings-ru-RU": 115
  13081. }],
  13082. 109: [function(e, t, i) {
  13083. "use strict";
  13084. t.exports = {
  13085. PAGE_TITLE: "",
  13086. LOADING: "正在加载",
  13087. PRESENTED_BY_CAPS: "呈现者:",
  13088. POWERED_BY: "技术支持:",
  13089. POWERED_BY_CAPS: "技术支持:",
  13090. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13091. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13092. PRESENTED_BY: "呈现者:",
  13093. MORE: "更多 ",
  13094. LESS: "更少 ",
  13095. TAG_CONTENT: "tag™ 内容",
  13096. SHOW: "显示",
  13097. HIDE: "隐藏",
  13098. DOLLHOUSE: "场景屋",
  13099. FLOOR_PLAN: "楼层平面图",
  13100. OPEN_HIGHLIGHTS: "打开精彩片段",
  13101. CLOSE_HIGHLIGHTS: "关闭",
  13102. PREVIOUS: "上一个",
  13103. PLAY: "播放",
  13104. PAUSE: "暂停",
  13105. NEXT: "下一个",
  13106. EXPLORE_3D_SPACE: "探索 3D 空间",
  13107. VIEW_DOLLHOUSE: "观看场景屋",
  13108. SOCIAL_SHARING: "分享这个空间",
  13109. VIEW_IN_VR: "以 VR 观看",
  13110. VIEW_FULLSCREEN: "全屏观看",
  13111. EXIT_FULLSCREEN: " 退出全屏",
  13112. ZOOM_IN: "放大",
  13113. ZOOM_OUT: "缩小",
  13114. FLOOR_NAME: "楼层",
  13115. FLOOR_ALL: "ALL",
  13116. FLOOR_Lang: ["Floor",""],
  13117. TERMS: "条款",
  13118. PORT_TERMS: "port 条款",
  13119. TERMS_OF_USE: "使用条款",
  13120. CLOSE_TERMS: "关闭",
  13121. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13122. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13123. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13124. WEBVR_ENTER_WEBVR: "进入 VR",
  13125. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13126. WEBVR_LEARN_MORE: "了解更多",
  13127. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13128. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13129. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13130. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13131. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13132. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13133. VR_LEARN_MORE_CAPS: "了解更多",
  13134. VR_PREVIOUS_CAPS: "上一个’,",
  13135. VR_NEXT_CAPS: "下一个",
  13136. VR_GOT_IT_CAPS: "明白了",
  13137. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13138. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13139. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13140. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13141. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13142. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13143. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13144. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13145. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13146. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13147. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13148. VR_APP: "port VR 应用程序",
  13149. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13150. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13151. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13152. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13153. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13154. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13155. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13156. VR_ANDROID_DVICES: "Android 设备",
  13157. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13158. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13159. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13160. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13161. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13162. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13163. VR_DOWNLOAD_HERE: "在此下载",
  13164. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13165. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13166. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13167. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13168. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13169. SHARE_TO: "分享到",
  13170. SHARE_LINK: "直接链接",
  13171. SHARE_EXPLORE: "探索",
  13172. SHARE_AT: "在",
  13173. SHARE_WITH: "使用",
  13174. SHARE_3D: "以 3D",
  13175. SHARE_COPIED: "已复制!",
  13176. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13177. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13178. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13179. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13180. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13181. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13182. ERROR_GENERIC_ACTIONS_3: " 或",
  13183. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13184. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13185. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13186. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13187. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13188. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13189. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13190. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13191. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13192. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13193. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13194. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13195. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13196. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13197. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13198. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13199. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13200. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13201. LINK_TO_LOCATION: "地点链接",
  13202. MENU_COPY: "复制",
  13203. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13204. ROTATE: "旋转",
  13205. MOVE: "移动",
  13206. INSIDE: "内部",
  13207. ZOOM: "缩放",
  13208. HELP: "小帮手",
  13209. HELP_NAVIGATION_TAB: "导航",
  13210. HELP_MORE_HELP_TAB: "更多帮助",
  13211. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13212. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13213. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13214. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13215. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13216. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13217. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13218. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13219. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13220. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13221. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13222. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13223. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13224. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13225. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13226. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13227. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13228. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13229. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13230. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13231. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13232. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13233. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13234. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13235. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13236. HELP_MORE_HLR_A: "精彩片段集锦",
  13237. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13238. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13239. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13240. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13241. HELP_MORE_FLOORS_A: "楼层选择器",
  13242. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13243. HELP_MORE_TAG_A: "tag™ 贴文",
  13244. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13245. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13246. HELP_MORE_ZOOM_A: "缩放控件",
  13247. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13248. HELP_MORE_TOUR_A: "导览控件",
  13249. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13250. HELP_MORE_INSIDE_A: "内部视图",
  13251. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13252. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13253. HELP_MORE_VR_A: "VR 模式",
  13254. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13255. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13256. HELP_MORE_360_A: "360° 视图",
  13257. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13258. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13259. HELP_MORE_FULLSCREEN_A: "全屏",
  13260. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13261. CLOSE: "关闭"
  13262. }
  13263. }
  13264. , {}],
  13265. 110: [function(e, t, i) {
  13266. "use strict";
  13267. t.exports = {
  13268. PAGE_TITLE: "",
  13269. LOADING: "Lädt",
  13270. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13271. POWERED_BY: "Angetrieben von",
  13272. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13273. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13274. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13275. PRESENTED_BY: "Präsentiert von ",
  13276. MORE: "Mehr ",
  13277. LESS: "Weniger ",
  13278. TAG_CONTENT: "tag™ Inhalt",
  13279. SHOW: "Anzeigen",
  13280. HIDE: "Verbergen",
  13281. DOLLHOUSE: "Puppenhaus",
  13282. FLOOR_PLAN: "Grundriss",
  13283. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13284. CLOSE_HIGHLIGHTS: "Schließen",
  13285. PREVIOUS: "Vorheriges",
  13286. PLAY: "Abspielen",
  13287. PAUSE: "Pausieren",
  13288. NEXT: "Nächstes",
  13289. EXPLORE_3D_SPACE: "Innenraum betreten",
  13290. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13291. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13292. VIEW_IN_VR: "In VR ansehen",
  13293. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13294. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13295. ZOOM_IN: "Vergrößern",
  13296. ZOOM_OUT: "Verkleinern",
  13297. FLOOR_NAME: "Etage ",
  13298. FLOOR_ALL: "Alle",
  13299. TERMS: "Bedingungen",
  13300. PORT_TERMS: "port Bedingungen",
  13301. TERMS_OF_USE: "Nutzungsbedingungen",
  13302. TERMS_TEXT_FILE: "terms-de-DE.html",
  13303. CLOSE_TERMS: "Schließen",
  13304. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13305. HELP: "Hilfe",
  13306. HELP_NAVIGATION_TAB: "Navigation",
  13307. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13308. CLOSE: "Schließen",
  13309. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13310. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13311. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13312. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13313. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13314. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13315. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13316. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13317. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13318. 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.",
  13319. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13320. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13321. 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.",
  13322. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13323. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13324. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13325. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13326. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13327. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13328. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13329. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13330. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13331. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13332. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13333. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13334. HELP_MORE_HLR_A: "Liste das Highlight",
  13335. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13336. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13337. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13338. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13339. HELP_MORE_FLOORS_A: "Etage auswählen",
  13340. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13341. HELP_MORE_TAG_A: "tag™ Posts",
  13342. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13343. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13344. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13345. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13346. HELP_MORE_TOUR_A: "Tour Steuerung",
  13347. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13348. HELP_MORE_INSIDE_A: "Innenansicht",
  13349. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13350. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13351. HELP_MORE_VR_A: "VR Modus",
  13352. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13353. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13354. HELP_MORE_360_A: "360° Views Ansicht ",
  13355. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13356. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13357. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13358. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13359. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13360. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13361. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13362. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13363. WEBVR_LEARN_MORE: "Mehr Infos",
  13364. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13365. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13366. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13367. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13368. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13369. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13370. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13371. VR_APP: "port VR App",
  13372. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13373. 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",
  13374. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13375. VR_APP_FOR_ANDROID: "port VR app für Android",
  13376. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13377. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13378. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13379. VR_PREVIOUS_CAPS: "ZURÜCK",
  13380. VR_NEXT_CAPS: "WEITER",
  13381. VR_GOT_IT_CAPS: "VERSTANDEN",
  13382. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13383. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13384. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13385. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13386. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13387. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13388. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13389. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13390. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13391. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13392. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13393. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13394. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13395. VR_ANDROID_DVICES: "Android Geräte",
  13396. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13397. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13398. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13399. VR_DOWNLOAD_HERE: "Hier runterladen",
  13400. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13401. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13402. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13403. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13404. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13405. SHARE_TO: "Teilen auf",
  13406. SHARE_LINK: "Direkter Link",
  13407. SHARE_EXPLORE: "Umsehen",
  13408. SHARE_AT: "auf",
  13409. SHARE_WITH: "mit",
  13410. SHARE_3D: "in 3D",
  13411. SHARE_COPIED: "Kopiert!",
  13412. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13413. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13414. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13415. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13416. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13417. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13418. ERROR_GENERIC_ACTIONS_3: " oder ",
  13419. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13420. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13421. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13422. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13423. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13424. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13425. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13426. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13427. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13428. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13429. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13430. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13431. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13432. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13433. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13434. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13435. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13436. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13437. LINK_TO_LOCATION: "Link zu",
  13438. MENU_COPY: "Kopieren",
  13439. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13440. ROTATE: "Drehen",
  13441. INSIDE: "Drinnen",
  13442. MOVE: "Bewegen",
  13443. ZOOM: "Vergrößern"
  13444. }
  13445. }
  13446. , {}],
  13447. 111: [function(e, t, i) {
  13448. "use strict";
  13449. t.exports = {
  13450. PAGE_TITLE: "",
  13451. LOADING: "Loading",
  13452. PRESENTED_BY_CAPS: "PRESENTED BY",
  13453. POWERED_BY: "powered by ",
  13454. POWERED_BY_CAPS: "POWERED BY",
  13455. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13456. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13457. PRESENTED_BY: "Presented by ",
  13458. MORE: "More ",
  13459. LESS: "Less ",
  13460. TAG_CONTENT: "tag™ Content",
  13461. SHOW: "Show",
  13462. HIDE: "Hide",
  13463. DOLLHOUSE: "Dollhouse",
  13464. FLOOR_PLAN: "Floor plan",
  13465. OPEN_HIGHLIGHTS: "Open Highlights",
  13466. CLOSE_HIGHLIGHTS: "Close",
  13467. PREVIOUS: "Previous",
  13468. PLAY: "Play",
  13469. PAUSE: "Pause",
  13470. NEXT: "Next",
  13471. EXPLORE_3D_SPACE: "Explore 3D Space",
  13472. VIEW_DOLLHOUSE: "View dollhouse",
  13473. SOCIAL_SHARING: "Share this Space",
  13474. VIEW_IN_VR: "View in VR",
  13475. VIEW_FULLSCREEN: "全屏",
  13476. EXIT_FULLSCREEN: "退出全屏",
  13477. ZOOM_IN: "Zoom in",
  13478. ZOOM_OUT: "Zoom out",
  13479. FLOOR_NAME: "Floor ",
  13480. FLOOR_ALL: "全部",
  13481. TERMS: "Terms",
  13482. PORT_TERMS: "port terms",
  13483. TERMS_OF_USE: "Terms of Use",
  13484. TERMS_TEXT_FILE: "terms-en-US.html",
  13485. CLOSE_TERMS: "Close",
  13486. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13487. HELP: "Help",
  13488. HELP_NAVIGATION_TAB: "Navigation",
  13489. HELP_MORE_HELP_TAB: "More Help",
  13490. CLOSE: "Close",
  13491. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13492. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13493. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13494. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13495. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13496. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13497. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13498. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13499. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13500. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13501. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13502. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13503. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13504. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13505. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13506. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13507. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13508. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13509. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13510. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13511. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13512. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13513. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13514. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13515. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13516. HELP_MORE_HLR_A: "Highlight Reel",
  13517. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13518. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13519. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13520. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13521. HELP_MORE_FLOORS_A: "Floor Selector",
  13522. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13523. HELP_MORE_TAG_A: "tag™ Posts",
  13524. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13525. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13526. HELP_MORE_ZOOM_A: "Zoom Controls",
  13527. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13528. HELP_MORE_TOUR_A: "Tour Controls",
  13529. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13530. HELP_MORE_INSIDE_A: "Inside View",
  13531. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13532. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13533. HELP_MORE_VR_A: "VR Mode",
  13534. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13535. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13536. HELP_MORE_360_A: "360° Views",
  13537. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13538. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13539. HELP_MORE_FULLSCREEN_A: "Full screen",
  13540. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13541. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13542. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13543. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13544. WEBVR_ENTER_WEBVR: "ENTER VR",
  13545. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13546. WEBVR_LEARN_MORE: "Learn more",
  13547. WEBVR_VIEW_SPACE: "View Space in VR",
  13548. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13549. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13550. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13551. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13552. VR_PREVIOUS_CAPS: "PREVIOUS",
  13553. VR_NEXT_CAPS: "NEXT",
  13554. VR_GOT_IT_CAPS: "GOT IT",
  13555. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13556. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13557. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13558. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13559. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13560. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13561. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13562. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13563. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13564. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13565. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13566. VR_APP: "port VR App",
  13567. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13568. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13569. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13570. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13571. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13572. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13573. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13574. VR_ANDROID_DVICES: "Android Devices",
  13575. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13576. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13577. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13578. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13579. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13580. VR_APP_OPEN: "Open with the port VR app instead",
  13581. VR_DOWNLOAD_HERE: "Download here",
  13582. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13583. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13584. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13585. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13586. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13587. SHARE_TO: "Share to",
  13588. SHARE_LINK: "Direct Link",
  13589. SHARE_EXPLORE: "Explore ",
  13590. SHARE_AT: "at",
  13591. SHARE_WITH: "with",
  13592. SHARE_3D: " in 3D",
  13593. SHARE_COPIED: "Copied!",
  13594. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13595. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13596. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13597. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13598. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13599. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13600. ERROR_GENERIC_ACTIONS_3: " or ",
  13601. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13602. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13603. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13604. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13605. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13606. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13607. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13608. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13609. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13610. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13611. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13612. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13613. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13614. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13615. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13616. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13617. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13618. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13619. LINK_TO_LOCATION: "Link to location",
  13620. MENU_COPY: "Copy",
  13621. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13622. ROTATE: "Rotate",
  13623. INSIDE: "Inside",
  13624. MOVE: "Move",
  13625. ZOOM: "Zoom"
  13626. }
  13627. }
  13628. , {}],
  13629. 112: [function(e, t, i) {
  13630. "use strict";
  13631. t.exports = {
  13632. PAGE_TITLE: "",
  13633. LOADING: "Cargando",
  13634. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13635. POWERED_BY: "potenciando por ",
  13636. POWERED_BY_CAPS: "POTENCIADO POR ",
  13637. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13638. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13639. PRESENTED_BY: "Presentado por ",
  13640. MORE: "Más ",
  13641. LESS: "Menos ",
  13642. TAG_CONTENT: "Contenido de tag™",
  13643. SHOW: "Mostrar",
  13644. HIDE: "Ocultar",
  13645. DOLLHOUSE: "Dollhouse",
  13646. FLOOR_PLAN: "Planos",
  13647. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13648. CLOSE_HIGHLIGHTS: "Cerrar",
  13649. PREVIOUS: "Anterior",
  13650. PLAY: "Play",
  13651. PAUSE: "Pausa",
  13652. NEXT: "Siguiente",
  13653. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13654. VIEW_DOLLHOUSE: "Ver dollhouse",
  13655. SOCIAL_SHARING: "Compartir este espacio",
  13656. VIEW_IN_VR: "Ver en realidad virtual",
  13657. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13658. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13659. ZOOM_IN: "Acercar",
  13660. ZOOM_OUT: "Alejar",
  13661. FLOOR_NAME: "Piso ",
  13662. FLOOR_ALL: "Todas",
  13663. TERMS: "Condiciones",
  13664. PORT_TERMS: "port términos de uso",
  13665. TERMS_OF_USE: "Términos de uso",
  13666. TERMS_TEXT_FILE: "terms-es-MX.html",
  13667. CLOSE_TERMS: "Cerrar",
  13668. 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.",
  13669. HELP: "Ayuda",
  13670. HELP_NAVIGATION_TAB: "Navegación",
  13671. HELP_MORE_HELP_TAB: "Más Ayuda",
  13672. CLOSE: "Cerrar",
  13673. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13674. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13675. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13676. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13677. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13678. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13679. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13680. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13681. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13682. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13683. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13684. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13685. 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.",
  13686. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13687. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13688. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13689. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13690. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13691. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13692. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13693. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13694. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13695. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13696. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13697. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13698. HELP_MORE_HLR_A: "Galería destacada",
  13699. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13700. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13701. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13702. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13703. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13704. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13705. HELP_MORE_TAG_A: "tag™ Posts",
  13706. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13707. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13708. HELP_MORE_ZOOM_A: "Controles de zoom",
  13709. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13710. HELP_MORE_TOUR_A: "Controles de recorrido",
  13711. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13712. HELP_MORE_INSIDE_A: "Vista interior",
  13713. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13714. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13715. HELP_MORE_VR_A: "Modo de realidad virtual",
  13716. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13717. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13718. HELP_MORE_360_A: "360° Views",
  13719. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13720. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13721. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13722. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13723. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13724. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13725. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13726. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13727. WEBVR_LEARN_MORE: "Más información",
  13728. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13729. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13730. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13731. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13732. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13733. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13734. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13735. VR_APP: "port VR App",
  13736. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13737. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13738. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13739. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13740. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13741. VR_PREVIOUS_CAPS: "ANTERIOR",
  13742. VR_NEXT_CAPS: "SIGUIENTE",
  13743. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13744. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13745. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13746. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13747. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13748. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13749. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13750. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13751. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13752. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13753. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13754. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13755. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13756. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13757. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13758. VR_ANDROID_DVICES: "Dispositivos Android",
  13759. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13760. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13761. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13762. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13763. VR_DOWNLOAD_HERE: "Descargar aquí",
  13764. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13765. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13766. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13767. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13768. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13769. SHARE_TO: "Compartir en",
  13770. SHARE_LINK: "Enlace directo",
  13771. SHARE_EXPLORE: "Explorar ",
  13772. SHARE_AT: "en",
  13773. SHARE_WITH: "con",
  13774. SHARE_3D: " en 3D",
  13775. SHARE_COPIED: "¡Copiado!",
  13776. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13777. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13778. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13779. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13780. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13781. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13782. ERROR_GENERIC_ACTIONS_3: " o ",
  13783. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13784. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13785. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13786. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13787. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13788. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13789. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13790. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13791. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13792. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13793. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13794. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13795. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13796. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13797. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13798. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13799. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13800. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13801. LINK_TO_LOCATION: "Enlace a la ubicación",
  13802. MENU_COPY: "Copiar",
  13803. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13804. ROTATE: "Girar",
  13805. INSIDE: "Interior",
  13806. MOVE: "Moverse",
  13807. ZOOM: "Acercar o alejar"
  13808. }
  13809. }
  13810. , {}],
  13811. 113: [function(e, t, i) {
  13812. "use strict";
  13813. t.exports = {
  13814. PAGE_TITLE: "",
  13815. LOADING: "Chargement",
  13816. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13817. POWERED_BY: "alimenté par ",
  13818. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13819. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13820. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13821. PRESENTED_BY: "Présenté par ",
  13822. MORE: "Plus ",
  13823. LESS: "Moins ",
  13824. TAG_CONTENT: "Contenu tag™",
  13825. SHOW: "Montrer",
  13826. HIDE: "Cacher",
  13827. DOLLHOUSE: "Dollhouse",
  13828. FLOOR_PLAN: "Plan de sol",
  13829. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13830. CLOSE_HIGHLIGHTS: "Fermer",
  13831. PREVIOUS: "Précédent",
  13832. PLAY: "Lecture",
  13833. PAUSE: "Pause",
  13834. NEXT: "Suivant",
  13835. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13836. VIEW_DOLLHOUSE: "Voir dollhouse",
  13837. SOCIAL_SHARING: "Partager cet espace",
  13838. VIEW_IN_VR: "Voir en VR",
  13839. VIEW_FULLSCREEN: "Plein écran",
  13840. EXIT_FULLSCREEN: "Fermer plein écran",
  13841. ZOOM_IN: "Zoom avant",
  13842. ZOOM_OUT: "Zoom arrière",
  13843. FLOOR_NAME: "Étage ",
  13844. FLOOR_ALL: "Tous",
  13845. TERMS: "Mentions légales",
  13846. PORT_TERMS: "port mentions légales",
  13847. TERMS_OF_USE: "Conditions d'utilisation",
  13848. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13849. CLOSE_TERMS: "Fermer",
  13850. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13851. HELP: "Aide",
  13852. HELP_NAVIGATION_TAB: "Navigation",
  13853. HELP_MORE_HELP_TAB: "Aide",
  13854. CLOSE: "Fermer",
  13855. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13856. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13857. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13858. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13859. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13860. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13861. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13862. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13863. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13864. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13865. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13866. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13867. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13868. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13869. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13870. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13871. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13872. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13873. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13874. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13875. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13876. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13877. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13878. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13879. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13880. HELP_MORE_HLR_A: "Carrousel",
  13881. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13882. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13883. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13884. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13885. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13886. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13887. HELP_MORE_TAG_A: "tag™ Posts",
  13888. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13889. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13890. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13891. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13892. HELP_MORE_TOUR_A: "Commandes de la visite",
  13893. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13894. HELP_MORE_INSIDE_A: "Vue intérieure",
  13895. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13896. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13897. HELP_MORE_VR_A: "Mode RV",
  13898. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13899. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13900. HELP_MORE_360_A: "Vues 360°",
  13901. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13902. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13903. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13904. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13905. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13906. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13907. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13908. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13909. WEBVR_LEARN_MORE: "En savoir plus",
  13910. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13911. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13912. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13913. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13914. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13915. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13916. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13917. VR_NEXT_CAPS: "SUIVANT",
  13918. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13919. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13920. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13921. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13922. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13923. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13924. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13925. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13926. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13927. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13928. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13929. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13930. VR_APP: "port VR App",
  13931. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13932. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13933. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13934. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13935. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13936. 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",
  13937. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13938. VR_ANDROID_DVICES: "Appareils Android",
  13939. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13940. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13941. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13942. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13943. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13944. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13945. VR_DOWNLOAD_HERE: "Télécharger ici",
  13946. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13947. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13948. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13949. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13950. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13951. SHARE_TO: "Partager sur",
  13952. SHARE_LINK: "Lien direct",
  13953. SHARE_EXPLORE: "Explorer ",
  13954. SHARE_AT: "à",
  13955. SHARE_WITH: "avec",
  13956. SHARE_3D: " en 3D",
  13957. SHARE_COPIED: "Copié!",
  13958. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13959. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13960. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13961. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13962. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13963. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13964. ERROR_GENERIC_ACTIONS_3: " ou ",
  13965. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13966. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13967. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13968. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13969. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13970. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13971. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13972. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13973. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13974. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13975. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13976. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13977. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13978. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13979. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13980. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13981. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13982. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13983. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13984. MENU_COPY: "Copie",
  13985. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13986. ROTATE: "Faire pivoter",
  13987. INSIDE: "Intérieure",
  13988. MOVE: "Se déplacer",
  13989. ZOOM: "Zoom"
  13990. }
  13991. }
  13992. , {}],
  13993. 114: [function(e, t, i) {
  13994. "use strict";
  13995. t.exports = {
  13996. PAGE_TITLE: "",
  13997. LOADING: "読み込み中",
  13998. PRESENTED_BY_CAPS: "PRESENTED BY",
  13999. POWERED_BY: "powered by",
  14000. POWERED_BY_CAPS: "POWERED BY",
  14001. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14002. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14003. PRESENTED_BY: "Presented by ",
  14004. MORE: "全て表示 ",
  14005. LESS: "閉じる ",
  14006. TAG_CONTENT: "tag™コンテンツ ",
  14007. SHOW: "表示",
  14008. HIDE: "非表示",
  14009. DOLLHOUSE: "ドールハウス",
  14010. FLOOR_PLAN: "フロアプラン",
  14011. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14012. CLOSE_HIGHLIGHTS: "閉じる",
  14013. PREVIOUS: "前へ",
  14014. PLAY: "再生",
  14015. PAUSE: "一時停止",
  14016. NEXT: "次へ",
  14017. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14018. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14019. SOCIAL_SHARING: "このSpaceを共有する",
  14020. VIEW_IN_VR: "VRで表示",
  14021. VIEW_FULLSCREEN: "フルスクリーン表示",
  14022. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14023. ZOOM_IN: "ズームイン",
  14024. ZOOM_OUT: "ズームアウト",
  14025. FLOOR_NAME: "フロア ",
  14026. FLOOR_ALL: "すべて",
  14027. TERMS: "規約",
  14028. PORT_TERMS: "port規約",
  14029. TERMS_OF_USE: "利用規約",
  14030. CLOSE_TERMS: "閉じる",
  14031. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14032. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14033. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14034. WEBVR_ENTER_WEBVR: "VRに入る",
  14035. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14036. WEBVR_LEARN_MORE: "もっと詳しく",
  14037. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14038. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14039. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14040. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14041. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14042. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14043. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14044. VR_PREVIOUS_CAPS: "前へ",
  14045. VR_NEXT_CAPS: "次へ",
  14046. VR_GOT_IT_CAPS: "了解",
  14047. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14048. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14049. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14050. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14051. VR_WHAT_YOU_NEED: "必要なもの",
  14052. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14053. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14054. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14055. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14056. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14057. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14058. VR_APP: "port VRアプリ",
  14059. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14060. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14061. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14062. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14063. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14064. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14065. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14066. VR_ANDROID_DVICES: "Androidデバイス",
  14067. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14068. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14069. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14070. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14071. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14072. VR_APP_OPEN: "port VRアプリで開く",
  14073. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14074. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14075. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14076. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14077. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14078. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14079. SHARE_TO: "共有先",
  14080. SHARE_LINK: "ダイレクトリンク",
  14081. SHARE_EXPLORE: "探索",
  14082. SHARE_AT: "場所",
  14083. SHARE_WITH: "使用アプリ",
  14084. SHARE_3D: "3Dで",
  14085. SHARE_COPIED: "コピーされました!",
  14086. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14087. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14088. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14089. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14090. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14091. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14092. ERROR_GENERIC_ACTIONS_3: "または",
  14093. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14094. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14095. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14096. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14097. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14098. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14099. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14100. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14101. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14102. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14103. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14104. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14105. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14106. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14107. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14108. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14109. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14110. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14111. LINK_TO_LOCATION: "ロケーションへのリンク",
  14112. MENU_COPY: "コピー",
  14113. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14114. ROTATE: "回転",
  14115. MOVE: "移動",
  14116. INSIDE: "内側",
  14117. ZOOM: "ズーム",
  14118. HELP: "ヘルプ",
  14119. HELP_NAVIGATION_TAB: "ナビゲーション",
  14120. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14121. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14122. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14123. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14124. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14125. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14126. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14127. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14128. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14129. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14130. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14131. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14132. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14133. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14134. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14135. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14136. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14137. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14138. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14139. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14140. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14141. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14142. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14143. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14144. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14145. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14146. HELP_MORE_HLR_A: "ハイライト",
  14147. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14148. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14149. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14150. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14151. HELP_MORE_FLOORS_A: "フロアセレクター",
  14152. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14153. HELP_MORE_TAG_A: "tag™ Posts",
  14154. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14155. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14156. HELP_MORE_ZOOM_A: "ズームコントロール",
  14157. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14158. HELP_MORE_TOUR_A: "ツアーコントロール",
  14159. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14160. HELP_MORE_INSIDE_A: "内側ビュー",
  14161. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14162. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14163. HELP_MORE_VR_A: "VRモード",
  14164. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14165. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14166. HELP_MORE_360_A: "360° Views",
  14167. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14168. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14169. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14170. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14171. CLOSE: "閉じる"
  14172. }
  14173. }
  14174. , {}],
  14175. 115: [function(e, t, i) {
  14176. "use strict";
  14177. t.exports = {
  14178. PAGE_TITLE: "",
  14179. LOADING: "Загрузка",
  14180. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14181. POWERED_BY: "разработано на платформе ",
  14182. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14183. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14184. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14185. PRESENTED_BY: "Представлено ",
  14186. MORE: "Больше ",
  14187. LESS: "Меньше ",
  14188. TAG_CONTENT: "tag™ Контент",
  14189. SHOW: "Показать",
  14190. HIDE: "Скрыть",
  14191. DOLLHOUSE: "Dollhouse",
  14192. FLOOR_PLAN: "Планировка",
  14193. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14194. CLOSE_HIGHLIGHTS: "Закрыть",
  14195. PREVIOUS: "Предыдущий",
  14196. PLAY: "Воспроизвести",
  14197. PAUSE: "Пауза",
  14198. NEXT: "Следующий",
  14199. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14200. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14201. SOCIAL_SHARING: "Поделиться этой моделью",
  14202. VIEW_IN_VR: "Посмотреть в VR",
  14203. VIEW_FULLSCREEN: "Полный экран",
  14204. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14205. ZOOM_IN: "Увеличить",
  14206. ZOOM_OUT: "Уменьшить",
  14207. FLOOR_NAME: "Этаж ",
  14208. FLOOR_ALL: "Все",
  14209. TERMS: "Условия",
  14210. PORT_TERMS: "Правила пользования",
  14211. TERMS_OF_USE: "Условия использования",
  14212. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14213. CLOSE_TERMS: "Закрыть",
  14214. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14215. HELP: "Помощь",
  14216. HELP_NAVIGATION_TAB: "Навигация",
  14217. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14218. CLOSE: "Закрыть",
  14219. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14220. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14221. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14222. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14223. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14224. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14225. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14226. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14227. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14228. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14229. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14230. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14231. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14232. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14233. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14234. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14235. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14236. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14237. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14238. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14239. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14240. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14241. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14242. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14243. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14244. HELP_MORE_HLR_A: "Фотоколлаж",
  14245. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14246. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14247. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14248. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14249. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14250. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14251. HELP_MORE_TAG_A: "tag™ Posts",
  14252. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14253. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14254. HELP_MORE_ZOOM_A: "Масштаб",
  14255. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14256. HELP_MORE_TOUR_A: "Управление Туром",
  14257. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14258. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14259. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14260. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14261. HELP_MORE_VR_A: "Режим VR",
  14262. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14263. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14264. HELP_MORE_360_A: "360° Views",
  14265. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14266. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14267. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14268. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14269. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14270. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14271. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14272. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14273. WEBVR_LEARN_MORE: "Узнать больше",
  14274. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14275. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14276. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14277. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14278. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14279. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14280. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14281. VR_APP: "port VR App",
  14282. VR_APP_OPEN: "Или открыть через приложение port VR",
  14283. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14284. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14285. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14286. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14287. VR_VIEW_SPACE: "Запустить модель в VR",
  14288. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14289. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14290. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14291. VR_GOT_IT_CAPS: "ЯСНО",
  14292. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14293. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14294. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14295. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14296. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14297. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14298. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14299. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14300. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14301. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14302. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14303. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14304. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14305. VR_ANDROID_DVICES: "Android устройства",
  14306. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14307. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14308. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14309. VR_DOWNLOAD_HERE: "Скачать здесь",
  14310. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14311. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14312. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14313. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14314. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14315. SHARE_TO: "Поделиться",
  14316. SHARE_LINK: "Прямая ссылка",
  14317. SHARE_EXPLORE: "просмотреть",
  14318. SHARE_AT: "на",
  14319. SHARE_WITH: "с",
  14320. SHARE_3D: "в 3D",
  14321. SHARE_COPIED: "Скопировано!",
  14322. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14323. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14324. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14325. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14326. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14327. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14328. ERROR_GENERIC_ACTIONS_3: " или ",
  14329. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14330. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14331. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14332. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14333. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14334. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14335. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14336. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14337. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14338. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14339. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14340. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14341. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14342. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14343. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14344. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14345. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14346. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14347. LINK_TO_LOCATION: "Ссылка на местоположение",
  14348. MENU_COPY: "Копировать",
  14349. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14350. ROTATE: "Вращать",
  14351. MOVE: "Передвигаться",
  14352. INSIDE: "Вид изнутри",
  14353. ZOOM: "Масштаб"
  14354. }
  14355. }
  14356. , {}],
  14357. 116: [function(e, t, i) {//main.js
  14358. (function(t) {
  14359. "use strict";
  14360. var modelProgressBase = 0.4;
  14361. var progressUpdate = function(e){ // 0 <= e <= 1
  14362. console.log('e1:'+e)
  14363. e = Math.round(modelProgressBase * e * 100);
  14364. console.log('e2:'+e)
  14365. var t = $('.progressbar');
  14366. t.find('.bar').css('width',e+'%');
  14367. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14368. t.find('.perc').text(e +'%'); //具体数字的百分比
  14369. }
  14370. $('#gui-loading').fadeIn(200);
  14371. progressUpdate(0.1)
  14372. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14373. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14374. var data = matcher(e);
  14375. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14376. data.user = {
  14377. "is_authenticated": false,
  14378. "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"]
  14379. }
  14380. try{//处理一下导览数据
  14381. data.model.images = data.model.images.filter(e=>{
  14382. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14383. if(e.locations && e.locations.length == 0)return;
  14384. return e
  14385. })
  14386. }catch(e){console.log(e) }
  14387. window.MP_PREFETCHED_MODELDATA = data;
  14388. data.model.summary = data.summary
  14389. data.model.name = data.name
  14390. for(let i in data){
  14391. data[i] == "false" && (data[i] = false)
  14392. }
  14393. progressUpdate(0.7);
  14394. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14395. if(data.weixinDesc){
  14396. g_weixinObj.desc = data.weixinDesc;
  14397. }
  14398. if(data.shareImgUrl){
  14399. g_weixinObj.imgUrl = data.shareImgUrl
  14400. }
  14401. window.wx && manage.weixinShare();
  14402. //初始画面
  14403. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14404. function E(e) {
  14405. $("<img/>").attr("src", e).on("load", function() {
  14406. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14407. $(this).remove()
  14408. })
  14409. }
  14410. })
  14411. function StartLoad(){//当加载完data后
  14412. function i() {
  14413. var e = Y.getModelIDFromQueryString();
  14414. if (!e)
  14415. return b(null, "loading-failed");
  14416. var t = Y.parseSidUrl(e)
  14417. , i = l()
  14418. , a = c()
  14419. , s = o()
  14420. , u = V.quickstart.enabled
  14421. , g = null
  14422. , m = null
  14423. , v = null
  14424. , w = null
  14425. , T = null
  14426. , x = null
  14427. , S = null
  14428. , M = null
  14429. , R = null
  14430. , P = null
  14431. , O = null
  14432. , L = null
  14433. , N = new ue;
  14434. r(s);
  14435. h({ //MP开头写法
  14436. urlBase: t.urlBase
  14437. }).then(function() {
  14438. return re.init(),
  14439. d(t, e) //getModel and load
  14440. }).then(function(e) {
  14441. progressUpdate(0.9)
  14442. return P = e,
  14443. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14444. startSource: i,
  14445. autoplay: V.autoplay,
  14446. quickstart: u
  14447. }),
  14448. P.urls.init()
  14449. }).then(function() {
  14450. return P.loadPanos()
  14451. }).then(function() {
  14452. m = X.getStartCameraOptions(P, P.panos),
  14453. S = A(P),
  14454. O = y(u, m.mode),
  14455. v = O.controls,
  14456. w = O.player,
  14457. T = O.director,
  14458. x = O.tagManager,
  14459. M = O.tileDownloader,
  14460. R = O.qualityManager,
  14461. L = O.panoRenderer,
  14462. C(P, S, O, s),
  14463. w.director = T,//xzw add
  14464. P.supportsTiles && M.start(),
  14465. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14466. u = !1);
  14467. var e = null;
  14468. if (u) {
  14469. de.warn("Quickstart engaged. Hold on to your knickers.");
  14470. var t = v.controls[D.PANORAMA];
  14471. g = new ie(R,S.scene,S.camera,t,s),
  14472. _(S, s, P),
  14473. e = g.load(m).then(function() {
  14474. S.addComponent(g),
  14475. S.once(le.AfterRender, function() {
  14476. de.warn("First render after quickstart load finished.")
  14477. })
  14478. })
  14479. }
  14480. window.flyToFirst = function(){//xzw add
  14481. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14482. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14483. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14484. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14485. };
  14486. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14487. }).then(function() {
  14488. return f(P, U.onProgress, i, !u, a)
  14489. }).then(function() {
  14490. if (m.quickstart = u,
  14491. I(P, S, O, s),
  14492. S.started || _(S, s, P),
  14493. H.modelLoaded(P, w, v, V.autoplay),
  14494. E(w, P, m, V.autoplay).done(function() {
  14495. T.autoTour()
  14496. }),
  14497. !P.supportsTiles) {
  14498. var e = new Z(P,w);
  14499. e.start()
  14500. }
  14501. u && (S.removeComponent(g),
  14502. g.destroy(),
  14503. m.pano.enter()),
  14504. U.init(P, T, w, v, S, m, H.getSessionId()),
  14505. U.endLoading(P, T, x),
  14506. S.once(le.AfterRender, function() {
  14507. N.setAppReadyTime();
  14508. var e = N.calcFullLoadingTime();
  14509. de.warn("Total load time: " + e / 1e3),
  14510. H.loadComplete(e),
  14511. window.parent.postMessage('loadComplete','*')
  14512. de.warn("First render after model load finished.")
  14513. try{
  14514. window.parent.postMessage('loadComplete','*')
  14515. }catch(e){
  14516. console.log(e)
  14517. }
  14518. }),
  14519. S.on(le.MemoryUsageUpdated, n)
  14520. }).fail(b.bind(this, e))
  14521. }
  14522. function n(e) {
  14523. ce.update(e)
  14524. }
  14525. function r(e) {
  14526. de.info("Version", "2.25.6-0-gd87e5b1"),
  14527. q.defaultMaxListeners = 1e3,
  14528. a(e),
  14529. s()
  14530. }
  14531. function o() {
  14532. return document.getElementById("player")
  14533. }
  14534. function a(e) {
  14535. e.addEventListener("dragenter", T, !1),
  14536. e.addEventListener("dragover", T, !1)
  14537. }
  14538. function s() {
  14539. F.valueFromHash("title", !0) || $(document).ready(function() {
  14540. var e = $(".model-title");
  14541. e.hide()
  14542. })
  14543. }
  14544. function l() {
  14545. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14546. }
  14547. function c() {
  14548. return {
  14549. panoElementsToLoad: 6,
  14550. modelElementsToLoad: 0,
  14551. totalElementsLoaded: 0,
  14552. totalElementsToLoad: 0,
  14553. totalPercentageLoaded: 0,
  14554. progressCallback: null
  14555. }
  14556. }
  14557. function h(e) {
  14558. return K.loadFeatureFlags(e).done(function(e) {
  14559. K.updateDependentSettings(e, V)
  14560. })
  14561. }
  14562. // function u(e) {
  14563. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14564. // responseType: "json",
  14565. // prefetchFrom: "config"
  14566. // }).then(function(e) {
  14567. // return e ? void j.extendObject(V.appConfig, e) : {}
  14568. // }, function(e) {
  14569. // return de.warn("Failed loading runtime config, using defaults."),
  14570. // $.when({})
  14571. // })
  14572. // }
  14573. function d(e, t) {
  14574. var i = B.getModel({
  14575. url: t,
  14576. floors: F.valueFromHash("f", !0),
  14577. autoload: !1
  14578. })
  14579. ;
  14580. return $.when(i, n).then(null, function(e) {
  14581. return this
  14582. })
  14583. }
  14584. function p(e, t, i, n, r) {
  14585. de.info("Model data loaded"),
  14586. de.debug("UUID: " + e.data.job.uuid),
  14587. J.init(K.getFlags()),
  14588. i && H.initKeen({
  14589. token: i,
  14590. appId: n
  14591. }),
  14592. H.initSegment({
  14593. model: e.sid,
  14594. version: "2.25.6-0-gd87e5b1",
  14595. startSource: r.startSource,
  14596. token: t,
  14597. autoplay: r.autoplay,
  14598. quickstart: r.quickstart
  14599. })
  14600. }
  14601. function f(e, t, i, n, r) {
  14602. return r.progressCallback = t,
  14603. H.sessionStart(),
  14604. e.load(n).progress(g.bind(this, r))
  14605. }
  14606. function g(e, t) {
  14607. e.modelElementsToLoad = t[1],
  14608. v(e),
  14609. m(e)
  14610. }
  14611. function m(e) {
  14612. e.totalElementsLoaded++,
  14613. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14614. //----许钟文-----------------模型进度条向后调整
  14615. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14616. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14617. console.log('pro:'+e.totalPercentageLoaded)
  14618. //---------------------------
  14619. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14620. }
  14621. function v(e) {
  14622. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14623. }
  14624. function A(e) {
  14625. var t = new x.PerspectiveCamera;
  14626. t.layers.enable(he.PANOMARKERS),
  14627. t.layers.enable(he.RETICULE),
  14628. t.layers.enable(he.TAG);
  14629. var i = new x.Scene
  14630. , n = new x.AmbientLight(16777215);
  14631. i.add(n),
  14632. // i.skybox = new W,
  14633. // i.add(i.skybox),
  14634. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14635. side: x.DoubleSide
  14636. })),
  14637. i.plane.position.y = 0,
  14638. i.plane.rotateX(-Math.PI / 2),
  14639. i.plane.material.visible = !1,
  14640. i.add(i.plane),
  14641. i.updateMatrixWorld(),
  14642. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14643. if (e.metadata && e.metadata.camera_position) {
  14644. var t = e.metadata.camera_position
  14645. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14646. n.position = t.clone(),
  14647. i.add(n);
  14648. var r = e.metadata.camera_quaternion
  14649. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14650. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14651. }
  14652. }),
  14653. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14654. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14655. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14656. var r = new te(i,t,z);
  14657. return r
  14658. }
  14659. function y(e, t) {
  14660. var i = e ? 1 : 1e3
  14661. , n = J.tilegen || J.imgopt ? 6 : 2;
  14662. n = F.valueFromHash("tileconc", n);
  14663. var r = new ne
  14664. , o = new ae({
  14665. concurrentDownloads: n
  14666. })
  14667. , a = new se
  14668. , s = new P
  14669. , l = new M
  14670. , c = new S(t)
  14671. , h = new R
  14672. , u = new O(i)
  14673. , d = new L
  14674. , p = new oe;
  14675. return {
  14676. qualityManager: r,
  14677. panoRenderer: a,
  14678. tileDownloader: o,
  14679. player: c,
  14680. director: l,
  14681. modelManager: s,
  14682. tagManager: p,
  14683. displayController: u,
  14684. labelDisplayController: d,
  14685. controls: h
  14686. }
  14687. }
  14688. function C(e, t, i, n) {
  14689. var r = i.controls
  14690. , o = i.qualityManager
  14691. , a = i.panoRenderer
  14692. , s = i.tileDownloader
  14693. , l = i.modelManager;
  14694. r.init(n, l),
  14695. ee.init(i.director, r, i.player, l, t),
  14696. o.init(l),
  14697. s.init(o),
  14698. a.init(t, s, o),
  14699. l.init(s, a, o),
  14700. l.addModel(e),
  14701. t.addComponent(G)
  14702. }
  14703. function I(e, t, i, n) {
  14704. var r = i.qualityManager
  14705. , o = i.panoRenderer
  14706. , a = i.tileDownloader
  14707. , s = i.modelManager
  14708. , l = i.player
  14709. , c = i.director
  14710. , h = i.tagManager
  14711. , u = i.displayController
  14712. , d = i.labelDisplayController
  14713. , p = i.controls;
  14714. t.scene.add(e),
  14715. t.qualityManager = r;
  14716. var f = {
  14717. camera: t.camera,
  14718. director: c,
  14719. modelManager: s,
  14720. tileDownloader: a,
  14721. panoRenderer: o,
  14722. qualityManager: r,
  14723. tagManager: h,
  14724. container: n,
  14725. controls: p
  14726. };
  14727. l.init(f),
  14728. l.setScene(t.scene),
  14729. h.init(s, l),
  14730. c.init(l, s),
  14731. u.init(c, l, s, h, n),
  14732. d.init(l, s, n),
  14733. z.bindEvents(l),
  14734. t.addComponent(h),
  14735. t.addComponent(l),
  14736. t.addComponent(o),
  14737. l.sceneRenderer = t; //xzw add 方便resize
  14738. }
  14739. function E(e, t, i, n) {
  14740. return de.info("Starting player in " + i.mode),
  14741. H.report(t.sid, "started-playing", n, i.quickstart),
  14742. e.start(i)
  14743. }
  14744. function b(e, t) {
  14745. de.error(t),
  14746. k.error(t),
  14747. H.report(e, "error-" + t)
  14748. }
  14749. function w(e) {
  14750. var t = F.details();
  14751. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14752. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14753. H.report(e, "error-webgl-generic"))
  14754. }
  14755. function _(e, t, i) {
  14756. try {
  14757. e.start(t)
  14758. } catch (e) {
  14759. throw de.warn(e.message),
  14760. w(i.sid),
  14761. e
  14762. }
  14763. }
  14764. function T(e) {
  14765. e.stopPropagation(),
  14766. e.preventDefault()
  14767. }
  14768. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14769. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  14770. g_HotImage = {
  14771. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14772. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14773. } ;
  14774. }
  14775. //czj 判断someData 有没有backgroundMusic 添加音乐
  14776. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14777. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  14778. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic//.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  14779. $("#volume").show();
  14780. }else if (g_version === "one"){
  14781. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14782. //g_bgAudio.src = manage.dealURL(src) ;
  14783. }
  14784. //隐藏公司logo
  14785. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  14786. showLogo();
  14787. }
  14788. e("./lib/three75-shim"),
  14789. e("./lib/array-polyfill"),
  14790. e("./lib/performance-polyfill"),
  14791. e("./lib/shaders/CopyShader.js"),
  14792. e("./lib/shaders/HorizontalBlurShader.js"),
  14793. e("./lib/shaders/VerticalBlurShader.js"),
  14794. e("./lib/postprocessing/EffectComposer.js"),
  14795. e("./lib/postprocessing/RenderPass.js"),
  14796. e("./lib/postprocessing/MaskPass.js"),
  14797. e("./lib/postprocessing/ShaderPass.js"),
  14798. window.Promise || (window.Promise = e("promise-polyfill"));
  14799. var x = e("three")
  14800. , _x = e("three")
  14801. , S = (e("./util/sentry"),
  14802. e("./player"))
  14803. , M = e("./director")
  14804. , R = e("./controls/CameraControls")
  14805. , P = e("./model/ModelManager")
  14806. , O = e("./DisplayController")
  14807. , L = e("./label/LabelDisplayController")
  14808. , D = e("./enum/Viewmode")
  14809. , N = e("./util/logger")
  14810. , B = e("./showcase")
  14811. , F = e("./util/browser")
  14812. , V = e("./settings")
  14813. , U = e("./gui/gui")
  14814. , k = e("./gui/error")
  14815. , H = e("./analytics")
  14816. , G = e("./util/transitions")
  14817. , z = e("./effects")
  14818. , W = e("./objects/Skybox")
  14819. , j = e("./util/common")
  14820. , Y = (e("./util/PanoramaCollection"),
  14821. e("./util/math"),
  14822. e("./util/showcase"))
  14823. , X = e("./util/camera")
  14824. , Z = (e("./objects/Panorama"),
  14825. e("./cameras/PanoramaCamera"),
  14826. e("./preloaders"))
  14827. , q = e("events").EventEmitter
  14828. , K = e("./featureflags")
  14829. , Q = (e("./util/lerp"),
  14830. e("./util/ajax"))
  14831. , J = e("./ab")
  14832. , ee = e("./sdk/automation.js")
  14833. , te = e("./scene/SceneRenderer")
  14834. , ie = e("./scene/QuickstartManager")
  14835. , ne = e("./tile/QualityManager.js")
  14836. , re = e("./localization/localize")
  14837. , oe = e("./tag/tagManager")
  14838. , ae = e("./tile/TileDownloader")
  14839. , se = e("./tile/PanoRenderer")
  14840. , le = (e("./enum/PanoSizeClass"),
  14841. e("./enum/PanoramaEvents"),
  14842. e("./enum/SceneRendererEvents"))
  14843. , ce = e("./gui/memoryUsage")
  14844. , he = e("./enum/RenderLayers")
  14845. , ue = e("./TimingData")
  14846. , de = new N(t);
  14847. N.level = V.logLevel,
  14848. N.consoleEnabled = V.console,
  14849. i()
  14850. }
  14851. }
  14852. ).call(this, "/js/main.js")
  14853. }
  14854. , {
  14855. "./DisplayController": 1,
  14856. "./TimingData": 2,
  14857. "./ab": 3,
  14858. "./analytics": 4,
  14859. "./cameras/PanoramaCamera": 7,
  14860. "./controls/CameraControls": 9,
  14861. "./director": 15,
  14862. "./effects": 16,
  14863. "./enum/PanoSizeClass": 36,
  14864. "./enum/PanoramaEvents": 37,
  14865. "./enum/RenderLayers": 41,
  14866. "./enum/SceneRendererEvents": 43,
  14867. "./enum/Viewmode": 51,
  14868. "./featureflags": 59,
  14869. "./gui/error": 64,
  14870. "./gui/gui": 65,
  14871. "./gui/memoryUsage": 73,
  14872. "./label/LabelDisplayController": 91,
  14873. "./lib/array-polyfill": 92,
  14874. "./lib/performance-polyfill": 95,
  14875. "./lib/postprocessing/EffectComposer.js": 96,
  14876. "./lib/postprocessing/MaskPass.js": 97,
  14877. "./lib/postprocessing/RenderPass.js": 98,
  14878. "./lib/postprocessing/ShaderPass.js": 99,
  14879. "./lib/shaders/CopyShader.js": 100,
  14880. "./lib/shaders/HorizontalBlurShader.js": 101,
  14881. "./lib/shaders/VerticalBlurShader.js": 102,
  14882. "./lib/three75-shim": 103,
  14883. "./localization/localize": 108,
  14884. "./tag/tagManager": 124,
  14885. "./model/ModelManager": 140,
  14886. "./objects/Panorama": 148,
  14887. "./objects/Skybox": 152,
  14888. "./player": 155,
  14889. "./preloaders": 156,
  14890. "./scene/QuickstartManager": 157,
  14891. "./scene/SceneRenderer": 158,
  14892. "./sdk/automation.js": 164,
  14893. "./settings": 166,
  14894. "./showcase": 168,
  14895. "./tile/PanoRenderer": 169,
  14896. "./tile/QualityManager.js": 170,
  14897. "./tile/TileDownloader": 171,
  14898. "./util/PanoramaCollection": 178,
  14899. "./util/ajax": 181,
  14900. "./util/browser": 182,
  14901. "./util/camera": 183,
  14902. "./util/common": 185,
  14903. "./util/lerp": 188,
  14904. "./util/logger": 189,
  14905. "./util/math": 190,
  14906. "./util/sentry": 192,
  14907. "./util/showcase": 193,
  14908. "./util/transitions": 195,
  14909. events: 202,
  14910. "promise-polyfill": 213,
  14911. three: 217
  14912. }],
  14913. 117: [function(e, t, i) {
  14914. "use strict";
  14915. function n(e) {
  14916. e = e || {},
  14917. r.RawShaderMaterial.call(this, a.extendObject({
  14918. fragmentShader: o.cube.fragmentShader,
  14919. vertexShader: o.cube.vertexShader,
  14920. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14921. name: "CubemapMaterial"
  14922. }, e))
  14923. }
  14924. var r = e("three")
  14925. , o = e("../shaders")
  14926. , a = e("../util/common");
  14927. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14928. n.prototype.constructor = n,
  14929. t.exports = n
  14930. }
  14931. , {
  14932. "../shaders": 167,
  14933. "../util/common": 185,
  14934. three: 217
  14935. }],
  14936. 118: [function(e, t, i) {
  14937. "use strict";
  14938. function n(e) {
  14939. e = e || {},
  14940. r.RawShaderMaterial.call(this, a.extendObject({
  14941. fragmentShader: o.model.fragmentShader,
  14942. vertexShader: o.model.vertexShader,
  14943. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14944. name: "ModelTextureMaterial"
  14945. }, e))
  14946. }
  14947. var r = e("three")
  14948. , o = e("../shaders")
  14949. , a = e("../util/common");
  14950. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14951. n.prototype.constructor = n,
  14952. n.prototype.setProjectedPanos = function(e, t, i) {
  14953. i && (this.uniforms.progress.value = 0),
  14954. e.ensureSkyboxReadyForRender(),
  14955. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14956. this.uniforms.pano0Position.value.copy(e.position),
  14957. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14958. t.ensureSkyboxReadyForRender(),
  14959. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14960. this.uniforms.pano1Position.value.copy(t.position),
  14961. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14962. }
  14963. ,
  14964. t.exports = n
  14965. }
  14966. , {
  14967. "../shaders": 167,
  14968. "../util/common": 185,
  14969. three: 217
  14970. }],
  14971. 119: [function(e, t, i) {
  14972. (function(i) {
  14973. "use strict";
  14974. function n(e, t, i, n) {
  14975. this.div = null,
  14976. this.body = null,
  14977. this.label = e,
  14978. this.description = t,
  14979. this.parsedDescription = [],
  14980. this.media = i || {
  14981. type: null
  14982. },
  14983. this.loadingSpinner = null,
  14984. this.parser = new r({
  14985. supportLinks: !u.valueFromHash("mls"),
  14986. keepLinkLabels: !0
  14987. }),
  14988. this.state = I.CLOSED,
  14989. this.orientation = "",
  14990. this.initialTransform = "",
  14991. this.hovering = !1,
  14992. this.openTransition = null,
  14993. this.closeTransition = null,
  14994. this.openPromise = null,
  14995. this.closePromise = null,
  14996. this.animationTransition = null,
  14997. this.animationScale = 0
  14998. }
  14999. var r = e("../Parser/DescriptionParser")
  15000. , o = e("../Media/Link")
  15001. , a = e("../Media/Image")
  15002. , s = e("../Media/EmbedlyPlayer")
  15003. , l = e("../Media/EmbedlyEmbed")
  15004. , c = e("../../util/transitions")
  15005. , h = e("../../util/lerp")
  15006. , u = e("../../util/browser")
  15007. , d = e("./BillboardEvent")
  15008. , p = e("../Media/MediaEvent")
  15009. , f = e("../Parser/DescriptionChunkType")
  15010. , g = e("events").EventEmitter
  15011. , m = e("./billboardSettings")
  15012. , v = e("./overlaySettings")
  15013. , A = e("../../util/logger")
  15014. , y = new A(i)
  15015. , C = document.getElementById("tag-billboards");
  15016. C.addEventListener("touchend", function(e) {
  15017. C.style.pointerEvents = "none"
  15018. }),
  15019. C.addEventListener("touchcancel", function(e) {
  15020. C.style.pointerEvents = "none"
  15021. });
  15022. var I = {
  15023. CLOSED: "closed",
  15024. OPENING: "opening",
  15025. OPEN: "open",
  15026. CLOSING: "closing",
  15027. ACTIVE: "active"
  15028. };
  15029. n.prototype = Object.create(g.prototype),
  15030. n.prototype.build = function(e) {
  15031. this.parsedDescription = this.parser.parse(this.description);
  15032. var t = document.createElement("div");
  15033. t.className = "tag-container has-hotzone",
  15034. this.div = t,
  15035. this.body = document.createElement("div"),
  15036. this.body.className = "tag-body";
  15037. var i = document.createElement("div");
  15038. i.classList.add("tag-content");
  15039. var n = document.createElement("div");
  15040. n.classList.add("tag-text-content");
  15041. var r = document.createElement("div");
  15042. r.className = "tag-label",
  15043. r.textContent = this.label,
  15044. n.appendChild(r);
  15045. var o = document.createElement("div");
  15046. o.className = "tag-desc",
  15047. n.appendChild(o),
  15048. i.appendChild(n),
  15049. this.body.appendChild(i),
  15050. this.appendDescriptionElements(this.parsedDescription, o),
  15051. this.appendMedia(),
  15052. t.appendChild(this.body),
  15053. C.appendChild(t),
  15054. this.bindEvents(t, this.body)
  15055. }
  15056. ,
  15057. n.prototype.bindEvents = function(e, t) {
  15058. var i = function(e) {
  15059. return function(t) {
  15060. if (!this.div.classList.contains("overlay")) {
  15061. var i, n = document.getElementById("player");
  15062. try {
  15063. i = new MouseEvent(e,t)
  15064. } catch (n) {
  15065. i = document.createEvent("MouseEvents"),
  15066. 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)
  15067. }
  15068. n.dispatchEvent(i)
  15069. }
  15070. }
  15071. };
  15072. t.addEventListener("mousedown", function(e) {
  15073. e.stopPropagation()
  15074. }),
  15075. t.addEventListener("mouseup", function(e) {
  15076. e.stopPropagation()
  15077. }),
  15078. e.addEventListener("touchstart", function(e) {
  15079. C.style.pointerEvents = "auto"
  15080. }),
  15081. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15082. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15083. t.addEventListener("mouseover", function(t) {
  15084. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15085. }
  15086. .bind(this)),
  15087. e.addEventListener("mouseenter", function(e) {
  15088. this.state !== I.CLOSING && (this.hovering = !0,
  15089. this.emit(d.ENTER))
  15090. }
  15091. .bind(this)),
  15092. e.addEventListener("mouseleave", function(e) {
  15093. this.hovering = !1,
  15094. this.emit(d.LEAVE)
  15095. }
  15096. .bind(this)),
  15097. e.addEventListener("gesturestart", function(e) {
  15098. e.preventDefault()
  15099. });
  15100. var n = e.querySelector(".tag-text-content")
  15101. , r = 0;
  15102. n.addEventListener("touchstart", function(e) {
  15103. r = e.changedTouches[0].clientY
  15104. }),
  15105. n.addEventListener("touchmove", function(t) {
  15106. function i(e) {
  15107. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15108. }
  15109. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15110. }),
  15111. e.addEventListener("touchmove", function(e) {
  15112. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15113. })
  15114. }
  15115. ,
  15116. n.prototype.appendDescriptionElements = function(e, t) {
  15117. e.length > 0 && this.div.classList.add("has-text"),
  15118. e.forEach(function(e, i) {
  15119. switch (e.type) {
  15120. case f.TEXT:
  15121. t.appendChild(this.createTextElement(e.text));
  15122. break;
  15123. case f.LINK:
  15124. t.appendChild(this.createLinkElement(e.link))
  15125. }
  15126. }
  15127. .bind(this))
  15128. }
  15129. ,
  15130. n.prototype.appendLoadingSpinner = function() {
  15131. this.loadingSpinner = document.createElement("div"),
  15132. this.loadingSpinner.classList.add("loading-spinner");
  15133. var e = document.createElement("div");
  15134. e.classList.add("gui-spinner-icon"),
  15135. this.loadingSpinner.appendChild(e),
  15136. this.body.appendChild(this.loadingSpinner)
  15137. }
  15138. ,
  15139. n.prototype.onMediaLoadFinished = function() {
  15140. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15141. this.applyOrientation(this.orientation),
  15142. this.loadingSpinner = null)
  15143. }
  15144. ,
  15145. n.prototype.appendMedia = function() {
  15146. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15147. this.appendLoadingSpinner();
  15148. var e = document.createElement("div");
  15149. e.classList.add("tag-media-content");
  15150. var t = document.createElement("i");
  15151. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15152. t.classList.add(e)
  15153. }),
  15154. this.body.appendChild(t),
  15155. this.body.appendChild(e),
  15156. this.media.type) {
  15157. case f.IMAGE:
  15158. e.appendChild(this.createImageElement(this.media, this.body));
  15159. break;
  15160. case f.VIDEO:
  15161. e.appendChild(this.createVideoElement(this.media, this.body));
  15162. break;
  15163. case f.RICH:
  15164. e.appendChild(this.createEmbedElement(this.media, this.body))
  15165. }
  15166. }
  15167. }
  15168. ,
  15169. n.prototype.createTextElement = function(e) {
  15170. var t = document.createElement("span");
  15171. return t.textContent = e,
  15172. t
  15173. }
  15174. ;
  15175. n.prototype.createLinkElement = function(e) {
  15176. var t = new o(e);
  15177. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15178. t.createDomElement()
  15179. }
  15180. ,
  15181. n.prototype.createImageElement = function(e, t) {
  15182. function i() {
  15183. function e() {
  15184. m || (r.classList.remove("view-image"),
  15185. c.classList.add("overlay"),
  15186. i(),
  15187. window.addEventListener("resize", b),
  15188. c.addEventListener("click", a),
  15189. g.addEventListener("click", l),
  15190. f.addEventListener("click", s),
  15191. m = !0,
  15192. o.emit(p.IMAGE_OPENED))
  15193. }
  15194. function i() {
  15195. t.classList.add("show-info"),
  15196. h.classList.remove("collapsible"),
  15197. h.style.height = "";
  15198. var e = parseFloat(getComputedStyle(I).lineHeight)
  15199. , i = y + e
  15200. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15201. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15202. , s = a
  15203. , l = s * n.aspect;
  15204. l > r && (l = r,
  15205. s = l / n.aspect),
  15206. s > a && (s = a,
  15207. l = s * n.aspect),
  15208. l += C,
  15209. s += C + i,
  15210. t.style.width = l + "px",
  15211. t.style.height = s + "px",
  15212. u.style.paddingTop = e + C + "px",
  15213. o.description.length > 0 && (h.classList.add("collapsible"),
  15214. h.style.height = h.clientHeight + 12 + "px",
  15215. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15216. }
  15217. function a(e) {
  15218. e.target === c && s()
  15219. }
  15220. function s() {
  15221. m && (m = !1,
  15222. r.classList.add("view-image"),
  15223. c.classList.remove("overlay"),
  15224. h.style.height = "",
  15225. u.style.paddingTop = "",
  15226. t.style.width = "",
  15227. t.style.height = "",
  15228. window.removeEventListener("resize", b),
  15229. c.removeEventListener("click", a),
  15230. g.removeEventListener("click", l),
  15231. f.removeEventListener("click", s),
  15232. o.emit(p.IMAGE_CLOSED),
  15233. o.close(!0))
  15234. }
  15235. function l(e) {
  15236. t.classList.toggle("show-info")
  15237. }
  15238. var c = o.div
  15239. , h = c.getElementsByClassName("tag-content")[0]
  15240. , u = c.getElementsByClassName("tag-media-content")[0]
  15241. , f = t.getElementsByClassName("close")[0]
  15242. , g = h.getElementsByClassName("tag-label")[0];
  15243. c.classList.add("has-image"),
  15244. r.classList.add("view-image"),
  15245. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15246. o.applyOrientation(o.orientation);
  15247. var m = !1
  15248. , A = getComputedStyle(h)
  15249. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15250. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15251. , I = h.querySelector(".tag-label")
  15252. , E = h.querySelector(".tag-desc")
  15253. , b = function() {
  15254. var e, t, n = 0;
  15255. return function() {
  15256. clearInterval(e),
  15257. clearTimeout(t),
  15258. e = setInterval(function() {
  15259. var e = c.clientHeight;
  15260. n !== e && (i(),
  15261. n = e)
  15262. }, 100),
  15263. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15264. }
  15265. }();
  15266. n.on(p.IMAGE_OPENING, e),
  15267. o.on(d.ACTIVATE, e),
  15268. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15269. o.on(d.CLOSING, s)
  15270. }
  15271. var n = new a
  15272. , r = n.createDomElement();
  15273. this.once(d.OPENED, function() {
  15274. n.load(e.src).then(i).catch(function(t) {
  15275. y.warn("Failed to load image:", e.src),
  15276. y.warn("with error:", t)
  15277. }).then(this.onMediaLoadFinished.bind(this))
  15278. });
  15279. var o = this;
  15280. return r
  15281. }
  15282. ,
  15283. n.prototype.createVideoElement = function(e, t) {
  15284. var i = new s({
  15285. autoPlay: !0,
  15286. autoResume: !0,
  15287. startMuted: !1,
  15288. loop: !1
  15289. })
  15290. , n = i.createDomElement();
  15291. return this.once(d.OPENED, function() {
  15292. i.load(e.src).then(function() {
  15293. this.div.classList.add("has-video"),
  15294. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15295. i.play()),
  15296. this.on(d.OPENING, i.show.bind(i)),
  15297. this.on(d.OPENED, i.play.bind(i)),
  15298. this.on(d.CLOSING, i.pause.bind(i)),
  15299. this.on(d.CLOSED, i.hide.bind(i))
  15300. }
  15301. .bind(this)).catch(function(t) {
  15302. y.warn("Failed to embed video:", e.src),
  15303. y.warn("with error:", t)
  15304. }).then(this.onMediaLoadFinished.bind(this))
  15305. }
  15306. .bind(this)),
  15307. n
  15308. }
  15309. ,
  15310. n.prototype.createEmbedElement = function(e, t) {
  15311. var i = new l
  15312. , n = i.createDomElement();
  15313. return this.once(d.OPENED, function() {
  15314. i.load(e.src).then(function() {
  15315. this.div.classList.add("has-embed"),
  15316. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15317. this.applyOrientation(this.orientation),
  15318. this.on(d.OPENING, i.show.bind(i)),
  15319. this.on(d.CLOSED, i.hide.bind(i))
  15320. }
  15321. .bind(this)).catch(function(t) {
  15322. y.warn("Failed to embed:", e.src),
  15323. y.warn("with error:", t)
  15324. }).then(this.onMediaLoadFinished.bind(this))
  15325. }
  15326. .bind(this)),
  15327. n
  15328. }
  15329. ,
  15330. n.prototype.open = function(e) {
  15331. return this.openPromise = $.Deferred(),
  15332. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15333. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15334. this.state !== I.OPEN && (this.emit(d.OPENING),
  15335. e && this.emit(d.ACTIVATING),
  15336. this.state = I.OPENING,
  15337. this.animateOpen(function() {
  15338. e && this.setActiveState(),
  15339. this.openPromise.resolve()
  15340. }
  15341. .bind(this)))
  15342. }
  15343. .bind(this), m.animation.openDelay),
  15344. c.cancel(this.closeTransition),
  15345. this.closePromise && this.closePromise.reject(),
  15346. this.closeTransition = void 0,
  15347. this.openPromise.promise())
  15348. }
  15349. ,
  15350. n.prototype.close = function(e) {
  15351. return this.closePromise = $.Deferred(),
  15352. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15353. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15354. this.state = I.CLOSING,
  15355. this.animateClose())
  15356. }
  15357. .bind(this), m.animation.closeDelay)),
  15358. c.cancel(this.openTransition),
  15359. this.openPromise && this.openPromise.reject(),
  15360. this.openTransition = void 0,
  15361. this.closePromise.resolve(),
  15362. this.closePromise.promise())
  15363. }
  15364. ,
  15365. n.prototype.setActiveState = function() {
  15366. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15367. this.emit(d.ACTIVATE),
  15368. this.div.classList.remove("has-hotzone"))
  15369. }
  15370. ,
  15371. n.prototype.animateOpen = function(e) {
  15372. if (this.state === I.OPENING) {
  15373. if (c.cancel(this.animationTransition),
  15374. u.detectSamsungNative())
  15375. return this.boardOrientation = null,
  15376. this.div.style.visibility = "visible",
  15377. this.emit(d.OPENED),
  15378. this.state = I.OPEN,
  15379. void (e && e());
  15380. this.div.style.webkitTransform = "scale(0)",
  15381. this.div.style.transform = "scale(0)",
  15382. this.div.style.visibility = "visible",
  15383. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15384. this.emit(d.OPENED),
  15385. this.state = I.OPEN,
  15386. e && e()
  15387. }
  15388. .bind(this))
  15389. }
  15390. }
  15391. ,
  15392. n.prototype.animateClose = function(e) {
  15393. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15394. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15395. this.emit(d.CLOSED),
  15396. this.state = I.CLOSED,
  15397. this.div.style.visibility = "hidden",
  15398. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15399. e && e()
  15400. }
  15401. .bind(this)))
  15402. }
  15403. ,
  15404. n.prototype.needsUpdate = function() {
  15405. return this.state !== I.CLOSED
  15406. }
  15407. ,
  15408. n.prototype.update = function(e, t) {
  15409. if (this.needsUpdate()) {
  15410. var i = (this.updateOrientation(e),
  15411. this.calcScale(t))
  15412. , n = {
  15413. x: (e.x + 1) * $("#player").width() / 2,
  15414. y: (e.y + 1) * $("#player").height() / 2
  15415. };
  15416. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15417. this.div.style.webkitTransform = this.div.screenTransform,
  15418. this.div.style.transform = this.div.screenTransform
  15419. }
  15420. }
  15421. ,
  15422. n.prototype.getDimensions = function() {
  15423. return this.div.getBoundingClientRect()
  15424. }
  15425. ,
  15426. n.prototype.calcScale = function(e) {
  15427. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15428. }
  15429. ,
  15430. n.prototype.updateOrientation = function(e) {
  15431. if (this.state !== I.ACTIVE) {
  15432. var t = 1 / 3
  15433. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15434. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15435. , r = "";
  15436. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15437. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15438. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15439. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15440. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15441. }
  15442. }
  15443. ,
  15444. n.prototype.applyOrientation = function(e) {
  15445. this.div.style.transform = this.div.style.webkitTransform = "",
  15446. this.div.classList.remove("tag-container-" + this.orientation),
  15447. this.div.classList.add("tag-container-" + e);
  15448. var t = window.getComputedStyle(this.div);
  15449. this.initialTransform = t.transform || t.webkitTransform,
  15450. "none" === this.initialTransform && (this.initialTransform = "");
  15451. var i = t.transform.slice(7, -1).split(",")
  15452. , n = -i[4]
  15453. , r = -i[5];
  15454. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15455. this.div.style.transformOrigin = n + "px " + r + "px",
  15456. this.orientation = e
  15457. }
  15458. ,
  15459. t.exports = n
  15460. }
  15461. ).call(this, "/js/tag/Billboard/Billboard.js")
  15462. }
  15463. , {
  15464. "../../util/browser": 182,
  15465. "../../util/lerp": 188,
  15466. "../../util/logger": 189,
  15467. "../../util/transitions": 195,
  15468. "../Media/EmbedlyEmbed": 125,
  15469. "../Media/EmbedlyPlayer": 126,
  15470. "../Media/Image": 128,
  15471. "../Media/Link": 129,
  15472. "../Media/MediaEvent": 131,
  15473. "../Parser/DescriptionChunkType": 133,
  15474. "../Parser/DescriptionParser": 134,
  15475. "./BillboardEvent": 120,
  15476. "./billboardSettings": 121,
  15477. "./overlaySettings": 122,
  15478. events: 202
  15479. }],
  15480. 120: [function(e, t, i) {
  15481. "use strict";
  15482. t.exports = Object.freeze({
  15483. ENTER: "billboard.enter",
  15484. LEAVE: "billboard.leave",
  15485. OPENING: "billboard.opening",
  15486. OPENED: "billboard.open",
  15487. CLOSING: "billboard.closing",
  15488. CLOSED: "billboard.closed",
  15489. ACTIVATING: "billboard.activating",
  15490. ACTIVATE: "billboard.activate"
  15491. })
  15492. }
  15493. , {}],
  15494. 121: [function(e, t, i) {
  15495. "use strict";
  15496. t.exports = Object.freeze({
  15497. animation: Object.freeze({
  15498. hoverOnClosing: !1,
  15499. openDelay: 100,
  15500. closeDelay: 50,
  15501. openDuration: 200,
  15502. closeDuration: 100
  15503. }),
  15504. boardToDiscRatio: 1.2
  15505. })
  15506. }
  15507. , {}],
  15508. 122: [function(e, t, i) {
  15509. "use strict";
  15510. t.exports = Object.freeze({
  15511. boundaryWidth: 30,
  15512. boundaryHeight: 0
  15513. })
  15514. }
  15515. , {}],
  15516. /*********************************创建热点模型************************************************** */
  15517. "hot": [function(e, t, i) {//热点
  15518. "use strict";
  15519. function hot(sid,d,model){
  15520. this.sid = sid;
  15521. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15522. if(d.quaternion){
  15523. this.quaternion = d.quaternion;
  15524. }else{
  15525. this.rotation = this.conversionArray(d.rotation)
  15526. } */
  15527. this.position = this.convertValue(d.position, r.Vector3)
  15528. if(d.quaternion){
  15529. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15530. }else{
  15531. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15532. }
  15533. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15534. this.isSprite = d.isSprite
  15535. this.actionType = (d.noAction ? 'noAction' : d.actionType) || "common"
  15536. this.linkType = d.linkType || "common"
  15537. this.link = d.link;
  15538. this.model = model;
  15539. this.size = d.size;
  15540. this.infoAttribute = d.infoAttribute || {};
  15541. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15542. this.transformAtPanos = d.transformAtPanos || {}
  15543. for (let i in this.transformAtPanos) {
  15544. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15545. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15546. }
  15547. this.build();
  15548. d.infoAttribute && d.infoAttribute.title && this.setTitleElem(d.infoAttribute.title)
  15549. this.changeTex()
  15550. this.visibleData = d.visiblePanos
  15551. //this.setVisiblePanos(d.visiblePanos);
  15552. }
  15553. var r = e("three")
  15554. , f = e("../shaders")
  15555. , a = e("../settings")
  15556. , s = e("../enum/Viewmode")
  15557. , p = e("../objects/Panorama")
  15558. , math = e("../util/math")
  15559. , te = e("../util/texture");
  15560. var raycaster = new r.Raycaster;
  15561. //热点大小
  15562. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15563. var defaultTex1 = te.load(g_HotImage.point);
  15564. var defaultTex2 = te.load(g_HotImage.point2);
  15565. hot.prototype.changeTex = function(){
  15566. var u = this.mesh.material.uniforms
  15567. if(this.styleImg.length){
  15568. u.texture1.value = te.load(this.styleImg[0].src);
  15569. u.texture2.value = te.load(this.styleImg[1]&&this.styleImg[1].src || this.styleImg[0].src);
  15570. }else{
  15571. u.texture1.value = defaultTex1;
  15572. u.texture2.value = defaultTex2;
  15573. }
  15574. }
  15575. hot.prototype.initStyleImg = function(t){
  15576. this.styleImg = []
  15577. t.styleImg = t.styleImg || [];
  15578. t.styleImg.forEach((src)=>{
  15579. this.styleImg.push({src:manage.dealURL(src)})
  15580. })
  15581. this.changeTex()
  15582. }
  15583. hot.prototype.update = function(camera) {
  15584. if(this.isSprite){
  15585. this.mesh.quaternion.copy(camera.quaternion)
  15586. }
  15587. //this.showTitle()
  15588. }
  15589. hot.prototype.setVisiblePanos = function(visibleData){
  15590. this.visiblePanos = [];
  15591. this.model.panos.list.forEach((pano)=>{// 模型遮挡的, 直接不可见
  15592. if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
  15593. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15594. if(!isShelter){
  15595. this.visiblePanos.push(pano.id)
  15596. }
  15597. })
  15598. }
  15599. //绘制热点
  15600. hot.prototype.build = function(){
  15601. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15602. var shaderMaterial = new r.ShaderMaterial({
  15603. uniforms: t,
  15604. vertexShader: f.hot.vertexShader,
  15605. fragmentShader: f.hot.fragmentShader,
  15606. transparent: !0
  15607. })
  15608. var sprite = new r.Mesh( geometry, shaderMaterial );
  15609. var hotIconScale = parseFloat(this.infoAttribute.hotIconScale || window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15610. sprite.dynamic = true;
  15611. sprite.position.copy(this.position);
  15612. sprite.quaternion.copy(this.quaternion)
  15613. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15614. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15615. sprite.name = this.sid;
  15616. sprite.type = "hotSprite";
  15617. sprite.belongHot = this;
  15618. if(this.link) sprite.hotLink = this.link;
  15619. this.mesh = sprite;
  15620. this.model.add(sprite);
  15621. g_HotMeshes.push(sprite);
  15622. }
  15623. hot.prototype.setTitleElem = function(title){
  15624. var root = $("#hot");
  15625. var elem = $(`<div> ${title}</div>`)
  15626. root.append(elem);
  15627. this.titleElem = elem;
  15628. }
  15629. hot.prototype.showTitle = function(){
  15630. if(!this.titleElem)return;
  15631. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15632. if(pos.trueSide){//inSight
  15633. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15634. this.titleElem.css("display","block");
  15635. }else{
  15636. this.titleElem.css("display","none");
  15637. }
  15638. }
  15639. hot.prototype.hideTitle = function(){
  15640. if(!this.titleElem)return;
  15641. this.titleElem.css("display","none");
  15642. }
  15643. hot.prototype.closestPanoTowardTag = function(e, t) {
  15644. var i = []
  15645. , o = []
  15646. , l = this.mesh.position;
  15647. if (e === s.PANORAMA) {
  15648. var c = .5
  15649. , h = t.position.clone().sub(l).normalize();
  15650. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  15651. // i.push(p.filters.isPanoAligned()),
  15652. // i.push(p.filters.inPanoDirection(l, h, c)),
  15653. // i.push(p.filters.isNeighbourPanoTo(t)),
  15654. o.push(p.scoreFunctions.direction(l, h))
  15655. }
  15656. var u = new r.Vector3
  15657. , d = function(e) {
  15658. u.copy(l).sub(e.position);
  15659. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15660. , i = a.tags.navigate.tiltTolerance;
  15661. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15662. }
  15663. , f = function(e) {
  15664. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15665. };
  15666. i.push(f, d, (pano)=>{ // add
  15667. return player.checkHasNeighbor(pano)
  15668. }),
  15669. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15670. var g = t.model.panos.sortByScore(i, o);
  15671. if (g && a.tags.navigate.lineOfSight) {
  15672. for (var m = 0; m < g.length; m++) {
  15673. var v = g[m].pano
  15674. , A = v.position.distanceTo(l);
  15675. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15676. var y = raycaster.intersectObjects(t.model.colliders);
  15677. // return g[0].pano;
  15678. if (0 === y.length || y[0].distance > A) {
  15679. console.log(m);
  15680. return v
  15681. }
  15682. }
  15683. return null
  15684. }
  15685. return g && g.length > 0 && g[0].pano
  15686. }
  15687. var getLink = function(link){
  15688. var src = '';
  15689. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  15690. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  15691. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15692. return src
  15693. }
  15694. hot.prototype.examine = function(e, options) {
  15695. try{
  15696. window.parent.postMessage("clickHot",'*')
  15697. //$("#app .aside li" , parent.document)[0].click();
  15698. }catch(e){
  15699. console.log(e)
  15700. }
  15701. options = options || {}
  15702. if(this.actionType == 'noAction' )return;
  15703. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15704. var src = getLink(this.infoAttribute.iframe[0]);
  15705. if(this.linkType=="jumpLink"){
  15706. /* var newPage = window.open(src, "_blank" );
  15707. newPage.focus(); */
  15708. var href = window.location.href
  15709. var index = href.indexOf("&")
  15710. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  15711. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  15712. window.location.href = src
  15713. }else if(this.linkType=="iframeDiv"){
  15714. var div = document.createElement("div");
  15715. $("body").append(div);
  15716. div.style.position = 'fixed';
  15717. div.style.width = div.style.height = "100%";
  15718. div.style.left = div.style.top = '0';
  15719. div.style["z-index"] = "999"
  15720. var exit = document.createElement("div");
  15721. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15722. exit.style.position = 'absolute';
  15723. exit.style.width = exit.style.height = "50px";
  15724. exit.style.left = '17px'; exit.style.top = "20px"
  15725. exit.style.cursor = "pointer";
  15726. exit.style["background-repeat"] = "no-repeat";
  15727. exit.style["background-size"] = "25%";
  15728. exit.style["background-position"] = "center center";
  15729. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15730. exit.style["border-radius"] = "50%";
  15731. exit.style["z-index"] = "3"
  15732. exit.onclick = ()=>{
  15733. $(div).remove();
  15734. if(g_bgAudio && g_bgAudio.pauseByHot){
  15735. manage.switchBgmState(true)
  15736. }
  15737. try{
  15738. window.parent.postMessage("closeHot",'*')
  15739. }catch(e){
  15740. console.log(e)
  15741. }
  15742. }
  15743. var myElement = document.createElement("iframe");
  15744. myElement.style.position = 'absolute';
  15745. myElement.style.width = myElement.style.height = "100%";
  15746. myElement.style.left = myElement.style.top = '0';
  15747. myElement.src = src
  15748. div.appendChild(exit);
  15749. div.appendChild(myElement)
  15750. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15751. //g_bgAudio && g_bgAudio.pause();
  15752. if(g_bgAudio && !g_bgAudio.paused){
  15753. manage.switchBgmState(false);
  15754. g_bgAudio.pauseByHot = true
  15755. }
  15756. if(g_tourAudio)g_tourAudio.pause()
  15757. }
  15758. return;
  15759. }
  15760. if(settings.dontExamHot || this.actionType == 'dontExam'){
  15761. o();
  15762. return;
  15763. }
  15764. if(!player.currentPano)return;
  15765. var hotPop = document.getElementById('popup');
  15766. //获取那个热点的链接
  15767. if(this.link){
  15768. g_currentHot = this;
  15769. hotPop.style.display = "block";
  15770. $("#volume").addClass("hide")//add
  15771. hotPop.classList.add("wait");
  15772. var myElement = document.createElement("iframe");
  15773. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15774. //g_bgAudio && g_bgAudio.pause();
  15775. if(g_bgAudio && !g_bgAudio.paused){
  15776. manage.switchBgmState(false);
  15777. g_bgAudio.pauseByHot = true
  15778. }
  15779. if(g_tourAudio)g_tourAudio.pause()
  15780. var src = getLink(this.link )
  15781. myElement.src = src;
  15782. myElement.id = "id1";
  15783. myElement.allowTransparency = "true";
  15784. // myElement.scrolling = "no";
  15785. var element=document.getElementById("id1"); //判断页面是否有iframe
  15786. if (typeof(element)== "undefined" || element == null){
  15787. document.querySelector(".popup-content").appendChild(myElement);
  15788. //移动端自动播放
  15789. var videoLoaddingResult = false
  15790. window.loaddingSuccess = function() {
  15791. videoLoaddingResult = true
  15792. }
  15793. setTimeout(function func() {
  15794. if (videoLoaddingResult) {
  15795. var $iframe = document.querySelector('#id1').contentWindow.document;
  15796. if($iframe.querySelector('video')){
  15797. $iframe.querySelector('video').play();
  15798. // alert($iframe.querySelector('video'));
  15799. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  15800. $iframe.querySelector('.playPause').classList.add("fa-pause");
  15801. }
  15802. }
  15803. if($iframe.querySelector('audio')){
  15804. $iframe.querySelector('audio').play();
  15805. }
  15806. } else {
  15807. setTimeout(func, 300)
  15808. }
  15809. }, 800);
  15810. }
  15811. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15812. }
  15813. // if(hotListSta) {
  15814. // hotPop.classList.remove("wait");
  15815. // return;
  15816. // }
  15817. var t = e.mode
  15818. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15819. , n = this.mesh.position;
  15820. e.flyingToTag = true;
  15821. var o = function() {
  15822. e.flyingToTag = false;
  15823. if(this.link){
  15824. hotPop.classList.remove("wait");
  15825. }
  15826. }.bind(this);
  15827. if(settings.dontExamHot){
  15828. o();
  15829. return;
  15830. }
  15831. if (t === s.PANORAMA){
  15832. var l = {
  15833. pano: i,
  15834. lookAtPoint: n,
  15835. duration: null,
  15836. maxDistanceOverride: null,
  15837. skipWarpingCheck: !1
  15838. };
  15839. e.flyToPano(l, o)
  15840. }else {
  15841. var c = {
  15842. pano: i
  15843. };
  15844. if (n) {
  15845. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15846. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15847. }
  15848. c.callback = o,
  15849. c.duration = 1500,
  15850. c.mode = s.PANORAMA,
  15851. e.flyToNewMode(c)
  15852. }
  15853. },
  15854. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  15855. // if(window.MP_PREFETCHED_MODELDATA.special){
  15856. // specialScene.special().beforeImplement();
  15857. // }
  15858. //czj 判断是否是数组 如果不是将对象转换为数组
  15859. /* hot.prototype.conversionArray = function(obj){
  15860. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15861. var arr = []
  15862. for (var i in obj) {
  15863. arr.push(obj[i]); //属性
  15864. }
  15865. return arr
  15866. } */
  15867. hot.prototype.convertValue = function(v ,Type){
  15868. var value;
  15869. if(v instanceof Array){
  15870. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15871. value = new Type().fromArray(v);
  15872. }else{
  15873. for(let i in v){v[i] = parseFloat(v[i])}
  15874. value = new Type().copy(v);
  15875. }
  15876. return value
  15877. }
  15878. t.exports = hot;
  15879. }
  15880. , {
  15881. three: 217,
  15882. "../shaders":167,
  15883. "../enum/Viewmode":51,
  15884. "../objects/Panorama":148,
  15885. "../util/texture":194,
  15886. "../settings":166,
  15887. "../util/math": 190,
  15888. }],
  15889. /************************************创建热点模型************************************ */
  15890. 123: [function(e, t, i) {//tag
  15891. (function(i) {
  15892. "use strict";
  15893. function n(e, t, i) {
  15894. var n = i.version || "0";
  15895. "0" !== n && I.info("tag defined using version " + n),
  15896. this.model = e,
  15897. this.sid = t,
  15898. this.color = (new r.Color).set(i.color || l.tagDefault),
  15899. this.hoverColor = l._darken(this.color, .2),
  15900. this.floor = null,
  15901. this.floorIndex = i.floor,
  15902. this.mode = s.PANORAMA,
  15903. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15904. this.obj3d = null,
  15905. this.disc = null,
  15906. this.materials = {
  15907. disc: null,
  15908. pole: null
  15909. },
  15910. this.position = (new r.Vector3).copy(i.position),
  15911. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15912. this.discWorldPosition = null,
  15913. this.discScale = .05,
  15914. this.poleEnabled = i.stem.enabled,
  15915. this.billboard = new o(i.label,i.description,i.media,this),
  15916. this.visibleTransition = null,
  15917. this.hoveringDisc = !1
  15918. }
  15919. var r = e("three")
  15920. , o = e("./Billboard/Billboard")
  15921. , a = e("../settings")
  15922. , s = e("../enum/Viewmode")
  15923. , l = e("../enum/Colors")
  15924. , c = e("../enum/RenderLayers")
  15925. , h = e("../enum/RenderOrder")
  15926. , u = (e("../util/common"),
  15927. e("../util/math"))
  15928. , d = e("../util/texture")
  15929. , p = e("../objects/Panorama")
  15930. , f = e("../shaders")
  15931. , g = e("../util/transitions")
  15932. , m = e("../util/lerp")
  15933. , v = e("../util/easing")
  15934. , A = e("./Billboard/BillboardEvent")
  15935. , y = e("events").EventEmitter
  15936. , C = e("../util/logger")
  15937. , I = new C(i)
  15938. , 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==")
  15939. , 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")
  15940. , w = new r.PlaneBufferGeometry(1,1);
  15941. n.prototype = Object.create(y.prototype),
  15942. n.raycaster = new r.Raycaster,
  15943. n.prototype.bindEvents = function() {
  15944. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15945. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15946. }
  15947. ,
  15948. n.prototype.build = function() {
  15949. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15950. this.floor && (this.billboard.build(this.model.sid),
  15951. this.obj3d = this.buildObject3D(),
  15952. this.floor.add(this.obj3d)),
  15953. this
  15954. }
  15955. ,
  15956. n.prototype.buildObject3D = function() {
  15957. var e = new r.Object3D;
  15958. e.position.copy(this.position);
  15959. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15960. t.bg.value = b,
  15961. t.mask.value = E,
  15962. t.color.value.copy(this.color),
  15963. this.materials.disc = new r.RawShaderMaterial({
  15964. transparent: !0,
  15965. vertexShader: f.tagDisc.vertexShader,
  15966. fragmentShader: f.tagDisc.fragmentShader,
  15967. uniforms: t
  15968. }),
  15969. this.disc = new r.Mesh(w,this.materials.disc),
  15970. this.disc.layers.set(c.TAG),
  15971. this.disc.position.copy(this.discPosition),
  15972. this.disc.renderOrder = h.tagDisc,
  15973. this.disc.tag = this;
  15974. var i = this.buildPole();
  15975. return i.layers.set(c.TAG),
  15976. i.renderOrder = h.tagStem,
  15977. e.add(i),
  15978. e.layers.set(c.TAG),
  15979. e.add(this.disc)
  15980. }
  15981. ,
  15982. n.prototype.buildPole = function() {
  15983. var e = new r.BufferGeometry
  15984. , t = new Float32Array(6);
  15985. return t[0] = t[1] = t[2] = 0,
  15986. t[3] = this.discPosition.x,
  15987. t[4] = this.discPosition.y,
  15988. t[5] = this.discPosition.z,
  15989. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15990. this.materials.pole = new r.LineBasicMaterial({
  15991. linewidth: a.tags.pole.width,
  15992. color: a.tags.pole.color,
  15993. opacity: 0,
  15994. visible: this.poleEnabled,
  15995. transparent: !0,
  15996. depthWrite: !1
  15997. }),
  15998. new r.Line(e,this.materials.pole)
  15999. }
  16000. ,
  16001. n.prototype.setFreeState = function(e) {
  16002. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  16003. this.materials.disc.uniforms.color.value = this.color
  16004. }
  16005. .bind(this))
  16006. }
  16007. ,
  16008. n.prototype.setHoverState = function(e) {
  16009. this.billboard.open(e),
  16010. this.materials.disc.uniforms.color.value = this.hoverColor
  16011. }
  16012. ,
  16013. n.prototype.hide = function(e, t) {
  16014. var i = $.Deferred();
  16015. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  16016. return i.resolve().promise();
  16017. e = e || 0,
  16018. t = t || 0,
  16019. g.cancel(this.visibleTransition);
  16020. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  16021. , r = t + e
  16022. , o = t / r;
  16023. return this.visibleTransition = g.start(function(e) {
  16024. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  16025. , i = m.property(e.materials.pole, "opacity", 0);
  16026. return function(n) {
  16027. t(n),
  16028. e.materials.pole && i(n)
  16029. }
  16030. }(this), r * n, function() {
  16031. i.resolve()
  16032. }, o, v[a.warp.blendEasing]),
  16033. i.promise()
  16034. }
  16035. ,
  16036. n.prototype.show = function(e, t) {
  16037. var i = $.Deferred();
  16038. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  16039. return i.resolve().promise();
  16040. e = e || 0,
  16041. t = t || 0,
  16042. g.cancel(this.visibleTransition);
  16043. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  16044. , r = t + e
  16045. , o = t / r;
  16046. return this.visibleTransition = g.start(function(e) {
  16047. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  16048. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  16049. return function(n) {
  16050. t(n),
  16051. e.materials.pole && i(n)
  16052. }
  16053. }(this), r * n, function() {
  16054. i.resolve()
  16055. }, o, v[a.warp.blendEasing]),
  16056. i.promise()
  16057. }
  16058. ,
  16059. n.prototype.closestPanoTowardTag = function(e, t) {
  16060. var i = []
  16061. , o = []
  16062. , l = this.disc.getWorldPosition();
  16063. if (e === s.PANORAMA) {
  16064. var c = .5
  16065. , h = t.position.clone().sub(l).normalize();
  16066. i.push(p.filters.isPanoAligned()),
  16067. i.push(p.filters.inPanoDirection(l, h, c)),
  16068. i.push(p.filters.isNeighbourPanoTo(t)),
  16069. o.push(p.scoreFunctions.direction(l, h))
  16070. }
  16071. var u = new r.Vector3
  16072. , d = function(e) {
  16073. u.copy(l).sub(e.position);
  16074. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16075. , i = a.tags.navigate.tiltTolerance;
  16076. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16077. }
  16078. , f = function(e) {
  16079. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16080. };
  16081. i.push(f, d),
  16082. o.push(p.scoreFunctions.distanceSquared(this, -2));
  16083. var g = this.model.panos.sortByScore(i, o);
  16084. if (a.tags.navigate.lineOfSight) {
  16085. for (var m = 0; m < g.length; m++) {
  16086. var v = g[m].pano
  16087. , A = v.position.distanceTo(l);
  16088. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  16089. return null;
  16090. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16091. var y = n.raycaster.intersectObjects(this.model.colliders);
  16092. if (0 === y.length || y[0].distance > A)
  16093. return v
  16094. }
  16095. return null
  16096. }
  16097. return g.length > 0 && g[0].pano
  16098. }
  16099. ,
  16100. n.prototype.examine = function(e) {
  16101. var t = e.mode
  16102. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16103. , n = this.disc.getWorldPosition();
  16104. this.billboard.setActiveState();
  16105. var o = function() {
  16106. var t = this.billboard.getDimensions()
  16107. , n = new r.Vector3;
  16108. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  16109. n.unproject(e.camera),
  16110. e.flyToPano({
  16111. pano: i,
  16112. lookAtPoint: n
  16113. })
  16114. }
  16115. .bind(this);
  16116. if (t === s.PANORAMA)
  16117. if (i !== e.currentPano) {
  16118. var l = {
  16119. pano: i,
  16120. lookAtPoint: n,
  16121. duration: null,
  16122. maxDistanceOverride: null,
  16123. skipWarpingCheck: !1
  16124. };
  16125. e.flyToPano(l, o)
  16126. } else
  16127. setTimeout(function() {
  16128. this.billboard.open().then(function() {
  16129. o()
  16130. })
  16131. }
  16132. .bind(this), 0);
  16133. else {
  16134. var c = {
  16135. pano: i
  16136. };
  16137. if (n) {
  16138. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16139. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16140. }
  16141. c.callback = o,
  16142. c.duration = 1500,
  16143. c.mode = s.PANORAMA,
  16144. e.flyToNewMode(c)
  16145. }
  16146. }
  16147. ,
  16148. n.prototype.update = function(e, t) {
  16149. var i = new r.Vector3;
  16150. return function(e, t) {
  16151. this.discWorldPosition = this.disc.getWorldPosition(),
  16152. this.updateDisc(e, t),
  16153. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16154. i.z < 1 && (i.y *= -1,
  16155. this.billboard.update(i, this.getDiscRadius(i, t))))
  16156. }
  16157. }(),
  16158. n.prototype.updateDisc = function(e, t) {
  16159. var i = new r.Vector3
  16160. , o = new r.Vector3
  16161. , l = new r.Vector3
  16162. , c = new r.Vector3
  16163. , h = new r.Vector3;
  16164. return function(e, t) {
  16165. var u = a.tags.visibility
  16166. , d = a.tags.disc.scale
  16167. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16168. 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)),
  16169. this.obj3d.visible) {
  16170. this.disc.quaternion.copy(t.quaternion);
  16171. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16172. i.copy(this.discWorldPosition).project(t),
  16173. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16174. l.set(f / 2, 0, 0).add(o),
  16175. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16176. h.copy(c).unproject(t);
  16177. var g = h.distanceTo(this.discWorldPosition)
  16178. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16179. this.discScale = g * m,
  16180. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16181. }
  16182. }
  16183. }(),
  16184. n.prototype.getDiscRadius = function(e, t) {
  16185. var i = new r.Vector3;
  16186. return function(e, t) {
  16187. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16188. Math.abs(e.x - i.x) * $("#player").width()
  16189. }
  16190. }(),
  16191. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16192. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16193. }
  16194. ,
  16195. n.prototype.offScreen = function(e, t) {
  16196. var i = e.getWorldPosition().project(t);
  16197. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16198. }
  16199. ,
  16200. n.viewportScale = function() {
  16201. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16202. n.viewportHeight = $("#player").height(),
  16203. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16204. n.currentViewportScale
  16205. }
  16206. ,
  16207. t.exports = n
  16208. }
  16209. ).call(this, "/js/tag/tag.js")
  16210. }
  16211. , {
  16212. "../enum/Colors": 19,
  16213. "../enum/RenderLayers": 41,
  16214. "../enum/RenderOrder": 42,
  16215. "../enum/Viewmode": 51,
  16216. "../objects/Panorama": 148,
  16217. "../settings": 166,
  16218. "../shaders": 167,
  16219. "../util/common": 185,
  16220. "../util/easing": 186,
  16221. "../util/lerp": 188,
  16222. "../util/logger": 189,
  16223. "../util/math": 190,
  16224. "../util/texture": 194,
  16225. "../util/transitions": 195,
  16226. "./Billboard/Billboard": 119,
  16227. "./Billboard/BillboardEvent": 120,
  16228. events: 202,
  16229. three: 217
  16230. }],
  16231. 124: [function(e, t, i) {
  16232. (function(i) {
  16233. "use strict";
  16234. function n() {
  16235. this.tagState = y.IDLE,
  16236. this.intersectTag = null,
  16237. this.hoveredTag = null,
  16238. this.activeTag = null,
  16239. this.tagDiscs = [],
  16240. this.raycaster = new r.Raycaster,
  16241. this.modelManager = null,
  16242. this.player = null,
  16243. this.totaltags = 0,
  16244. this.navigatingViaTag = !1,
  16245. this.enabled = !1
  16246. }
  16247. var r = e("three")
  16248. , o = e("../util/logger")
  16249. , a = e("../util/common")
  16250. , s = e("../controls/serializer")
  16251. , l = e("../objects/Snapshot")
  16252. , c = e("../settings")
  16253. , h = e("./Billboard/BillboardEvent")
  16254. , u = e("./Media/MediaEvent")
  16255. , d = e("./Media/LinkType")
  16256. , p = e("../enum/Viewmode")
  16257. , f = e("../enum/WarpStyle")
  16258. , g = e("../enum/BlackoutStyle")
  16259. , m = e("../enum/ModelManagerEvents")
  16260. , v = e("../enum/tagEvents")
  16261. , A = e("../enum/PlayerEvents")
  16262. , y = (e("../util/lerp"),
  16263. e("../enum/TagStates"))
  16264. , C = e("events").EventEmitter
  16265. , I = new o(i);
  16266. a.extend(n, C),
  16267. n.prototype.init = function(e, t) {
  16268. this.modelManager = e,
  16269. this.player = t,
  16270. this.updateModel(),
  16271. this.bindEvents()
  16272. }
  16273. ,
  16274. n.prototype.update = function(e) {
  16275. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16276. }
  16277. ,
  16278. n.prototype.updateTags = function(e, t, i, n) {
  16279. for (var r in this.model.tags)
  16280. this.model.tags[r].update(e, t, i, n)
  16281. }
  16282. ,
  16283. n.prototype.updateModel = function() {
  16284. this.model = this.modelManager.getActiveModel(),
  16285. this.gettagsFromModel(),
  16286. this.totaltags = Object.keys(this.model.tags).length
  16287. }
  16288. ,
  16289. n.prototype.gettagsFromModel = function() {
  16290. this.tagDiscs = [];
  16291. for (var e in this.model.tags) {
  16292. var t = this.model.tags[e].disc;
  16293. t && this.tagDiscs.push(t)
  16294. }
  16295. }
  16296. ,
  16297. n.prototype.bindEvents = function() {
  16298. function e() {
  16299. Object.keys(this.model.tags).forEach(function(e) {
  16300. var t = this.model.tags[e];
  16301. t.bindEvents(),
  16302. t.billboard.on(u.LINK_CLICK, function(e) {
  16303. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16304. }
  16305. .bind(this)),
  16306. t.billboard.on(u.IMAGE_OPENED, function() {
  16307. this.tagState = y.EXAMINE,
  16308. this.emit(u.IMAGE_OPENED)
  16309. }
  16310. .bind(this)),
  16311. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16312. }
  16313. .bind(this))
  16314. }
  16315. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16316. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16317. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16318. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16319. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16320. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16321. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16322. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16323. e.call(this)
  16324. }
  16325. ,
  16326. n.prototype.navigateViaLink = function(e) {
  16327. var t = s.deserialize(e);
  16328. if (t)
  16329. if (t.mode === p.PANORAMA) {
  16330. try {
  16331. this.player.model.panos.get(t.panoId)
  16332. } catch (e) {
  16333. return void I.warn("Unable to find panorama location", t.panoId)
  16334. }
  16335. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16336. } else {
  16337. var i = {
  16338. cameraMode: t.mode,
  16339. position: t.position,
  16340. quaternion: t.quaternion,
  16341. scanId: t.panoId,
  16342. orthoZoom: t.zoom,
  16343. floorVisibility: t.floorVisibility,
  16344. thumbUrl: null,
  16345. name: null
  16346. };
  16347. this.player.flyToNewMode({
  16348. mode: t.mode,
  16349. duration: c.warp.outsideTime,
  16350. warpDest: new l(i),
  16351. force: !0
  16352. })
  16353. }
  16354. }
  16355. ,
  16356. n.prototype.handleWarpStart = function(e, t, i, n) {
  16357. this.dismissExaminedTag(),
  16358. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16359. e && (i = g.END),
  16360. this.hideShowTagsForBlackoutStyle(i, n))
  16361. }
  16362. ,
  16363. n.prototype.handleWarpInterruption = function(e, t, i) {
  16364. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16365. this.hideShowTagsForBlackoutStyle(t, i)
  16366. }
  16367. ,
  16368. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16369. var i = 0
  16370. , n = 0
  16371. , r = t / 2;
  16372. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16373. e) {
  16374. case g.END:
  16375. this.hideAlltags(r);
  16376. break;
  16377. case g.BEGINNING:
  16378. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16379. break;
  16380. case g.NONE:
  16381. break;
  16382. case g.MIDDLE:
  16383. i = r,
  16384. n = r,
  16385. this.hideAlltags(n),
  16386. setTimeout(function() {
  16387. this.showAlltags(i)
  16388. }
  16389. .bind(this), n);
  16390. break;
  16391. case g.FADEIN:
  16392. setTimeout(function() {
  16393. this.showAlltags(r)
  16394. }
  16395. .bind(this), r)
  16396. }
  16397. }
  16398. ,
  16399. n.prototype.onPlayerModeChanging = function(e, t) {
  16400. t !== p.PANORAMA && this.dismissExaminedTag(),
  16401. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16402. var i = t !== p.OUTDOOR;
  16403. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16404. }
  16405. ,
  16406. n.prototype.onPanoChange = function(e, t) {
  16407. var i = this.navigatingViaTag;
  16408. if (this.navigatingViaTag = !1,
  16409. !i) {
  16410. this.dismissExaminedTag();
  16411. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16412. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16413. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16414. }
  16415. }
  16416. ,
  16417. n.prototype.onPlayerReady = function(e, t, i) {
  16418. this.startAlltags(e, t ? i : null)
  16419. }
  16420. ,
  16421. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16422. this.updateClosestTags(e)
  16423. }
  16424. ,
  16425. n.prototype.dismissExaminedTag = function() {
  16426. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16427. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16428. this.hoveredTag = null)
  16429. }
  16430. ,
  16431. n.prototype.startAlltags = function(e, t) {
  16432. this.model.shouldShowtags = c.tags.enabled,
  16433. this.enabled = !0,
  16434. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16435. t && setTimeout(function() {
  16436. this.activateTag(this.model.getTagBySid(t))
  16437. }
  16438. .bind(this), c.tags.startup.fadeInDuration / 2))
  16439. }
  16440. ,
  16441. n.prototype.showAlltags = function(e, t, i) {
  16442. function n() {
  16443. o++,
  16444. o === this.totaltags && (this.model.tagsShown = !0,
  16445. r.resolve())
  16446. }
  16447. var r = $.Deferred();
  16448. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16449. return r.resolve().promise();
  16450. var o = 0;
  16451. for (var a in this.model.tags) {
  16452. var s = this.model.tags[a];
  16453. s.show(e, t).done(n.bind(this))
  16454. }
  16455. return r.promise()
  16456. }
  16457. ,
  16458. n.prototype.hideAlltags = function(e, t) {
  16459. function i() {
  16460. r++,
  16461. r === this.totaltags && (this.model.tagsShown = !1,
  16462. n.resolve())
  16463. }
  16464. var n = $.Deferred()
  16465. , r = 0;
  16466. for (var o in this.model.tags) {
  16467. var a = this.model.tags[o];
  16468. a.hide(e, t).done(i.bind(this)),
  16469. a === this.activeTag && this.dismissActiveTag()
  16470. }
  16471. return n.promise()
  16472. }
  16473. ,
  16474. n.prototype.enableHovering = function() {
  16475. this.enabled = !0
  16476. }
  16477. ,
  16478. n.prototype.disableHovering = function() {
  16479. this.enabled = !1
  16480. }
  16481. ,
  16482. n.prototype.activateTag = function(e, t) {
  16483. t = t || y.EXAMINE,
  16484. this.activeTag = e,
  16485. this.activeTag.hoveringDisc = !0,
  16486. this.activeTag.setHoverState(t === y.EXAMINE),
  16487. this.tagState = t,
  16488. this.emit(v.TagActivated, e)
  16489. }
  16490. ,
  16491. n.prototype.dismissActiveTag = function() {
  16492. this.activeTag.hoveringDisc = !1,
  16493. this.activeTag.setFreeState(!0);
  16494. var e = this.activeTag;
  16495. this.activeTag = null,
  16496. this.tagState = y.IDLE,
  16497. this.emit(v.TagDismissed, e)
  16498. }
  16499. ,
  16500. n.prototype.clickedOnTag = function(e) {
  16501. var t = function() {
  16502. this.navigatingViaTag = !0,
  16503. this.activeTag.examine(this.player),
  16504. this.emit(v.TagNavigation, this.activeTag)
  16505. }
  16506. .bind(this);
  16507. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16508. this.activeTag = this.intersectTag,
  16509. t(),
  16510. !0) : (this.dismissActiveTag(),
  16511. !1)
  16512. }
  16513. ,
  16514. n.prototype.intersecttag = function() {
  16515. var e = new r.Vector3
  16516. , t = new r.Vector3
  16517. , i = new r.Vector3;
  16518. return function(n, r, o) {
  16519. if (!this.enabled)
  16520. return null;
  16521. var a = null
  16522. , s = this.tagDiscs.filter(function(e) {
  16523. return e.parent.visible
  16524. });
  16525. if (s.length > 0) {
  16526. var l = this.model.floors.reduce(function(e, t) {
  16527. return t.hidden ? e : e.concat(t.collider.children)
  16528. }, s);
  16529. e.set(n.x, n.y, -1).unproject(o),
  16530. t.set(n.x, n.y, 1).unproject(o),
  16531. i.copy(t).sub(e).normalize(),
  16532. this.raycaster.set(e, i);
  16533. var c = this.raycaster.intersectObjects(l);
  16534. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16535. }
  16536. return this.intersectTag = a,
  16537. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16538. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16539. this.hoveredTag = a
  16540. }
  16541. .bind(this)),
  16542. a.billboard.on(h.LEAVE, function() {
  16543. this.hoveredTag = null
  16544. }
  16545. .bind(this))),
  16546. this.activateTag(a, y.BROWSE))),
  16547. a
  16548. }
  16549. }(),
  16550. n.prototype.rankedtagInDirection = function() {
  16551. var e = []
  16552. , t = []
  16553. , i = new r.Vector3
  16554. , n = new r.Vector3
  16555. , o = new r.Vector3;
  16556. return function(r, a, s, l) {
  16557. var c = 0;
  16558. t.length = 0;
  16559. for (var h = 0; h < this.closesttags.length; h++) {
  16560. var u = this.closesttags[h];
  16561. n.copy(u.position),
  16562. n.add(u.discPosition),
  16563. i.copy(a),
  16564. i.sub(n).negate(),
  16565. i.normalize();
  16566. var d = i.dot(l);
  16567. if (d >= 0) {
  16568. o.copy(n),
  16569. o.project(s);
  16570. var p = this.intersecttag(o, !1, s);
  16571. if (p) {
  16572. if (c >= e.length)
  16573. for (var f = 0; f < 64; f++)
  16574. e.push({
  16575. tag: u,
  16576. dot: d
  16577. });
  16578. var g = e[c];
  16579. g.tag = u,
  16580. g.dot = d,
  16581. g.position = math.projectPositionToCanvas(n, s),
  16582. t.push(g),
  16583. c++
  16584. }
  16585. }
  16586. }
  16587. return t.sort(function(e, t) {
  16588. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16589. }),
  16590. r < t.length ? t[r].tag : null
  16591. }
  16592. }(),
  16593. n.prototype.updateClosestTags = function() {
  16594. var e = new r.Vector3
  16595. , t = 30;
  16596. return function(i) {
  16597. this.closesttags || (this.closesttags = []),
  16598. this.closesttags.length = 0;
  16599. var n = this.model.tags;
  16600. if (n)
  16601. for (var r in n)
  16602. if (n.hasOwnProperty(r)) {
  16603. var o = n[r]
  16604. , a = o.position;
  16605. e.copy(i),
  16606. e.sub(a).negate();
  16607. var s = e.lengthSq();
  16608. s < t && this.closesttags.push(o)
  16609. }
  16610. }
  16611. }(),
  16612. t.exports = n
  16613. }
  16614. ).call(this, "/js/tag/tagManager.js")
  16615. }
  16616. , {
  16617. "../controls/serializer": 14,
  16618. "../enum/BlackoutStyle": 18,
  16619. "../enum/tagEvents": 32,
  16620. "../enum/ModelManagerEvents": 33,
  16621. "../enum/PlayerEvents": 40,
  16622. "../enum/TagStates": 44,
  16623. "../enum/Viewmode": 51,
  16624. "../enum/WarpStyle": 52,
  16625. "../objects/Snapshot": 153,
  16626. "../settings": 166,
  16627. "../util/common": 185,
  16628. "../util/lerp": 188,
  16629. "../util/logger": 189,
  16630. "./Billboard/BillboardEvent": 120,
  16631. "./Media/LinkType": 130,
  16632. "./Media/MediaEvent": 131,
  16633. events: 202,
  16634. three: 217
  16635. }],
  16636. 125: [function(e, t, i) {
  16637. (function(i) {
  16638. "use strict";
  16639. function n() {
  16640. this.embedWrapper = null,
  16641. this.embedElement = null
  16642. }
  16643. var r = e("../../util/ajax")
  16644. , o = e("./mediaSettings")
  16645. , a = e("../../settings")
  16646. , s = e("../../util/logger")
  16647. , l = new s(i);
  16648. n.prototype.createDomElement = function() {
  16649. return this.embedWrapper = document.createElement("div"),
  16650. this.embedWrapper.classList.add("tag-embed"),
  16651. this.embedWrapper.classList.add("hidden"),
  16652. this.embedWrapper
  16653. }
  16654. ,
  16655. n.prototype.load = function(e) {
  16656. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16657. return new Promise(function(e, i) {
  16658. r.get(t).then(function(t) {
  16659. if (t = JSON.parse(t),
  16660. t.html && t.html.indexOf("<script") === -1) {
  16661. this.embedWrapper.innerHTML = t.html;
  16662. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16663. if (this.embedWrapper.style.width = n + "px",
  16664. t.height) {
  16665. var r = t.height / t.width;
  16666. this.embedWrapper.style.height = n * r + "px"
  16667. }
  16668. this.embedElement = this.embedWrapper.firstChild;
  16669. var a = [];
  16670. try {
  16671. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16672. } catch (e) {
  16673. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16674. }
  16675. a.forEach(function(e) {
  16676. e.setAttribute("target", "_blank")
  16677. }),
  16678. this.embedElement.classList.add("hidden"),
  16679. this.embedWrapper.classList.remove("hidden"),
  16680. e()
  16681. } else
  16682. i("Not a valid embed")
  16683. }
  16684. .bind(this), function(e) {
  16685. i(e.response)
  16686. })
  16687. }
  16688. .bind(this))
  16689. }
  16690. ,
  16691. n.prototype.show = function() {
  16692. this.embedElement && this.embedElement.classList.remove("hidden")
  16693. }
  16694. ,
  16695. n.prototype.hide = function() {
  16696. this.embedElement && this.embedElement.classList.add("hidden")
  16697. }
  16698. ,
  16699. t.exports = n
  16700. }
  16701. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16702. }
  16703. , {
  16704. "../../settings": 166,
  16705. "../../util/ajax": 181,
  16706. "../../util/logger": 189,
  16707. "./mediaSettings": 132
  16708. }],
  16709. 126: [function(e, t, i) {
  16710. (function(i) {
  16711. "use strict";
  16712. function n(e) {
  16713. o.call(this),
  16714. this.options = e,
  16715. this.playerControls = null,
  16716. this.state = s.NOT_READY
  16717. }
  16718. var r = e("../../util/browser")
  16719. , o = e("./EmbedlyEmbed")
  16720. , a = e("../../util/logger")
  16721. , s = (new a(i),
  16722. Object.freeze({
  16723. NOT_READY: "player.not.ready",
  16724. CUED: "player.cued",
  16725. PLAYING: "player.playing",
  16726. PAUSED: "player.paused"
  16727. }));
  16728. n.prototype = Object.create(o.prototype),
  16729. n.prototype.createDomElement = function() {
  16730. return this.embedWrapper = document.createElement("div"),
  16731. this.embedWrapper.classList.add("tag-video"),
  16732. this.embedWrapper.classList.add("hidden"),
  16733. this.embedWrapper
  16734. }
  16735. ,
  16736. n.prototype.load = function(e) {
  16737. var t = function() {
  16738. function e(e) {
  16739. this.playerState = s.CUED,
  16740. this.options.startMuted && this.playerControls.mute()
  16741. }
  16742. function t(e) {
  16743. this.playerState = e
  16744. }
  16745. function i(e) {
  16746. this.playerControls.setCurrentTime(0),
  16747. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16748. }
  16749. this.playerControls = new playerjs.Player(this.embedElement),
  16750. this.playerControls.on("ready", e.bind(this)),
  16751. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16752. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16753. this.playerControls.on("ended", i.bind(this))
  16754. }
  16755. .bind(this);
  16756. return o.prototype.load.call(this, e).then(t.bind(this))
  16757. }
  16758. ,
  16759. n.prototype.play = function() {
  16760. var e = r.isMobile();
  16761. return function() {
  16762. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16763. }
  16764. }(),
  16765. n.prototype.pause = function() {
  16766. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16767. }
  16768. ,
  16769. t.exports = n
  16770. }
  16771. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16772. }
  16773. , {
  16774. "../../util/browser": 182,
  16775. "../../util/logger": 189,
  16776. "./EmbedlyEmbed": 125
  16777. }],
  16778. 127: [function(e, t, i) {
  16779. (function(i) {
  16780. "use strict";
  16781. function n(e) {
  16782. function t() {
  16783. return a.debug("requesting file from embedly:", e.href),
  16784. r.get(e.href, {
  16785. responseType: e.responseType
  16786. }).then(function(t) {
  16787. return a.debug("requesting file finished:", e.href),
  16788. t
  16789. })
  16790. }
  16791. function i() {}
  16792. return s = new Promise(function(e, n) {
  16793. s.catch(i).then(function() {
  16794. t().then(e, n)
  16795. })
  16796. }
  16797. )
  16798. }
  16799. var r = e("../../util/ajax")
  16800. , o = (e("./mediaSettings"),
  16801. e("../../util/logger"))
  16802. , a = new o(i)
  16803. , s = Promise.resolve();
  16804. t.exports.enqueue = n
  16805. }
  16806. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16807. }
  16808. , {
  16809. "../../util/ajax": 181,
  16810. "../../util/logger": 189,
  16811. "./mediaSettings": 132
  16812. }],
  16813. 128: [function(e, t, i) {
  16814. (function(i) {
  16815. "use strict";
  16816. function n() {
  16817. this.imageWrapper = null,
  16818. this.width = 0,
  16819. this.height = 0,
  16820. this.aspect = 1
  16821. }
  16822. var r = e("./MediaEvent")
  16823. , o = e("./EmbedlyQueue")
  16824. , a = e("events").EventEmitter
  16825. , s = e("../../util/logger")
  16826. , l = e("../../settings");
  16827. new s(i);
  16828. n.prototype = Object.create(a.prototype),
  16829. n.prototype.createDomElement = function() {
  16830. return this.imageWrapper = document.createElement("div"),
  16831. this.imageWrapper.classList.add("tag-image"),
  16832. this.imageWrapper.classList.add("hidden"),
  16833. this.imageWrapper.addEventListener("click", function(e) {
  16834. e.stopPropagation(),
  16835. this.emit(r.IMAGE_OPENING),
  16836. this.imageWrapper.style.pointerEvents = "none"
  16837. }
  16838. .bind(this)),
  16839. this.imageWrapper
  16840. }
  16841. ,
  16842. n.prototype.onClosed = function() {
  16843. this.imageWrapper.style.pointerEvents = "auto"
  16844. }
  16845. ,
  16846. n.prototype.load = function(e) {
  16847. var t = Math.max(window.screen.height, window.screen.width)
  16848. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16849. return new Promise(function(e, t) {
  16850. function n(t) {
  16851. var i = t.target;
  16852. this.width = i.naturalWidth,
  16853. this.height = i.naturalHeight,
  16854. this.aspect = this.width / this.height;
  16855. var n = t.target.src;
  16856. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16857. this.imageWrapper.style.width = this.width + "px",
  16858. this.imageWrapper.style.height = this.height + "px",
  16859. this.imageWrapper.classList.remove("hidden"),
  16860. e()
  16861. }
  16862. o.enqueue({
  16863. href: i,
  16864. responseType: "arraybuffer"
  16865. }).then(function(e) {
  16866. var t = new Uint8Array(e)
  16867. , i = new Blob([t])
  16868. , r = new window.Image;
  16869. r.addEventListener("load", n.bind(this));
  16870. var o = URL.createObjectURL(i);
  16871. r.src = o
  16872. }
  16873. .bind(this), t)
  16874. }
  16875. .bind(this))
  16876. }
  16877. ,
  16878. t.exports = n
  16879. }
  16880. ).call(this, "/js/tag/Media/Image.js")
  16881. }
  16882. , {
  16883. "../../settings": 166,
  16884. "../../util/logger": 189,
  16885. "./EmbedlyQueue": 127,
  16886. "./MediaEvent": 131,
  16887. events: 202
  16888. }],
  16889. 129: [function(e, t, i) {
  16890. "use strict";
  16891. function n(e) {
  16892. this.label = e.label,
  16893. this.href = e.url,
  16894. this.type = this.updateLinkForType(),
  16895. this.domElement = null,
  16896. this.id = c++
  16897. }
  16898. var r = e("./LinkType")
  16899. , o = e("./MediaEvent")
  16900. , a = e("../../util/browser")
  16901. , s = e("../../analytics")
  16902. , l = e("events").EventEmitter
  16903. , c = 0;
  16904. n.prototype = Object.create(l.prototype),
  16905. n.prototype.updateLinkForType = function() {
  16906. function e(e) {
  16907. var t = new RegExp("[#&?]start=([^#&?]*)")
  16908. , i = t.exec(e);
  16909. return i[1]
  16910. }
  16911. function t(e) {
  16912. return e + "&play=1"
  16913. }
  16914. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16915. 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),
  16916. r.NAVIGATION) : (this.href = t(this.href),
  16917. r.MODEL) : r.EXT_LINK
  16918. }
  16919. ;
  16920. var h = {};
  16921. n.prototype.createDomElement = function() {
  16922. function e(e) {
  16923. switch (e.stopPropagation(),
  16924. h[this.id] = !0,
  16925. s.trackAlways("click_tag_link", {
  16926. link_type: this.type,
  16927. link_count: c,
  16928. links_clicked: Object.keys(h).length
  16929. }),
  16930. this.type) {
  16931. case r.MODEL:
  16932. window.location.replace(this.href);
  16933. break;
  16934. case r.EXT_LINK:
  16935. window.open(this.href, "_blank")
  16936. }
  16937. this.emit(o.LINK_CLICK, {
  16938. type: this.type,
  16939. url: this.href
  16940. })
  16941. }
  16942. if (this.domElement = document.createElement("a"),
  16943. this.domElement.classList.add("tag-link"),
  16944. this.domElement.textContent = this.label,
  16945. this.type === r.EXT_LINK) {
  16946. this.domElement.textContent += " ";
  16947. var t = document.createElement("i");
  16948. t.classList.add("icon-ext-link"),
  16949. t.title = "Link to external web site",
  16950. this.domElement.appendChild(t)
  16951. }
  16952. return this.domElement.addEventListener("click", e.bind(this)),
  16953. this.domElement
  16954. }
  16955. ,
  16956. t.exports = n
  16957. }
  16958. , {
  16959. "../../analytics": 4,
  16960. "../../util/browser": 182,
  16961. "./LinkType": 130,
  16962. "./MediaEvent": 131,
  16963. events: 202
  16964. }],
  16965. 130: [function(e, t, i) {
  16966. "use strict";
  16967. t.exports = {
  16968. NAVIGATION: "navigation",
  16969. MODEL: "model",
  16970. EXT_LINK: "ext-link"
  16971. }
  16972. }
  16973. , {}],
  16974. 131: [function(e, t, i) {
  16975. "use strict";
  16976. t.exports = Object.freeze({
  16977. LINK_CLICK: "mtmedia.link",
  16978. IMAGE_LOADED: "mtmedia.image.loaded",
  16979. IMAGE_OPENING: "mtmedia.image.opening",
  16980. IMAGE_OPENED: "mtmedia.image.opened",
  16981. IMAGE_CLOSING: "mtmedia.image.closing",
  16982. IMAGE_CLOSED: "mtmedia.image.closed",
  16983. VIDEO_START: "mtmedia.video.start",
  16984. VIDEO_PAUSE: "mtmedia.video.pause",
  16985. VIDEO_ENDED: "mtmedia.video.end"
  16986. })
  16987. }
  16988. , {}],
  16989. 132: [function(e, t, i) {
  16990. "use strict";
  16991. t.exports = Object.freeze({
  16992. maxEmbedWidth: 350,
  16993. defaultAspectRatio: .75
  16994. })
  16995. }
  16996. , {}],
  16997. 133: [function(e, t, i) {
  16998. "use strict";
  16999. t.exports = Object.freeze({
  17000. TEXT: "text",
  17001. LINK: "link",
  17002. IMAGE: "photo",
  17003. VIDEO: "video",
  17004. RICH: "rich"
  17005. })
  17006. }
  17007. , {}],
  17008. 134: [function(e, t, i) {
  17009. "use strict";
  17010. function n(e) {
  17011. this.capabilities = {
  17012. links: {
  17013. enable: e.supportLinks,
  17014. keepLabels: e.keepLinkLabels
  17015. }
  17016. }
  17017. }
  17018. var r = e("./DescriptionChunkType");
  17019. n.prototype.parse = function(e, t) {
  17020. var i = []
  17021. , n = e.split("[").map(function(e, t) {
  17022. return 0 === t ? e : "[" + e
  17023. });
  17024. return n.forEach(function(e) {
  17025. var n = this.findMarkdown(e);
  17026. if (n) {
  17027. if (n.url.indexOf("javascript:") !== -1)
  17028. return;
  17029. this.addLinkChunk(i, n, t),
  17030. this.addTextChunk(i, e.slice(n.markdown.length))
  17031. } else
  17032. this.addTextChunk(i, e)
  17033. }
  17034. .bind(this)),
  17035. i
  17036. }
  17037. ,
  17038. n.prototype.findMarkdown = function(e) {
  17039. var t = /\[([^\]]*)\]\((.*)\)/
  17040. , i = e.match(t);
  17041. if (i) {
  17042. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  17043. 0 !== r); )
  17044. o++;
  17045. var a = n.length - o;
  17046. return {
  17047. markdown: i[0].substring(0, i[0].length - a),
  17048. label: i[1],
  17049. url: i[2].substring(0, o)
  17050. }
  17051. }
  17052. }
  17053. ,
  17054. n.prototype.addTextChunk = function(e, t) {
  17055. 0 !== t.length && e.push({
  17056. type: r.TEXT,
  17057. text: t
  17058. })
  17059. }
  17060. ,
  17061. n.prototype.addLinkChunk = function(e, t) {
  17062. if (!this.capabilities.links.enable)
  17063. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  17064. var i = {
  17065. label: t.label,
  17066. url: t.url
  17067. };
  17068. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  17069. e.push({
  17070. type: r.LINK,
  17071. link: i
  17072. })
  17073. }
  17074. ,
  17075. t.exports = n
  17076. }
  17077. , {
  17078. "./DescriptionChunkType": 133
  17079. }],
  17080. 135: [function(e, t, i) {
  17081. (function(i) {
  17082. "use strict";
  17083. var n = e("../util/logger")
  17084. , r = new n(i)
  17085. , o = {
  17086. parseIdsFromChunkName: function(e, t) {
  17087. t.floorId = o.parseFloor(e),
  17088. t.roomId = o.parseRoom(e)
  17089. },
  17090. parseFloor: function(e) {
  17091. var t = e.match(/_group([0-9]+)/);
  17092. if (!t)
  17093. return 0;
  17094. try {
  17095. return parseInt(t[1], 10)
  17096. } catch (e) {
  17097. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  17098. 0
  17099. }
  17100. },
  17101. parseRoom: function(e) {
  17102. var t = e.match(/_sub([0-9]+)/);
  17103. if (!t)
  17104. return -1;
  17105. try {
  17106. return parseInt(t[1], 10)
  17107. } catch (e) {
  17108. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  17109. 0
  17110. }
  17111. }
  17112. };
  17113. t.exports = o
  17114. }
  17115. ).call(this, "/js/model/Chunks.js")
  17116. }
  17117. , {
  17118. "../util/logger": 189
  17119. }],
  17120. 136: [function(e, t, i) {
  17121. (function(i) {
  17122. "use strict";
  17123. function n(e) {
  17124. s.call(this),
  17125. this.model = e,
  17126. this.exploded = !1
  17127. }
  17128. var r = e("../objects/Floor")
  17129. , o = (e("../settings"),
  17130. e("../util/logger"))
  17131. , a = e("../util/transitions")
  17132. , s = e("../util/IndexedCollection")
  17133. , l = e("../util/common")
  17134. , c = e("../util/easing");
  17135. new o(i);
  17136. l.inherit(n, s),
  17137. n.prototype.add = function(e) {
  17138. s.prototype.add.call(this, e),
  17139. this.model.add(e)
  17140. }
  17141. ,
  17142. n.prototype.getIndex = function(e) {
  17143. return e.floorIndex
  17144. }
  17145. ,
  17146. n.prototype.build = function() {
  17147. this.list.forEach(function(e) {
  17148. e.build()
  17149. })
  17150. }
  17151. ,
  17152. n.prototype.size = function() {
  17153. return this.length
  17154. }
  17155. ,
  17156. n.prototype.sort = function() {
  17157. s.prototype.sort.call(this, function(e, t) {
  17158. return e.floorIndex - t.floorIndex
  17159. })
  17160. }
  17161. ,
  17162. n.prototype.nextFloor = function(e, t) {
  17163. return this.index[e.floorIndex + t] || null
  17164. }
  17165. ,
  17166. n.prototype.getFloorAtPoint = function(e) {
  17167. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17168. var r = this.list[n]
  17169. , o = r.distanceToPoint(e);
  17170. (!t || i > o) && (i = o,
  17171. t = r)
  17172. }
  17173. return t
  17174. }
  17175. ,
  17176. n.prototype.getOrMakeFloor = function(e) {
  17177. var t = this.index[e];
  17178. return t || (t = new r(this.model,e),
  17179. this.add(t)),
  17180. t
  17181. }
  17182. ,
  17183. n.prototype.hide = function() {
  17184. this.list.forEach(function(e) {
  17185. e.hide()
  17186. })
  17187. }
  17188. ,
  17189. n.prototype.show = function() {
  17190. this.list.forEach(function(e) {
  17191. e.show()
  17192. })
  17193. }
  17194. ,
  17195. n.prototype.names = function() {
  17196. return this.list.reduce(function(e, t) {
  17197. return e.concat(t.name)
  17198. }, [])
  17199. }
  17200. ,
  17201. n.prototype.toggleExplodeHorizontal = function() {
  17202. function e(e, t) {
  17203. r.copy(e.position),
  17204. e.position.x = i[e.floorIndex] * t,
  17205. e.position.y = 1 * e.floorIndex * t,
  17206. r.sub(e.position).multiplyScalar(-1),
  17207. e.panos.forEach(function(e) {
  17208. e.translate(r)
  17209. })
  17210. }
  17211. var t, i = [], n = 0;
  17212. this.list.forEach(function(e, r, o) {
  17213. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17214. n += t,
  17215. i[r] = n
  17216. }),
  17217. i = i.map(function(e) {
  17218. return e - n / 2
  17219. });
  17220. var r = this.list[0].position.clone();
  17221. this.exploded ? this.list.forEach(function(t) {
  17222. a.start(function(i) {
  17223. e(t, 1 - i)
  17224. }, 1500, null, 0, c.easeOutExpo)
  17225. }) : this.list.forEach(function(t) {
  17226. a.start(function(i) {
  17227. e(t, i)
  17228. }, 1500, null, 0, c.easeOutExpo)
  17229. }),
  17230. this.exploded = !this.exploded
  17231. }
  17232. ,
  17233. n.prototype.toggleExplodeVertical = function() {
  17234. function e(e, i) {
  17235. var n = n.copy(e.position);
  17236. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17237. n.sub(e.position).multiplyScalar(-1),
  17238. e.panos.forEach(function(e) {
  17239. e.translate(n)
  17240. })
  17241. }
  17242. var t = this.model.size;
  17243. this.list[0].position.clone();
  17244. this.exploded ? this.list.forEach(function(t) {
  17245. a.start(function(i) {
  17246. e(t, 1 - i)
  17247. }, 1500, null, 0, c.easeOutExpo)
  17248. }) : this.list.forEach(function(t) {
  17249. a.start(function(i) {
  17250. e(t, i)
  17251. }, 1500, null, 0, c.easeOutExpo)
  17252. }),
  17253. this.exploded = !this.exploded
  17254. }
  17255. ,
  17256. t.exports = n
  17257. }
  17258. ).call(this, "/js/model/FloorCollection.js")
  17259. }
  17260. , {
  17261. "../objects/Floor": 146,
  17262. "../settings": 166,
  17263. "../util/IndexedCollection": 175,
  17264. "../util/common": 185,
  17265. "../util/easing": 186,
  17266. "../util/logger": 189,
  17267. "../util/transitions": 195
  17268. }],
  17269. 137: [function(e, t, i) {
  17270. (function(i) {
  17271. "use strict";
  17272. function n() {
  17273. c.call(this)
  17274. }
  17275. var r = e("../settings")
  17276. , o = e("../util/logger")
  17277. , a = e("../enum/Viewmode")
  17278. , s = e("../objects/Snapshot")
  17279. , l = (e("../util/math"),
  17280. e("../util/common"))
  17281. , c = e("../util/IndexedCollection")
  17282. , h = new o(i);
  17283. l.inherit(n, c),
  17284. n.prototype.getImage = function(e) {
  17285. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17286. }
  17287. ,
  17288. n.prototype.filterByModesAndReel = function(e, t) {
  17289. for (var i = [], n = 0; n < t.length; n += 1) {
  17290. var r = t[n]
  17291. , o = this.index[r.sid];
  17292. o && i.push(o)
  17293. }
  17294. var s = e[a.DOLLHOUSE]
  17295. , l = e[a.FLOORPLAN];
  17296. i = i.filter(function(e) {
  17297. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17298. return !0;
  17299. var t;
  17300. try {
  17301. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17302. } catch (e) {
  17303. return h.debug(e.message),
  17304. !1
  17305. }
  17306. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17307. }),
  17308. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17309. this.list = i,
  17310. this.reIndex()
  17311. }
  17312. ,
  17313. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17314. if (0 === this.list.length)
  17315. return [];
  17316. var locations = [];
  17317. var deal = (info, container)=>{
  17318. var src = info.thumbnail_signed_src,
  17319. o = info.name || "";
  17320. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17321. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17322. let a = panos.get(info.metadata.scan_id);
  17323. if (a && !a.isAligned()) return
  17324. }
  17325. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17326. if (cameraMode === a.MESH) return
  17327. if(window.isLocal)src = manage.dealURL(src)
  17328. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17329. var l = {
  17330. cameraMode: cameraMode,
  17331. position: info.metadata.camera_position,
  17332. quaternion: info.metadata.camera_quaternion,
  17333. zoom: info.metadata.zoom,
  17334. panoId: info.metadata.scan_id,
  17335. orthoZoom: info.metadata.ortho_zoom,
  17336. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17337. thumbUrl: src,
  17338. name: n.filterImageName(o),
  17339. sid: info.sid
  17340. }
  17341. var item = new s(l);
  17342. item.momentTour = info.momentTour
  17343. container.push(item)
  17344. return item
  17345. }
  17346. }
  17347. this.list.forEach(image=>{
  17348. if(image.images){
  17349. var folder = $.extend({}, image )
  17350. folder.heroLocations = [];
  17351. image.images.list.forEach(child=>{
  17352. deal(child, folder.heroLocations);
  17353. })
  17354. folder.musicInfo = folder.musicInfo || {}
  17355. locations.push(folder)
  17356. delete folder.images;
  17357. delete folder.locations;
  17358. }else{
  17359. var item = deal(image, locations);
  17360. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17361. }
  17362. })
  17363. return locations
  17364. }
  17365. ,
  17366. n.prototype.getIndex = function(e) {
  17367. return e.sid
  17368. }
  17369. ,
  17370. n.filterImageName = function(e) {
  17371. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17372. }
  17373. ,
  17374. t.exports = n
  17375. }
  17376. ).call(this, "/js/model/ImageCollection.js")
  17377. }
  17378. , {
  17379. "../enum/Viewmode": 51,
  17380. "../objects/Snapshot": 153,
  17381. "../settings": 166,
  17382. "../util/IndexedCollection": 175,
  17383. "../util/common": 185,
  17384. "../util/logger": 189,
  17385. "../util/math": 190
  17386. }],
  17387. 138: [function(e, t, i) {
  17388. (function(i) {
  17389. "use strict";
  17390. function n() {
  17391. u.call(this)
  17392. }
  17393. var r = e("../label/Label")
  17394. , o = e("../settings")
  17395. , a = e("../util/logger")
  17396. , s = e("../util/math")
  17397. , l = e("../util/ajax")
  17398. , c = e("./RoomCollection")
  17399. , h = e("../util/common")
  17400. , u = e("../util/IndexedCollection");
  17401. new a(i);
  17402. h.inherit(n, u),
  17403. n.prototype.getIndex = function(e) {
  17404. return e.labelId
  17405. }
  17406. ,
  17407. n.prototype.associateWithRooms = function(e) {
  17408. this.forEach(function(t) {
  17409. e.forEach(function(e) {
  17410. e.roomId === t.roomId && (t.room = e)
  17411. })
  17412. })
  17413. }
  17414. ,
  17415. n.prototype.createFromLabelData = function(e) {
  17416. e.forEach(function(e) {
  17417. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17418. t = c.generateRoomId(e.floorId, t);
  17419. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17420. i.position = s.convertWorkshopVector(i.position),
  17421. this.add(i),
  17422. i.build()
  17423. }
  17424. .bind(this))
  17425. }
  17426. ,
  17427. n.prototype.load = function(e, t) {
  17428. return l.get(e, {
  17429. responseType: "json",
  17430. auth: t ? o.authorizationHeader : null
  17431. }).done(function(e) {
  17432. var t = [];
  17433. for (var i in e) {
  17434. var n = e[i];
  17435. t.push(n)
  17436. }
  17437. this.createFromLabelData(t)
  17438. }
  17439. .bind(this))
  17440. }
  17441. ,
  17442. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17443. var t = -1;
  17444. if (e) {
  17445. var i = e.split("_");
  17446. t = parseInt(i[0])
  17447. }
  17448. return t
  17449. }
  17450. ,
  17451. t.exports = n
  17452. }
  17453. ).call(this, "/js/model/LabelCollection.js")
  17454. }
  17455. , {
  17456. "../label/Label": 90,
  17457. "../settings": 166,
  17458. "../util/IndexedCollection": 175,
  17459. "../util/ajax": 181,
  17460. "../util/common": 185,
  17461. "../util/logger": 189,
  17462. "../util/math": 190,
  17463. "./RoomCollection": 141
  17464. }],
  17465. 139: [function(e, t, i) {
  17466. (function(i) {
  17467. "use strict";
  17468. function n(e, t) {
  17469. o.Object3D.call(this)
  17470. this.sid = window.number;//t.sid,
  17471. this.data = t,
  17472. this.options = e,
  17473. this.urls = new s(e.urlFiles),
  17474. this.isPublic = void 0 !== t.is_public && t.is_public,
  17475. //创建heroLocations
  17476. this.images = new _(this),
  17477. this.images.extend(t.images),
  17478. this.images.forEach((info)=>{
  17479. if(info.locations){
  17480. info.images = new _(this);
  17481. info.images.extend(info.locations)
  17482. }
  17483. })
  17484. this.heroLocations = []
  17485. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17486. this.outdoorPanoLocations = [],
  17487. this.floors = new d(this),
  17488. this.floorsEnabled = void 0 === e.floors || e.floors,
  17489. this.changingFloor = !1,
  17490. this.chunks = [],
  17491. this.panos = new A,
  17492. this.colliders = [],
  17493. this.loadPanosPromise = null,
  17494. this.loadMeshTexturesPromise = null,
  17495. this.auxDataPromise = null,
  17496. this.meshTexturesLoaded = !1,
  17497. this.meshTextures = [],
  17498. this.tags = {},
  17499. this.tagsShown = !1,
  17500. this.shouldShowtags = !1,
  17501. this.has360Views = !1,
  17502. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17503. this.supportedModes = {},
  17504. this.supportedModes[c.PANORAMA] = !0,
  17505. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17506. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17507. this.supportedModes[c.TRANSITIONING] = !0,
  17508. this.supportsTiles = this.configureTiling(),
  17509. // this.supportsVR = t.is_vr,
  17510. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17511. this.mode = c.DOLLHOUSE,
  17512. this.size = null,
  17513. this.center = null,
  17514. this.boundingBox = new o.Box3,
  17515. this.currentFloor = null,
  17516. this.allFloorsVisible = !0,
  17517. this.projectedPano0 = null,
  17518. this.projectedPano1 = null,
  17519. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17520. this.addFloor(new u(this,t,e.trim()))
  17521. }
  17522. .bind(this)),
  17523. this.waitQueue = [],
  17524. this.on("load", function(e) {
  17525. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17526. return !e.isLoadedCallback()
  17527. }),
  17528. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17529. }
  17530. .bind(this)),
  17531. this.setupCustomProperties()
  17532. this.hots = {};
  17533. }
  17534. function r() {
  17535. try {
  17536. var e = document.createElement("canvas")
  17537. , t = e.getContext("webgl");
  17538. t || (t = e.getContext("experimental-webgl"));
  17539. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17540. return i
  17541. } catch (e) {
  17542. return 0
  17543. }
  17544. }
  17545. var o = e("three")
  17546. , a = e("../util/ajax")
  17547. , s = e("../util/ModelUrls")
  17548. , l = e("../objects/BoundingTextureSkybox")
  17549. , c = e("../enum/Viewmode")
  17550. , h = e("../enum/RenderOrder")
  17551. , u = (e("../enum/AlignmentType"),
  17552. e("../objects/Floor"))
  17553. , d = e("./FloorCollection")
  17554. , p = e("../objects/Chunk")
  17555. , f = (e("../objects/Room"),
  17556. e("../objects/Snapshot"),
  17557. e("../label/Label"),
  17558. e("../util/math"),
  17559. e("../settings"))
  17560. ,ss = e("../shaders")
  17561. , g = e("../util/logger")
  17562. , m = e("../tag/tag")
  17563. , v = (e("../tag/tagManager"),
  17564. e("../objects/Panorama"))
  17565. , A = e("../util/PanoramaCollection")
  17566. , y = e("../loaders/ModelLoader")
  17567. , C = e("../loaders/ModelTextureLoader")
  17568. , I = e("../loaders/SweepDataLoader")
  17569. , E = e("../util/transitions")
  17570. , b = e("../util/common")
  17571. , es = e("../util/easing")
  17572. ,lerp = e("../util/lerp")
  17573. ,tex = e("../util/texture")
  17574. , w = e("./../util/browser")
  17575. , _ = e("./ImageCollection")
  17576. , T = e("./RoomCollection")
  17577. , x = e("./LabelCollection")
  17578. , S = e("./Chunks")
  17579. , M = e("./../util/showcase")
  17580. , R = e("../exception/BasicException")
  17581. , P = (e("../constants")
  17582. ,e("events").EventEmitter)
  17583. ,Hot = e("hot")
  17584. , O = new g(i);
  17585. n.prototype = Object.create(o.Object3D.prototype),
  17586. b.extend(n, P),
  17587. n.prototype.setupCustomProperties = function() {
  17588. var e = f.modelAlpha;
  17589. Object.defineProperty(this, "alpha", {
  17590. get: function() {
  17591. return e
  17592. },
  17593. set: function(t) {
  17594. e = t,
  17595. this.chunks.forEach(function(t) {
  17596. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17597. })
  17598. }
  17599. })
  17600. }
  17601. ,
  17602. n.prototype.configureTiling = function() {
  17603. var e = r();
  17604. if (e < 2048)
  17605. return !1;
  17606. O.warn("Max cube texture size: " + e);
  17607. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17608. var i = f.tiling.tilingFlagNames[t];
  17609. if ("1" === w.valueFromHash(i, null))
  17610. return !0;
  17611. if ("0" === w.valueFromHash(i, null))
  17612. return !1
  17613. }
  17614. //--------------------------------------------许钟文-------------------------------------------
  17615. //return true;
  17616. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17617. //--------------------------------------------e n d -------------------------------------------
  17618. }
  17619. ,
  17620. n.prototype.toggleAlpha = function() {
  17621. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17622. }
  17623. ,
  17624. n.prototype.load = function(e) {
  17625. var t = function() {
  17626. return $.when(this.loadPanos(), this.loadMesh())
  17627. }
  17628. , i = this.urls.init().then(t.bind(this));
  17629. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17630. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17631. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17632. }
  17633. ,
  17634. n.prototype.loadMesh = function() {
  17635. function e(e) {
  17636. O.error(e),
  17637. n.reject("loading-failed")
  17638. }
  17639. function t(e, t) {
  17640. n.notify(e, t)
  17641. }
  17642. function i(e, t) {
  17643. if (0 === e.length) {
  17644. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17645. r.supportedModes[c.DOLLHOUSE] = !1,
  17646. r.supportedModes[c.FLOORPLAN] = !1;
  17647. var i = new p({
  17648. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17649. });
  17650. i.material.visible = !1,
  17651. i.rotateX(-Math.PI / 2),
  17652. i.geometry.computeBoundingBox(),
  17653. e = [i]
  17654. }
  17655. e.forEach(function(e) {
  17656. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17657. r.addChunk(t, e)
  17658. }),
  17659. r.floors.sort(),
  17660. n.resolve(r)
  17661. }
  17662. var n = $.Deferred()
  17663. , r = this;
  17664. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17665. n.promise()
  17666. }
  17667. ,
  17668. n.prototype.loadMeshTextures = function() {
  17669. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17670. this.meshTexturesLoaded = !0
  17671. }
  17672. .bind(this)),
  17673. this.loadTexturesPromise)
  17674. }
  17675. ,
  17676. /* n.prototype.loadtags = function() {//xzw改
  17677. var e = $.Deferred();
  17678. if (!f.tags.enabled)
  17679. return e.resolve();
  17680. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17681. t = "data/" + this.sid + "/tags.json"
  17682. return a.get(t, {
  17683. responseType: "json",
  17684. auth: this.isPublic ? null : f.authorizationHeader
  17685. }).done(function(t) {
  17686. var i = 0
  17687. , n = 0;
  17688. for (var r in t) {
  17689. var o = t[r];
  17690. o.enabled && (n++,
  17691. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17692. i++))
  17693. }
  17694. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17695. e.resolve()
  17696. }
  17697. .bind(this)).fail(function() {
  17698. O.warn("Getting tags failed, not displaying tags."),
  17699. e.resolve()
  17700. }),
  17701. e
  17702. } */
  17703. n.prototype.shineHots = function(){ //xzw
  17704. E.trigger({
  17705. func: function(e) {
  17706. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17707. for(var i in this.hots){
  17708. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17709. }
  17710. }.bind(this),
  17711. cycling: true,
  17712. duration: 3000,
  17713. //easing: "easeInOutQuad",
  17714. name: "hotShine"
  17715. })
  17716. },
  17717. n.prototype.createHotItem = function(data, hots) {
  17718. var docFragment = document.createDocumentFragment();
  17719. var keyAry = Object.keys(data);
  17720. for(var i = 0; i < keyAry.length; i++){
  17721. var li = document.createElement('li');
  17722. var span = document.createElement('span');
  17723. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  17724. // console.log(span.innerHTML);
  17725. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  17726. li.appendChild(span);
  17727. docFragment.appendChild(li);
  17728. }
  17729. var ul = document.querySelector('#hotListContent ul');
  17730. ul.appendChild(docFragment);
  17731. console.log(docFragment);
  17732. }
  17733. n.prototype.loadOverlays = function(overlays){
  17734. //var overlays = window.data2 && window.data2.overlays
  17735. var overlays = [{"media":["text"],"depth":0.02,"file":"https://super.4dage.com/data/791/edit/20210128_141321391.jpg","pos":[-37.601, 7.533, 14.007],"hasBox":0,"width":6.5705,"qua":[0, 0.6942, 0, 0.7198],"height":3.5873,"sid":"1611814305459"},{"media":["photo"],"depth":0.02,"file":"images/textbg.jpg","pos":[-37.601, 7.533, 14.007],"hasBox":0,"width":6.5705,"qua":[0, 0.6942, 0, 0.7198],"height":3.5873,"sid":"1611814305459"}]
  17736. overlays && overlays.forEach((info)=>{
  17737. new Overlay(info)
  17738. })
  17739. Overlay.load()
  17740. }
  17741. n.prototype.loadhots = function() {//xzw
  17742. var e = $.Deferred();
  17743. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17744. return a.get(t, {
  17745. responseType: "json",
  17746. auth: this.isPublic ? null : f.authorizationHeader
  17747. }).done(function(t) {
  17748. window.data2 = t;
  17749. if(!t){
  17750. console.error("data2 is null")
  17751. }else{
  17752. g_data2 = hotMatcher(t);
  17753. this.hotsCount = 0;
  17754. /* for(var i in t.hots){
  17755. this.hotsCount ++;
  17756. this.hots[i] = new Hot(i, t.hots[i], this);
  17757. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  17758. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  17759. };
  17760. window.hotData = t.hots
  17761. t.hots && this.createHotItem(t.hots, this.hots); */
  17762. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17763. window.hotData = {}
  17764. if(t.hots){
  17765. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  17766. sids.forEach((sid)=>{
  17767. this.hotsCount++,
  17768. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  17769. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  17770. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  17771. window.hotData[sid] = t.hots[sid];
  17772. })
  17773. }
  17774. this.createHotItem(window.hotData, this.hots);
  17775. g_index = w.valueFromHash("m");
  17776. /* if(t.tourAudio){
  17777. g_tourAudio = new Audio;
  17778. g_tourAudio.loop = false;
  17779. g_tourAudio.addEventListener('ended', function () {
  17780. var ev = document.createEvent("MouseEvent");
  17781. ev.initEvent("tourAudioEnded",true,true);
  17782. window.dispatchEvent(ev);
  17783. });
  17784. }; */
  17785. }
  17786. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17787. /* var dataJsPromise = $.Deferred();
  17788. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17789. a.get(dataJsUrl,{
  17790. responseType: "json",
  17791. auth: this.isPublic ? null : f.authorizationHeader
  17792. }).done(function(data) {
  17793. window.hotData = data;
  17794. this.createHotItem(data, this.hots);
  17795. for(let i in this.hots){//add
  17796. data[i] && this.hots[i].initStyleImg(data[i]);
  17797. }
  17798. dataJsPromise.resolve();
  17799. }.bind(this)).fail(function(){
  17800. console.log('Data.js is empty');
  17801. dataJsPromise.resolve();
  17802. }) */
  17803. e.resolve();
  17804. }.bind(this)).fail(function() {
  17805. console.log('没有热点');
  17806. e.resolve()
  17807. }),
  17808. e
  17809. }
  17810. ,
  17811. n.prototype.loadPanos = function() {
  17812. if (this.loadPanosPromise)
  17813. return this.loadPanosPromise;
  17814. var e = new I(this);
  17815. return this.loadPanosPromise = e.load().then(function(e) {
  17816. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17817. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17818. else console.log(e.uuid)
  17819. }
  17820. .bind(this))),
  17821. this.panos.extend(e.map(function(e) {
  17822. return new v(this,e.uuid,e,this.supportsTiles)
  17823. }
  17824. .bind(this))),
  17825. this.panos.forEach(function(e) {
  17826. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17827. var i = this.panos.get(t);
  17828. i && this.panos.setNeighbour(e, i, !0)
  17829. }
  17830. .bind(this)),
  17831. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17832. }
  17833. .bind(this)),
  17834. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17835. this.supportedModes[c.PANORAMA] = !1),
  17836. $.when(this)
  17837. }
  17838. .bind(this)),
  17839. this.loadPanosPromise
  17840. }
  17841. ,
  17842. n.prototype.loadHighlightReel = function() {//xzw
  17843. var e = $.Deferred()
  17844. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17845. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17846. return a.get(t, {
  17847. responseType: "json",
  17848. auth: this.isPublic ? null : f.authorizationHeader
  17849. }).done(function(t) {
  17850. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17851. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17852. e.resolve()
  17853. }
  17854. .bind(this)).fail(function() {
  17855. O.warn("Getting highlight reel failed, no highlights available"),
  17856. e.resolve()
  17857. }),
  17858. e
  17859. }
  17860. ,
  17861. n.prototype.waitForLoad = function(e, t) {
  17862. t() || (this.waitQueue.push({
  17863. object: e,
  17864. isLoadedCallback: t
  17865. }),
  17866. 1 === this.waitQueue.length && this.emit("waiting"))
  17867. }
  17868. ,
  17869. n.prototype.hide = function() {
  17870. this.floors.hide()
  17871. }
  17872. ,
  17873. n.prototype.show = function() {
  17874. this.floors.show()
  17875. }
  17876. ,
  17877. n.prototype.floorNames = function() {
  17878. return this.floors.names()
  17879. }
  17880. ,
  17881. n.prototype.warpDestFloors = function(e, t) {
  17882. if (!e || this.floors.length !== e.length)
  17883. return void this.toggleAllFloors(!0);
  17884. var i = e.findIndex(function(e) {
  17885. return e
  17886. }
  17887. .bind(this));
  17888. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17889. }
  17890. ,
  17891. n.prototype.setFloor = function(e, t, i) {
  17892. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17893. this.allFloorsVisible = !1,
  17894. this._setFloor(e, t, i)
  17895. }
  17896. ,
  17897. n.prototype.toggleAllFloors = function(e) {
  17898. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17899. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17900. this._setFloor(this.currentFloor)
  17901. }
  17902. ,
  17903. n.prototype._setFloor = function(e, t, i) {
  17904. t = t || this.mode,
  17905. this.emit("floor.changed", e, t, this.currentFloor),
  17906. this.currentFloor = e;
  17907. var n;
  17908. if (t === c.PANORAMA) {
  17909. if (this.show(),
  17910. this.shouldShowtags && this.tagsShown)
  17911. for (n in this.tags)
  17912. this.tags[n].show(f.showFloorDuration)
  17913. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17914. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17915. }
  17916. .bind(this)),
  17917. this.shouldShowtags && this.tagsShown))
  17918. for (n in this.tags) {
  17919. var r = this.tags[n];
  17920. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17921. }
  17922. var o = this
  17923. , a = e;
  17924. E.start(function() {}, f.showFloorDelay, function() {
  17925. o.floors.forEach(function(e) {
  17926. e.chunks.forEach(function(t) {
  17927. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17928. })
  17929. })
  17930. }
  17931. .bind(this))
  17932. }
  17933. ,
  17934. n.prototype.toggleExplode = function() {
  17935. this.floors.toggleExplodeHorizontal()
  17936. }
  17937. ,
  17938. n.prototype.toggleExplodeUp = function() {
  17939. this.floors.toggleExplodeVertical()
  17940. }
  17941. ,
  17942. n.prototype.nextFloor = function(e) {
  17943. return this.floors.nextFloor(this.currentFloor, e)
  17944. }
  17945. ,
  17946. n.prototype.addFloor = function(e) {
  17947. this.floors.add(e)
  17948. }
  17949. ,
  17950. n.prototype.getFloorAtPoint = function(e) {
  17951. return this.floors.getFloorAtPoint(e)
  17952. }
  17953. ,
  17954. n.prototype.getTagBySid = function(e) {
  17955. return this.tags[e]
  17956. }
  17957. ,
  17958. n.prototype.addChunk = function(e, t) {
  17959. this.floors.getOrMakeFloor(e).addChunk(t),
  17960. this.chunks.push(t)
  17961. }
  17962. ,
  17963. n.prototype.setMode = function(e) {
  17964. if (!this.supportedModes[e])
  17965. throw new R("Mode not supported for this model: " + e);
  17966. this.mode = e;
  17967. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17968. this.chunks.forEach(function(t) {
  17969. t.setMode(e)
  17970. })
  17971. }
  17972. ,
  17973. n.prototype.build = function() {
  17974. this.heroLocations = this.images.getHeroLocations(this.panos);
  17975. var e = function() {
  17976. 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()
  17977. }
  17978. .bind(this)();
  17979. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17980. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17981. }
  17982. .bind(this)) || e,
  17983. null === this.heroImage && O.warn("No hero image defined."),
  17984. this.currentFloor = this.floors.last(),
  17985. this.floors.build(),
  17986. this.colliders = this.floors.reduce(function(e, t) {
  17987. return e.concat(t.collider.children)
  17988. }, []),
  17989. this.panos.forEach(function(e) {
  17990. e.build1(),
  17991. e.on("enter", function() {
  17992. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17993. }
  17994. .bind(this))
  17995. }
  17996. .bind(this)),
  17997. this.panos.forEach(function(e) {
  17998. e.build2()
  17999. }),
  18000. this.floors.forEach(function(e) {
  18001. this.boundingBox.union(e.boundingBox)
  18002. }
  18003. .bind(this)),
  18004. this.size = this.boundingBox.size(),
  18005. this.center = this.boundingBox.center(),
  18006. this.floors.forEach(function(e) {
  18007. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  18008. }
  18009. .bind(this)),
  18010. this.panos.populate_path_graph(),
  18011. this.skybox = new l(this.boundingBox),
  18012. this.skybox.matrixWorldNeedsUpdate = !0,
  18013. this.add(this.skybox);
  18014. setTimeout(function(){
  18015. this.hotsCount && this.shineHots();
  18016. }.bind(this),1300);//xzw 热点开始闪烁
  18017. for (var t in this.tags)
  18018. this.tags[t].build();
  18019. //add-----
  18020. for(let i in this.hots){
  18021. this.hots[i].setVisiblePanos(this.hots[i].visibleData);
  18022. }
  18023. //---------
  18024. this.createFloorLogo()
  18025. return O.debug("Done building model"),
  18026. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  18027. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  18028. this.buildRooms(),
  18029. this.labels.associateWithRooms(this.rooms),
  18030. $.when(this)
  18031. }
  18032. ,
  18033. n.prototype.createFloorLogo = function(){
  18034. console.log('createFloorLogo')
  18035. if(this.floorLogos || !settings.floorlogoURL)return;
  18036. var url = settings.floorlogoURL
  18037. var map = tex.load(url);//可以追加done
  18038. this.floorLogos = [];
  18039. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  18040. var material = new o.MeshBasicMaterial({
  18041. opacity:0,
  18042. map:map,
  18043. side: o.DoubleSide,
  18044. transparent: !0,
  18045. depthWrite: !1,
  18046. depthTest:false//改 在chunk\skybox外也可看到
  18047. });
  18048. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  18049. //var s = (Store.metadata.floorLogoSize || 100)/100;
  18050. //logo.scale.set(s,s,s);
  18051. logo.position.set(0,-1.5,0);
  18052. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  18053. logo.renderOrder = 100;//cover the videoSkybox
  18054. //logo.layers.set(0)
  18055. this.add(logo);
  18056. this.floorLogos.push(logo);
  18057. }
  18058. this.floorLogos[1].visible = false;
  18059. }
  18060. n.prototype.adjustfloorLogoHeight = function(o){
  18061. var h = player.currentPano.floorPosition.y + 0.01;
  18062. this.floorLogos[1].position.setY(h);
  18063. this.floorLogos[0].position.setY(h);
  18064. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  18065. },
  18066. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  18067. if(!this.floorLogos) return;
  18068. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  18069. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  18070. if(!o.dur){//立刻
  18071. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  18072. this.floorLogos[o.index].material.opacity = o.opa;
  18073. }else{
  18074. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  18075. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  18076. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  18077. }
  18078. },
  18079. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  18080. var lastQ, lastP;
  18081. var equals = function(v1, v2, min){
  18082. return Math.abs(v1-v2) < min
  18083. }
  18084. var isSame = function(now, last, k){//如果和上次相同就不改变
  18085. if(!last)return false;
  18086. var R = k.sceneRenderer;
  18087. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18088. //暂时:
  18089. var min = 0.0008
  18090. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18091. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18092. return same;
  18093. }
  18094. return function(Q, k){
  18095. if(!Q)return;
  18096. /* if(Config.ifFish && window.lowFPS){
  18097. this.fLCompute++;
  18098. if(R.AFPS < 38){
  18099. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18100. else if(k.flying && k.fLCompute%2 !=1) return;
  18101. k.fLCompute %= 4;
  18102. }else if(R.AFPS < 45){
  18103. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18104. else if(k.flying && k.fLCompute%2 !=1) return;
  18105. k.fLCompute %= 6;
  18106. }else{
  18107. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18108. //else if(k.flying && k.fLCompute%2 !=1) return;
  18109. k.fLCompute %= 2;
  18110. }
  18111. } */
  18112. var sameQ, sameP, quaternion, visible;
  18113. for(var i=0;i<2;i++){
  18114. var logo = this.floorLogos[i];
  18115. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18116. visible = true;
  18117. }
  18118. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18119. var c = k.cameraControls.activeControl;
  18120. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18121. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18122. for(var i=0;i<2;i++){
  18123. var logo = this.floorLogos[i];
  18124. if(!sameQ){
  18125. if(!quaternion){
  18126. var a = new THREE.Vector3(0,0,-1);
  18127. a.applyQuaternion(Q);
  18128. a.setY(0);
  18129. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18130. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18131. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18132. quaternion.multiply(a);
  18133. }
  18134. logo.quaternion.copy(quaternion);
  18135. }
  18136. }
  18137. }
  18138. }()
  18139. n.prototype.loadLabels = function() {//xzw
  18140. this.labels = new x(this);
  18141. var e = $.Deferred();
  18142. //加载俯视图的标签 注释这个备注就会加载
  18143. /* window.MP_PREFETCHED_MODELDATA.model.player_options.labels ? this.showingLabels = true : '';
  18144. if (!this.showingLabels) */
  18145. return e.resolve();
  18146. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18147. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18148. console.log(t);
  18149. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18150. O.warn("Getting labels failed, not displaying labels."),
  18151. e.resolve()
  18152. }),
  18153. e
  18154. }
  18155. ,
  18156. n.prototype.buildRooms = function() {
  18157. this.rooms = new T(this),
  18158. this.rooms.createFromChunks(this.chunks),
  18159. this.rooms.calcRoomBoundaries()
  18160. }
  18161. ,
  18162. n.prototype.updateProjectedPanos = function() {
  18163. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18164. }
  18165. ,
  18166. n.prototype.setProjectedPanos = function(e, t, i) {
  18167. void 0 !== i && null !== i || (i = !0),
  18168. i = !!i,
  18169. this.projectedPano0 = e,
  18170. this.projectedPano1 = t,
  18171. this.skybox.material.setProjectedPanos(e, t, i),
  18172. this.chunks.forEach(function(n) {
  18173. n.materialInside.setProjectedPanos(e, t, i)
  18174. })
  18175. }
  18176. ,
  18177. n.prototype.setSide = function(e) {
  18178. this.floors.forEach(function(t) {
  18179. t.collider.material.side = e
  18180. })
  18181. }
  18182. ,
  18183. n.prototype.heroCount = function() {
  18184. return this.heroLocations ? this.heroLocations.length : 0
  18185. }
  18186. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18187. if (e[0] < 0)
  18188. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18189. null;
  18190. if (this.heroCount() < 1)
  18191. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18192. null;
  18193. var t = this.heroLocations[e[0]];
  18194. if(t.heroLocations && e[1]!=void 0){
  18195. t = t.heroLocations[e[1]];
  18196. }
  18197. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18198. null) : t
  18199. }
  18200. ,
  18201. n.prototype.findPanoramicHero = function() {
  18202. for (var e in this.heroLocations)
  18203. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18204. return this.heroLocations[e];
  18205. return null
  18206. }
  18207. ,
  18208. n.prototype.listImagePanos = function() {
  18209. var e = []
  18210. , t = this;
  18211. return this.images.forEach(function(i) {
  18212. if (i.metadata && i.metadata.scan_id) {
  18213. var n = t.panos.get(i.metadata.scan_id);
  18214. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18215. }
  18216. }),
  18217. e
  18218. }
  18219. ,
  18220. n.prototype.fadePanoMarkers = function(e, t) {
  18221. this.panos.fadeMarkerOpacity(e, t)
  18222. }
  18223. ,
  18224. n.prototype.setSweepVisibility = function(e) {
  18225. this.panos.forEach(function(t) {
  18226. t.marker && (t.marker.visible = e)
  18227. })
  18228. }
  18229. ,
  18230. n.prototype.outsideAllowed = function() {
  18231. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18232. }
  18233. ,
  18234. t.exports = n
  18235. }
  18236. ).call(this, "/js/model/Model.js")
  18237. }
  18238. , {
  18239. "../constants": 8,
  18240. "../enum/AlignmentType": 17,
  18241. "../enum/RenderOrder": 42,
  18242. "../enum/Viewmode": 51,
  18243. "../exception/BasicException": 55,
  18244. "../label/Label": 90,
  18245. "../loaders/ModelLoader": 105,
  18246. "../loaders/ModelTextureLoader": 106,
  18247. "../loaders/SweepDataLoader": 107,
  18248. "../tag/tag": 123,
  18249. "../tag/tagManager": 124,
  18250. "../objects/BoundingTextureSkybox": 143,
  18251. "../objects/Chunk": 144,
  18252. "../objects/Floor": 146,
  18253. "../objects/Panorama": 148,
  18254. "../objects/Room": 150,
  18255. "../objects/Snapshot": 153,
  18256. "../settings": 166,
  18257. "../shaders": 167,
  18258. "../util/ModelUrls": 177,
  18259. "../util/PanoramaCollection": 178,
  18260. "../util/ajax": 181,
  18261. "../util/common": 185,
  18262. "../util/easing": 186,
  18263. "../util/lerp": 188,
  18264. "../util/logger": 189,
  18265. "../util/math": 190,
  18266. "../util/texture": 194,
  18267. "../util/transitions": 195,
  18268. "./../util/browser": 182,
  18269. "./../util/showcase": 193,
  18270. "./Chunks": 135,
  18271. "./FloorCollection": 136,
  18272. "./ImageCollection": 137,
  18273. "./LabelCollection": 138,
  18274. "./RoomCollection": 141,
  18275. events: 202,
  18276. three: 217,
  18277. "hot": "hot"
  18278. }],
  18279. 140: [function(e, t, i) {
  18280. "use strict";
  18281. function n() {
  18282. this.modelMap = {},
  18283. this.activeModel = null,
  18284. this.modelCount = 0,
  18285. this.tileDownloader = null,
  18286. this.panoRenderer = null
  18287. }
  18288. var r = (e("three"),
  18289. e("../util/common"))
  18290. , o = e("../exception/BasicException")
  18291. , a = e("../enum/ModelManagerEvents")
  18292. , s = e("../enum/PanoRendererEvents")
  18293. , l = e("events").EventEmitter;
  18294. n.prototype.init = function(e, t, i) {
  18295. this.tileDownloader = e,
  18296. this.panoRenderer = t,
  18297. this.qualityManager = i,
  18298. this.bindEvents()
  18299. }
  18300. ,
  18301. n.prototype.bindEvents = function() {
  18302. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18303. }
  18304. ,
  18305. n.prototype.onTileRendered = function(e, t, i, n) {}
  18306. ,
  18307. n.prototype.addModel = function(e) {
  18308. this.modelMap[e.sid] = e,
  18309. 0 === this.modelCount && this.activateModel(e.sid),
  18310. this.modelCount++,
  18311. this.emit(a.ModelAdded)
  18312. }
  18313. ,
  18314. n.prototype.getModel = function(e) {
  18315. return this.modelMap[e]
  18316. }
  18317. ,
  18318. n.prototype.activateModel = function(e) {
  18319. var t = this.modelMap[e];
  18320. if (!t)
  18321. throw new o("Tried to activate invalid model!");
  18322. var i = this.activeModel;
  18323. this.activeModel = t,
  18324. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18325. this.tileDownloader.setUrls(t.urls),
  18326. t.panos.forEach(function(e) {
  18327. e.attachToPanoRenderer(this.panoRenderer),
  18328. e.tileDownloader = this.tileDownloader,
  18329. e.qualityManager = this.qualityManager
  18330. }
  18331. .bind(this)),
  18332. this.emit(a.ActiveModelChanged, {
  18333. oldModel: i,
  18334. model: t
  18335. })
  18336. }
  18337. ,
  18338. n.prototype.getActiveModel = function() {
  18339. return this.activeModel
  18340. }
  18341. ,
  18342. r.extend(n, l),
  18343. t.exports = n
  18344. }
  18345. , {
  18346. "../enum/ModelManagerEvents": 33,
  18347. "../enum/PanoRendererEvents": 35,
  18348. "../exception/BasicException": 55,
  18349. "../util/common": 185,
  18350. events: 202,
  18351. three: 217
  18352. }],
  18353. 141: [function(e, t, i) {
  18354. (function(i) {
  18355. "use strict";
  18356. function n() {
  18357. s.call(this)
  18358. }
  18359. var r = e("../objects/Room")
  18360. , o = (e("../settings"),
  18361. e("../util/logger"))
  18362. , a = (e("../util/transitions"),
  18363. e("../util/easing"),
  18364. e("../util/common"))
  18365. , s = e("../util/IndexedCollection")
  18366. , l = e("./Chunks");
  18367. new o(i);
  18368. a.inherit(n, s),
  18369. n.prototype.getIndex = function(e) {
  18370. return e.roomId
  18371. }
  18372. ,
  18373. n.prototype.calcRoomBoundaries = function() {
  18374. this.forEach(function(e) {
  18375. e.calcBoundaries()
  18376. })
  18377. }
  18378. ,
  18379. n.prototype.createFromChunks = function(e) {
  18380. var t = {
  18381. floorId: -1,
  18382. roomId: -1
  18383. }
  18384. , i = {};
  18385. e.forEach(function(e) {
  18386. l.parseIdsFromChunkName(e.name, t);
  18387. var o = i[t.roomId];
  18388. if (!o) {
  18389. var a = n.generateRoomId(t.floorId, t.roomId);
  18390. o = new r(t.floorId,a),
  18391. this.add(o),
  18392. i[t.roomId] = o
  18393. }
  18394. o.addChunk(e)
  18395. }
  18396. .bind(this)),
  18397. this.calcRoomBoundaries()
  18398. }
  18399. ,
  18400. n.generateRoomId = function(e, t) {
  18401. return e + "_" + t
  18402. }
  18403. ,
  18404. t.exports = n
  18405. }
  18406. ).call(this, "/js/model/RoomCollection.js")
  18407. }
  18408. , {
  18409. "../objects/Room": 150,
  18410. "../settings": 166,
  18411. "../util/IndexedCollection": 175,
  18412. "../util/common": 185,
  18413. "../util/easing": 186,
  18414. "../util/logger": 189,
  18415. "../util/transitions": 195,
  18416. "./Chunks": 135
  18417. }],
  18418. 142: [function(e, t, i) {
  18419. "use strict";
  18420. function n(e, t, i) {
  18421. e = e.clone().expandByScalar(0.01);//改
  18422. var n = e.size()
  18423. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18424. o.boundingBox = e,
  18425. r.Mesh.call(this, o, t),
  18426. this.position.copy(e.center()),
  18427. this.frustumCulled = !1,
  18428. i && this.add(new r.WireframeHelper(this))
  18429. }
  18430. var r = e("three");
  18431. n.prototype = Object.create(r.Mesh.prototype),
  18432. n.prototype.constructor = n,
  18433. t.exports = n
  18434. }
  18435. , {
  18436. three: 217
  18437. }],
  18438. 143: [function(e, t, i) {
  18439. (function(i) {
  18440. "use strict";
  18441. function n(e) {
  18442. h.time("Computing a nice bounding cubemap");
  18443. var t = new a({
  18444. side: r.BackSide,
  18445. transparent: !0
  18446. });
  18447. t.uniforms.modelAlpha.value = 0,
  18448. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18449. this.renderOrder = l.boundingSkybox,
  18450. o.call(this, e, t),
  18451. h.timeEnd("Computing a nice bounding cubemap")
  18452. }
  18453. var r = e("three")
  18454. , o = (e("../enum/Viewmode"),
  18455. e("../shaders"),
  18456. e("./BoundingMesh"))
  18457. , a = e("../materials/ModelTextureMaterial")
  18458. , s = e("../settings")
  18459. , l = e("../enum/RenderOrder")
  18460. , c = e("../util/logger")
  18461. , h = new c(i);
  18462. n.prototype = Object.create(o.prototype),
  18463. n.prototype.constructor = n,
  18464. t.exports = n
  18465. }
  18466. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18467. }
  18468. , {
  18469. "../enum/RenderOrder": 42,
  18470. "../enum/Viewmode": 51,
  18471. "../materials/ModelTextureMaterial": 118,
  18472. "../settings": 166,
  18473. "../shaders": 167,
  18474. "../util/logger": 189,
  18475. "./BoundingMesh": 142,
  18476. three: 217
  18477. }],
  18478. 144: [function(e, t, i) {
  18479. "use strict";
  18480. function n(e) {
  18481. this.materialInside = new s({
  18482. side: r.DoubleSide
  18483. });
  18484. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18485. this.materialOutside = new r.RawShaderMaterial({
  18486. fragmentShader: o.modelOutside.fragmentShader,
  18487. vertexShader: o.modelOutside.vertexShader,
  18488. uniforms: t,
  18489. side: r.FrontSide,
  18490. name: "chunkOut"
  18491. }),
  18492. r.Mesh.call(this, e.geometry, this.materialInside),
  18493. this.name = e.name || "",
  18494. this.textureName = e.textureName,
  18495. this.meshUrl = e.meshUrl
  18496. }
  18497. var r = e("three")
  18498. , o = e("../shaders")
  18499. , a = e("../enum/Viewmode")
  18500. , s = e("../materials/ModelTextureMaterial");
  18501. n.prototype = Object.create(r.Mesh.prototype),
  18502. n.prototype.setTextureMap = function(e) {
  18503. this.materialInside.uniforms.map.value = e,
  18504. this.materialOutside.uniforms.map.value = e
  18505. }
  18506. ,
  18507. n.prototype.setMode = function(e) {
  18508. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18509. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18510. t.transparent = this.material.transparent,
  18511. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18512. this.material = t
  18513. }
  18514. ,
  18515. t.exports = n
  18516. }
  18517. , {
  18518. "../enum/Viewmode": 51,
  18519. "../materials/ModelTextureMaterial": 118,
  18520. "../shaders": 167,
  18521. three: 217
  18522. }],
  18523. 145: [function(e, t, i) {
  18524. "use strict";
  18525. function n(e) {
  18526. this.chunksize = e || 10,
  18527. this.chunks = {},
  18528. this.boundingBoxes = {},
  18529. this.children = [],
  18530. this.offset = new r.Vector3(0,.5,0),
  18531. this.material = new r.MeshBasicMaterial({
  18532. color: 16777215 * Math.random(),
  18533. side: r.DoubleSide
  18534. })
  18535. }
  18536. var r = e("three");
  18537. e("../enum/Viewmode");
  18538. n.prototype.add = function(e) {
  18539. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18540. m ? (t = m.position.array,
  18541. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18542. n = e.faces);
  18543. var v = new r.Vector3;
  18544. if (i)
  18545. for (o = 0,
  18546. a = i.length; o < a; o += 3) {
  18547. var A = 3 * i[o]
  18548. , y = 3 * i[o + 1]
  18549. , C = 3 * i[o + 2];
  18550. s = (t[A] + t[y] + t[C]) / 3,
  18551. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18552. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18553. h = Math.floor(s / this.chunksize),
  18554. u = Math.floor(l / this.chunksize),
  18555. d = Math.floor(c / this.chunksize),
  18556. p = h + "." + u + "." + d,
  18557. p in this.chunks ? (g = this.chunks[p],
  18558. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18559. f = this.boundingBoxes[p] = new r.Box3),
  18560. 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]),
  18561. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18562. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18563. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18564. }
  18565. else
  18566. for (o = 0,
  18567. a = t.length; o < a; o += 9)
  18568. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18569. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18570. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18571. h = Math.floor(s / this.chunksize),
  18572. u = Math.floor(l / this.chunksize),
  18573. d = Math.floor(c / this.chunksize),
  18574. p = h + "." + u + "." + d,
  18575. p in this.chunks ? (g = this.chunks[p],
  18576. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18577. f = this.boundingBoxes[p] = new r.Box3),
  18578. 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]),
  18579. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18580. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18581. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18582. }
  18583. ,
  18584. n.prototype.build = function() {
  18585. var e = new r.Object3D;
  18586. e.material = this.material;
  18587. for (var t in this.chunks) {
  18588. var i = this.chunks[t]
  18589. , n = new r.BufferGeometry;
  18590. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18591. n.boundingBox = this.boundingBoxes[t];
  18592. var o = new r.Mesh(n,this.material);
  18593. o.material.visible = !1,
  18594. e.add(o),
  18595. this.chunks[t] = []
  18596. }
  18597. return e
  18598. }
  18599. ,
  18600. t.exports = n
  18601. }
  18602. , {
  18603. "../enum/Viewmode": 51,
  18604. three: 217
  18605. }],
  18606. 146: [function(e, t, i) {
  18607. "use strict";
  18608. var r = e("three")
  18609. , o = e("../settings")
  18610. , a = e("../util/common")
  18611. , s = e("../util/lerp")
  18612. , l = e("./ChunkedCollider")
  18613. , c = e("../util/transitions")
  18614. , h = e("../util/easing")
  18615. , u = (e("../objects/Panorama"),
  18616. e("../enum/RenderOrder"))
  18617. , d = e("../localization/localize");
  18618. function n(e, t, i) {
  18619. r.Object3D.call(this),
  18620. this.model = e,
  18621. this.floorIndex = t,
  18622. this.lang = o.languageTag,
  18623. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18624. this.panos = [],
  18625. this.chunks = [],
  18626. this.colliderBuilder = new l(3),
  18627. this.collider = null,
  18628. this.center = null,
  18629. this.boundingBox = new r.Box3,
  18630. this.size = null,
  18631. this.hidden = !1,
  18632. this.conservativeBoundingBox = new r.Box3,
  18633. this.debugColor = 16777215 * Math.random(),
  18634. this.transition = null
  18635. }
  18636. n.prototype = Object.create(r.Object3D.prototype),
  18637. n.prototype.enter = function(e) {
  18638. this.model.setFloor(this, e)
  18639. }
  18640. ,
  18641. n.prototype.hide = function(e) {
  18642. if (!this.hidden || this.transition) {
  18643. this.chunks.forEach(function(e) {
  18644. e.material.transparent = !0
  18645. }),
  18646. c.cancel(this.transition);
  18647. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18648. , i = e ? 0 : o.hideFloorDelay / t;
  18649. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18650. this.hidden = !0
  18651. }
  18652. .bind(this), i, h.easeInOutQuad)
  18653. }
  18654. }
  18655. ,
  18656. n.prototype.show = function(e) {
  18657. if (this.hidden || this.transition) {
  18658. this.hidden = !1,
  18659. c.cancel(this.transition);
  18660. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18661. , i = e ? 0 : o.showFloorDelay / t;
  18662. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18663. this.hidden || this.chunks.forEach(function(e) {
  18664. e.material.transparent = !1
  18665. })
  18666. }
  18667. .bind(this), i, h.easeInOutQuad)
  18668. }
  18669. }
  18670. ,
  18671. n.prototype.toggle = function(e, t) {
  18672. e = void 0 === e ? this.hidden : e,
  18673. e ? this.show(t) : this.hide(t)
  18674. }
  18675. ,
  18676. n.prototype.containsPoint = function(e) {
  18677. return this.collider.children.some(function(t) {
  18678. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18679. t.geometry.boundingBox.containsPoint(e)
  18680. })
  18681. }
  18682. ,
  18683. n.prototype.distanceToPoint = function(e) {
  18684. var t = null
  18685. , i = 1 / 0;
  18686. return this.collider.children.forEach(function(n) {
  18687. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18688. var r = n.geometry.boundingBox.distanceToPoint(e);
  18689. (!t || i > r) && (i = r,
  18690. t = n)
  18691. }),
  18692. i
  18693. }
  18694. ,
  18695. n.prototype.addChunk = function(e) {
  18696. e.renderOrder = u.ghostFloor,
  18697. this.add(e),
  18698. this.chunks.push(e),
  18699. this.boundingBox.union(e.geometry.boundingBox),
  18700. this.size = this.boundingBox.size(),
  18701. this.colliderBuilder.add(e.geometry)
  18702. }
  18703. ,
  18704. n.prototype.addPano = function(e) {
  18705. this.panos.push(e),
  18706. this.add(e.skyboxMesh),
  18707. e.marker && this.add(e.marker);
  18708. var t = new r.Vector3(1,1,1)
  18709. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18710. this.boundingBox.union(i)
  18711. }
  18712. ,
  18713. n.prototype.build = function() {
  18714. this.collider = this.colliderBuilder.build(!0),
  18715. this.add(this.collider),
  18716. this.center = this.boundingBox.center(),
  18717. this.conservativeBoundingBox.copy(this.boundingBox),
  18718. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18719. return e.geometry.boundingBox.min.y
  18720. }), 5),
  18721. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18722. return e.geometry.boundingBox.max.y
  18723. }), 5),
  18724. this.colliderBuilder = null
  18725. }
  18726. ,
  18727. n.prototype.toShortString = function() {
  18728. return a.nth(this.floorIndex + 1)
  18729. }
  18730. ,
  18731. n.prototype.toString = function() {
  18732. return this.name
  18733. }
  18734. ,
  18735. t.exports = n
  18736. }
  18737. , {
  18738. "../enum/RenderOrder": 42,
  18739. "../localization/localize": 108,
  18740. "./strings-cn-CN": 109,
  18741. "../objects/Panorama": 148,
  18742. "../settings": 166,
  18743. "../util/common": 185,
  18744. "../util/easing": 186,
  18745. "../util/lerp": 188,
  18746. "../util/transitions": 195,
  18747. "./ChunkedCollider": 145,
  18748. three: 217
  18749. }],
  18750. 147: [function(e, t, i) {
  18751. "use strict";
  18752. function n(e) {
  18753. this.player = e,
  18754. this.obj3d = null,
  18755. this.UP = new r.Vector3(0,1,0)
  18756. }
  18757. var r = e("three")
  18758. , o = e("../settings");
  18759. n.prototype.prefs = {
  18760. linewidth: 3,
  18761. height: .07,
  18762. opacity: .45,
  18763. endScale: .05
  18764. },
  18765. n.prototype.discard = function() {
  18766. if (this.obj3d) {
  18767. var e = this.obj3d.parent;
  18768. e && e.remove(this.obj3d)
  18769. }
  18770. this.obj3d = null
  18771. }
  18772. ,
  18773. n.prototype.draw = function() {
  18774. if (this.discard(),
  18775. o.showNeighbors) {
  18776. var e = this.player.currentPano.floor;
  18777. this.obj3d = new r.Object3D;
  18778. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18779. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18780. i.y += this.prefs.height;
  18781. var n = .1525
  18782. , a = .127
  18783. , s = .0127
  18784. , l = .1
  18785. , c = .19
  18786. , h = .2032
  18787. , u = .2286
  18788. , d = .255
  18789. , p = new r.Matrix4;
  18790. for (var f in t)
  18791. if (t[f]) {
  18792. var g = this.player.model.panos.get(f)
  18793. , m = (g.position.clone().sub(this.player.model.position),
  18794. g.position.clone().sub(g.floorPosition))
  18795. , v = g.floorPosition.clone().sub(this.player.model.position);
  18796. v.y += this.prefs.height;
  18797. var A = new r.Geometry;
  18798. 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)),
  18799. 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)),
  18800. p.identity().setPosition(m),
  18801. A.applyMatrix(p),
  18802. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18803. 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)),
  18804. p.lookAt(v, i, this.UP).setPosition(v),
  18805. A.applyMatrix(p),
  18806. A.vertices.push(v, i);
  18807. var y = new r.Line(A,new r.LineBasicMaterial({
  18808. color: g.debugColor.getHex(),
  18809. transparent: !0,
  18810. opacity: this.prefs.opacity,
  18811. depthWrite: !1,
  18812. name: "sLine" + f,
  18813. linewidth: this.prefs.linewidth
  18814. }));
  18815. this.obj3d.add(y)
  18816. }
  18817. e.add(this.obj3d)
  18818. }
  18819. }
  18820. ,
  18821. n.prototype.update = function() {
  18822. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18823. }
  18824. ,
  18825. t.exports = n
  18826. }
  18827. , {
  18828. "../settings": 166,
  18829. three: 217
  18830. }],
  18831. 148: [function(e, t, i) {
  18832. (function(i) {
  18833. "use strict";
  18834. function n(e, t, i, n) {
  18835. this.model = e,
  18836. this.id = t,
  18837. this.alignmentType = i.alignmentType || l.ALIGNED,
  18838. this.neighbourUUIDs = i.neighbours || null,
  18839. this.neighbourPanos = null,
  18840. this.floor = null,
  18841. this.floorIndex = i.floor,
  18842. this.failedLoadingAt = 0,
  18843. this.maxLoadRetries = 4,
  18844. this.origin = i.position.clone(),
  18845. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18846. this.quaternion = i.quaternion.clone(),
  18847. this.skyboxMesh = new r.Mesh(E),
  18848. this.skyboxMesh.position.copy(this.position),
  18849. this.skyboxMesh.quaternion.copy(this.quaternion),
  18850. this.skyboxMesh.name = "skybox",
  18851. this.skyboxMesh.visible = !1,
  18852. this.skyboxMesh.updateMatrix(),
  18853. this.skyboxMesh.updateMatrixWorld(),
  18854. this.marker = null,
  18855. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  18856. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18857. map: w,
  18858. side: r.DoubleSide,
  18859. opacity: 0,
  18860. transparent: !0,
  18861. depthWrite: !1
  18862. })),
  18863. this.marker.visible = this.showFloorMarker,
  18864. this.marker.renderOrder = s.panoMarker,
  18865. this.marker.name = "marker",
  18866. this.marker.pano = this,
  18867. this.marker.layers.set(v.PANOMARKERS),
  18868. this.marker.updateMatrixWorld(),
  18869. a.colorMarkerOnLoad && this.on("load", function() {
  18870. this.marker.material.color.set(65280)
  18871. })),
  18872. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18873. this.floorPosition = i.puck ? i.puck.clone() : null,
  18874. this.tiled = n,
  18875. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18876. this.solidSkybox.flipY = !1,
  18877. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18878. this.solidSkybox.magFilter = r.LinearFilter,
  18879. this.solidSkybox.generateMipmaps = !1)),
  18880. this.zoomed = !1,
  18881. this.panoRenderer = null,
  18882. this.qualityManager = null,
  18883. this.tileDownloader = null,
  18884. this.tiledPanoRenderTarget = null,
  18885. this.minimumTiledPanoLoaded = !1,
  18886. this.highestPartialTileRenderOpCompleted = 0,
  18887. this.highestFullTileRenderOpCompleted = 0,
  18888. this.shouldRedrawOnBaseLoaded = !1,
  18889. this.lockUntilRenderingComplete = !1,
  18890. a.colorMarkerOnLoad && this.on("load", function() {
  18891. this.marker.material.color.set(65280)
  18892. });
  18893. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18894. var e = new r.TextureLoader;
  18895. e.setCrossOrigin(!0);
  18896. var g = e.load("images/texture.jpg");
  18897. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18898. color: 16777215,
  18899. transparent: !0,
  18900. opacity: .75,
  18901. map: g
  18902. })),
  18903. this.vrMarker.boluoType = "vr",
  18904. this.vrMarker.position.z = 1,
  18905. this.vrMarker.enabled = !0,
  18906. this.vrMarker.visible = !1,
  18907. window.vrMarkers = window.vrMarkers || [],
  18908. window.vrMarkers.push(this.vrMarker),
  18909. this.marker && this.marker.add(this.vrMarker),
  18910. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18911. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18912. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18913. this.adjustAngleEnable) {
  18914. var i = new r.Quaternion;
  18915. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18916. this.skyboxMesh.quaternion.multiply(i);
  18917. var m = new r.Quaternion;
  18918. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18919. this.skyboxMesh.quaternion.multiply(m);
  18920. var n = new r.Quaternion;
  18921. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18922. this.skyboxMesh.quaternion.multiply(n),
  18923. this.skyboxMesh.updateMatrix(),
  18924. this.skyboxMesh.updateMatrixWorld(),
  18925. this.model.updateProjectedPanos()
  18926. }
  18927. /**************************************************************************************************************************************/
  18928. }
  18929. var r = e("three")
  18930. , o = e("../util/logger")
  18931. , a = e("../settings")
  18932. , s = (e("../enum/Viewmode"),
  18933. e("../enum/RenderOrder"))
  18934. , l = e("../enum/AlignmentType")
  18935. , c = (e("../util/common"),
  18936. e("../util/transitions"))
  18937. , h = e("../util/lerp")
  18938. , u = e("../util/ajax")
  18939. , d = e("../util/texture")
  18940. , p = e("../util/panorama")
  18941. , f = (e("../enum/TileDownloaderEvents"),
  18942. e("../enum/PanoramaEvents"))
  18943. , g = e("../enum/PanoRendererEvents")
  18944. , m = e("../enum/PanoSizeClass")
  18945. , v = e("../enum/RenderLayers")
  18946. , A = (e("../scene/SceneRenderer"),
  18947. e("../enum/GLCubeFaces"),
  18948. e("../exception/BasicException"))
  18949. , y = e("../tile/TileUtils")
  18950. , C = e("events").EventEmitter
  18951. , I = new o(i)
  18952. , E = new r.SphereBufferGeometry(.1)
  18953. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18954. , w = d.load("images/marker-256x256.png");
  18955. n.prototype = Object.create(C.prototype),
  18956. n.prototype.enter = function() {
  18957. var e = null;
  18958. return function() {
  18959. this.setZoomed(!1),
  18960. this.emit("enter", {
  18961. oldPano: e,
  18962. newPano: this
  18963. }),
  18964. e = this
  18965. }
  18966. }(),
  18967. n.prototype.exit = function() {
  18968. this.tiled ? (this.clearWaitDeferreds(),
  18969. this.minimumTiledPanoLoaded = !1,
  18970. this.tiledPanoRenderTarget = null,
  18971. this.setZoomed(!1),
  18972. this.panoRenderer.deactivateTiledPano(this),
  18973. this.highestPartialTileRenderOpCompleted = 0,
  18974. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18975. this.solidSkybox.loaded = !1,
  18976. this.solidSkybox.version = 0),
  18977. this.emit("exit")
  18978. }
  18979. ,
  18980. n.prototype.hoverOn = function(e) {
  18981. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18982. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18983. }
  18984. ,
  18985. n.prototype.hoverOff = function(e) {
  18986. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18987. }
  18988. ,
  18989. n.prototype.build1 = function() {
  18990. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18991. this.floor.addPano(this),
  18992. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18993. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18994. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18995. }
  18996. ,
  18997. n.prototype.build2 = function() {
  18998. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18999. this.height = this.position.distanceTo(this.floorPosition),
  19000. this.placeMarker()
  19001. }
  19002. ,
  19003. n.prototype.interpolateFloorPosition = function() {
  19004. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19005. return !!e.floorPosition
  19006. }).sort(function(e, t) {
  19007. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19008. }
  19009. .bind(this))
  19010. , t = this.position.clone();
  19011. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19012. t
  19013. }
  19014. ,
  19015. n.prototype.raycastFloorPosition = function() {
  19016. I.warn("Performance warning: Raycasting to find floor position");
  19017. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19018. , t = e.intersectObjects(this.model.colliders);
  19019. return t.length ? t[0].point : null
  19020. }
  19021. ,
  19022. n.prototype.raycastToFindFloor = function() {
  19023. 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)];
  19024. return function() {
  19025. I.warn("Performance warning: Raycasting to find floor index");
  19026. for (var t = 0; t < e.length; t++) {
  19027. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19028. , n = i.intersectObjects(this.model.colliders);
  19029. if (n.length)
  19030. return n[0].object.parent.parent
  19031. }
  19032. return null
  19033. }
  19034. }(),
  19035. n.prototype.placeMarker = function() {
  19036. this.marker && (this.marker.position.copy(this.floorPosition),
  19037. this.marker.position.y += .05,
  19038. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19039. }
  19040. ,
  19041. n.prototype.translate = function(e) {
  19042. this.position.add(e),
  19043. this.floorPosition.add(e)
  19044. }
  19045. ,
  19046. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19047. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19048. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19049. }
  19050. ,
  19051. n.prototype.attachToPanoRenderer = function(e) {
  19052. this.panoRenderer = e,
  19053. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19054. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19055. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19056. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19057. }
  19058. ;
  19059. var _ = {};
  19060. n.prototype.getWaitDeferred = function(e) {
  19061. var t = _[this.id];
  19062. t || (t = {},
  19063. _[this.id] = t);
  19064. var i = t[e];
  19065. return i || (i = {
  19066. deferred: $.Deferred(),
  19067. active: !1
  19068. },
  19069. t[e] = i),
  19070. i
  19071. }
  19072. ,
  19073. n.prototype.resetWaitDeferred = function(e) {
  19074. var t = this.getWaitDeferred(e);
  19075. t.active = !1,
  19076. t.deferred = $.Deferred()
  19077. }
  19078. ,
  19079. n.prototype.clearWaitDeferreds = function() {
  19080. var e = _[this.id];
  19081. e || (e = {},
  19082. _[this.id] = e);
  19083. for (var t in e)
  19084. if (e.hasOwnProperty(t)) {
  19085. var i = e[t];
  19086. i.active = !1,
  19087. i.deferred = $.Deferred()
  19088. }
  19089. }
  19090. ,
  19091. n.prototype.loadTiledPano = function() {
  19092. var e = (new r.Vector3,
  19093. [])
  19094. , t = [];
  19095. return function(i, n, r, o, a, s) {
  19096. null !== o && void 0 !== o || (o = !0),
  19097. null !== a && void 0 !== a || (a = !0);
  19098. var l = this.getWaitDeferred(i)
  19099. , c = l.deferred
  19100. , h = null
  19101. , u = null;
  19102. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19103. u = r.vFov)),
  19104. !this.isLoaded(i)) {
  19105. if (!l.active) {
  19106. if (l.active = !0,
  19107. r) {
  19108. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19109. e[this.id + ":" + i] = {
  19110. tileCount: 0,
  19111. targetTileCount: d
  19112. },
  19113. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19114. }
  19115. t[this.id] || (t[this.id] = !0,
  19116. this.on(f.LoadComplete, function(e, t) {
  19117. var i = this.getWaitDeferred(e).deferred;
  19118. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19119. this.resetWaitDeferred(e))
  19120. }
  19121. .bind(this)),
  19122. this.on(f.LoadFailed, function(e) {
  19123. var t = this.getWaitDeferred(e).deferred;
  19124. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19125. this.resetWaitDeferred(e))
  19126. }
  19127. .bind(this)),
  19128. this.on(f.TileLoaded, function(t, i, n) {
  19129. var r = this.getWaitDeferred(t).deferred;
  19130. if (r && "pending" === r.state()) {
  19131. r.notify(t, i, n);
  19132. var o = e[this.id + ":" + t];
  19133. o && (o.tileCount++,
  19134. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19135. r.resolve(t, n),
  19136. this.resetWaitDeferred(t)))
  19137. }
  19138. }
  19139. .bind(this)))
  19140. }
  19141. this.tileDownloader.clearForceQueue(),
  19142. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19143. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  19144. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19145. }
  19146. return c.promise()
  19147. }
  19148. }(),
  19149. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19150. if (e === this.id) {
  19151. var n = this.qualityManager.getPanoSize(m.BASE);
  19152. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19153. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19154. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19155. }
  19156. }
  19157. ,
  19158. n.prototype.onTileRendered = function(e, t, i, n) {
  19159. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19160. }
  19161. ,
  19162. n.prototype.onPanoRendered = function(e, t, i, n) {
  19163. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19164. this.updateSkyboxForZoomLevel(),
  19165. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19166. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19167. this.emit("load", t),
  19168. this.model.emit("load", this),
  19169. this.emit(f.LoadComplete, t, i))
  19170. }
  19171. ,
  19172. n.prototype.setZoomed = function(e) {
  19173. this.zoomed = e,
  19174. this.updateSkyboxForZoomLevel()
  19175. }
  19176. ,
  19177. n.prototype.ensureSkyboxReadyForRender = function() {
  19178. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19179. this.solidSkybox.loaded = !0)
  19180. }
  19181. ,
  19182. n.prototype.updateSkyboxForZoomLevel = function() {
  19183. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19184. }
  19185. ,
  19186. n.prototype.getSkyboxTexture = function() {
  19187. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19188. }
  19189. ,
  19190. n.prototype.onTileRenderFail = function(e, t, i) {
  19191. e === this.id && this.emit(f.LoadFailed, t)
  19192. }
  19193. ,
  19194. n.prototype.isLoaded = function(e) {
  19195. if (this.tiled) {
  19196. if (e && "string" == typeof e)
  19197. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19198. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19199. }
  19200. if (e && "number" == typeof e)
  19201. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19202. return !!this.solidSkybox.high || e in this.solidSkybox
  19203. }
  19204. ,
  19205. n.prototype.loadCube = function(e) {
  19206. if (this.isLoaded(e))
  19207. return I.info("Skipping load of pano, already loaded"),
  19208. $.when();
  19209. this.emit("loading", e),
  19210. this.model.emit("loading", this);
  19211. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19212. , i = t.filter(function(e) {
  19213. return !e
  19214. });
  19215. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19216. e = "high",
  19217. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19218. var n = 0
  19219. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19220. return u.getImage(t[i])
  19221. }
  19222. .bind(this));
  19223. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19224. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19225. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19226. this.solidSkybox.low = null),
  19227. this.solidSkybox.needsUpdate = !0,
  19228. this.emit("load", e),
  19229. this.model.emit("load", this),
  19230. this
  19231. }
  19232. .bind(this), function() {
  19233. I.error("Downloading cubemap for pano", this.id, "failed"),
  19234. this.failedLoadingAt = Date.now()
  19235. }
  19236. .bind(this), function() {
  19237. return $.when(++n, 6)
  19238. })
  19239. }
  19240. ,
  19241. n.raycastsSkipped = 0,
  19242. n.raycastsDone = 0,
  19243. n.prototype.findNeighourPanos = function() {
  19244. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19245. this.model.panos.forEach(function(e) {
  19246. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19247. var t = this.position.distanceTo(e.position);
  19248. if (t > a.panoramaNeighbourMaxDistance)
  19249. return this.model.panos.setNeighbour(this, e, !1),
  19250. void n.raycastsSkipped++;
  19251. var i = e.position.clone().sub(this.position).normalize()
  19252. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19253. , s = o.intersectObjects(this.model.colliders);
  19254. n.raycastsDone++,
  19255. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19256. 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)))
  19257. }
  19258. }
  19259. .bind(this)),
  19260. this.model.panos.neighbourMap[this.id]
  19261. }
  19262. ,
  19263. n.prototype.worldPosition = function() {
  19264. return this.position
  19265. }
  19266. ,
  19267. n.prototype.addTextSprite = function(e, t) {
  19268. this.removeTextSprite();
  19269. var i = document.createElement("canvas")
  19270. , n = i.getContext("2d");
  19271. i.width = 256,
  19272. i.height = 256;
  19273. var o = "Arial"
  19274. , a = 60;
  19275. n.font = "bold " + a + "px " + o,
  19276. n.fillStyle = "white";
  19277. var s = n.measureText(e).width;
  19278. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19279. var l = new r.Texture(i);
  19280. l.needsUpdate = !0;
  19281. var c = new r.SpriteMaterial({
  19282. map: l,
  19283. color: t || 16428055
  19284. });
  19285. this.text3d = new r.Sprite(c),
  19286. this.text3d.position.copy(this.skyboxMesh.position),
  19287. this.floor.add(this.text3d)
  19288. }
  19289. ,
  19290. n.prototype.removeTextSprite = function() {
  19291. this.text3d && (this.floor.remove(this.text3d),
  19292. this.text3d = null)
  19293. }
  19294. ,
  19295. n.prototype.isAligned = function() {
  19296. return this.alignmentType === l.ALIGNED
  19297. }
  19298. ,
  19299. n.filters = {
  19300. inDirection: function(e, t, i) {
  19301. return function(n) {
  19302. var r = n.position.clone().sub(e).normalize();
  19303. return r.dot(t) > i
  19304. }
  19305. },
  19306. inFloorDirection: function(e, t, i) {
  19307. return function(n) {
  19308. var r = n.floorPosition.clone().sub(e).normalize();
  19309. return r.dot(t) > i
  19310. }
  19311. },
  19312. inPanoDirection: function(e, t, i) {
  19313. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19314. function(n) {
  19315. var r = n.floorPosition.clone().sub(e).normalize()
  19316. , o = n.position.clone().sub(e).normalize();
  19317. return r.dot(t) > i || o.dot(t) > i
  19318. }
  19319. },
  19320. atFloor: function(e) {
  19321. return function(t) {
  19322. return !e || t.floor === e
  19323. }
  19324. },
  19325. not: function(e) {
  19326. return function(t) {
  19327. return t !== e
  19328. }
  19329. },
  19330. notIn: function(e) {
  19331. return function(t) {
  19332. return e.indexOf(t) === -1
  19333. }
  19334. },
  19335. isLoaded: function() {
  19336. return function(e) {
  19337. return e.isLoaded()
  19338. }
  19339. },
  19340. isNotLoaded: function() {
  19341. return function(e) {
  19342. return !e.isLoaded()
  19343. }
  19344. },
  19345. isCloseEnoughTo: function(e, t) {
  19346. return function(i) {
  19347. return e.distanceTo(i.floorPosition) < t
  19348. }
  19349. },
  19350. hasMinimumHeightDifferenceTo: function(e, t) {
  19351. return function(i) {
  19352. return Math.abs(i.position.y - e.y) > t
  19353. }
  19354. },
  19355. isNotBehindNormal: function(e, t) {
  19356. var i = new r.Vector3;
  19357. return t = t.clone(),
  19358. function(n) {
  19359. var r = i.copy(n.position).sub(e).normalize();
  19360. return r.dot(t) > 0
  19361. }
  19362. },
  19363. isNeighbourPanoTo: function(e) {
  19364. return function(t) {
  19365. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19366. }
  19367. },
  19368. isNeighbourOfNeighbourTo: function(e) {
  19369. return function(t) {
  19370. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19371. var n = e.model.panos.get(i);
  19372. return !!n && n.neighbourPanos[t.id]
  19373. })
  19374. }
  19375. },
  19376. isNotRecentlyFailed: function(e) {
  19377. return function(t) {
  19378. return Date.now() - t.failedLoadingAt > e
  19379. }
  19380. },
  19381. isOnVisibleFloor: function() {
  19382. return function(e) {
  19383. return !e.floor.hidden
  19384. }
  19385. },
  19386. isPanoAligned: function() {
  19387. return function(e) {
  19388. return e.isAligned()
  19389. }
  19390. }
  19391. },
  19392. n.sortFunctions = {
  19393. distanceToPoint: function(e) {
  19394. return function(t, i) {
  19395. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19396. }
  19397. },
  19398. floorDistanceToPoint: function(e) {
  19399. return function(t, i) {
  19400. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19401. }
  19402. },
  19403. choose: function(e) {
  19404. return function(t, i) {
  19405. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19406. }
  19407. }
  19408. },
  19409. n.scoreFunctions = {
  19410. distance: function(e, t) {
  19411. return t = t || a.navigation.distanceFactor,
  19412. function(i) {
  19413. return e ? e.position.distanceTo(i.position) * t : 0
  19414. }
  19415. },
  19416. distanceSquared: function(e, t) {
  19417. return t = t || a.navigation.distanceFactor,
  19418. function(i) {
  19419. return e ? e.position.distanceToSquared(i.position) * t : 0
  19420. }
  19421. },
  19422. direction: function(e, t) {
  19423. return function(i) {
  19424. var n = i.position.clone().sub(e).normalize();
  19425. return n.dot(t) * a.navigation.directionFactor
  19426. }
  19427. },
  19428. angle: function(e, t) {
  19429. return function(i) {
  19430. var n = i.position.clone().sub(e).normalize();
  19431. return n.angleTo(t) * a.navigation.angleFactor
  19432. }
  19433. },
  19434. inFieldOfView: function(e, t) {
  19435. return function(i) {
  19436. var n = i.position.clone().sub(e).normalize();
  19437. return n.dot(t) > .75 ? 10 : -1
  19438. }
  19439. },
  19440. optionality: function(e) {
  19441. return function(t) {
  19442. var i = t.neighbourUUIDs.filter(function(t) {
  19443. return !(t in e.neighbourUUIDs) && t !== e.id
  19444. });
  19445. return i.length * a.navigation.optionalityFactor
  19446. }
  19447. },
  19448. penalizeHeightDifferenceUnder: function(e, t) {
  19449. return function(i) {
  19450. return e.y - i.position.y < t ? -20 : 0
  19451. }
  19452. }
  19453. },
  19454. t.exports = n
  19455. }
  19456. ).call(this, "/js/objects/Panorama.js")
  19457. }
  19458. , {
  19459. "../enum/AlignmentType": 17,
  19460. "../enum/GLCubeFaces": 25,
  19461. "../enum/PanoRendererEvents": 35,
  19462. "../enum/PanoSizeClass": 36,
  19463. "../enum/PanoramaEvents": 37,
  19464. "../enum/RenderLayers": 41,
  19465. "../enum/RenderOrder": 42,
  19466. "../enum/TileDownloaderEvents": 45,
  19467. "../enum/Viewmode": 51,
  19468. "../exception/BasicException": 55,
  19469. "../scene/SceneRenderer": 158,
  19470. "../settings": 166,
  19471. "../tile/TileUtils": 174,
  19472. "../util/ajax": 181,
  19473. "../util/common": 185,
  19474. "../util/lerp": 188,
  19475. "../util/logger": 189,
  19476. "../util/panorama": 191,
  19477. "../util/texture": 194,
  19478. "../util/transitions": 195,
  19479. events: 202,
  19480. three: 217
  19481. }],
  19482. 149: [function(e, t, i) {
  19483. "use strict";
  19484. function n(e) {
  19485. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19486. t.map.value = d,
  19487. t.opacity.value = 0,
  19488. t.color.value.set(o.reticuleColor),
  19489. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19490. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19491. side: r.DoubleSide,
  19492. depthWrite: !1,
  19493. depthTest: !1,
  19494. transparent: !0,
  19495. vertexShader: c.waypoint.vertexShader,
  19496. fragmentShader: c.waypoint.fragmentShader,
  19497. uniforms: t,
  19498. name: "waypoint",
  19499. opacity: 0,
  19500. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19501. })),
  19502. this.layers.set(h.RETICULE),
  19503. this.renderOrder = u.reticule,
  19504. this.player = e,
  19505. this.direction = new r.Vector3,
  19506. this.hidden = !0,
  19507. this.mouseLastMoveTime = Date.now()
  19508. }
  19509. var r = e("three")
  19510. , o = e("../settings")
  19511. , a = e("../util/transitions")
  19512. , s = e("../util/texture")
  19513. , l = e("../util/lerp")
  19514. , c = e("../shaders")
  19515. , h = e("../enum/RenderLayers")
  19516. , u = e("../enum/RenderOrder")
  19517. , d = s.load("images/reticule-256x256.png");
  19518. n.prototype = Object.create(r.Mesh.prototype),
  19519. n.prototype.move = function(e, t, i) {
  19520. this.hidden = i,
  19521. this.mouseLastMoveTime = Date.now()
  19522. }
  19523. ,
  19524. n.prototype.hide = function() {
  19525. this.hidden || (this.hidden = !0,
  19526. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19527. }
  19528. ,
  19529. n.prototype.show = function() {
  19530. this.hidden = !1,
  19531. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19532. }
  19533. ,
  19534. n.prototype.update = function() {
  19535. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19536. }
  19537. ,
  19538. n.prototype.updatePosition = function(e, t) {
  19539. if (!this.hidden) {
  19540. if (!t)
  19541. return this.hide();
  19542. var i = t.point
  19543. , n = e.distanceTo(i)
  19544. , r = 1 + .01 * n;
  19545. n < 1 && (r -= 1 - n),
  19546. this.show(),
  19547. this.scale.set(r, r, r),
  19548. this.direction = this.direction.multiplyScalar(.8),
  19549. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19550. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19551. this.lookAt(this.position.clone().add(this.direction))
  19552. }
  19553. }
  19554. ,
  19555. n.prototype.writeAstag = function() {
  19556. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19557. , t = new Date;
  19558. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19559. var i = {
  19560. enabled: !0,
  19561. version: "0",
  19562. created: t.toISOString(),
  19563. created_by: "APITest",
  19564. position: this.position.clone(),
  19565. stem: {
  19566. enabled: o.tags.pole.enabled,
  19567. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19568. },
  19569. label: "tag " + this.tagCount,
  19570. description: "Description " + e,
  19571. floor: function(e) {
  19572. if (e.currentFloor) {
  19573. var t = e.floors.indexOf(e.currentFloor);
  19574. return t > -1 ? t : void 0
  19575. }
  19576. }(this.player.model),
  19577. type: "info",
  19578. metadata: {
  19579. preferred_camera: {
  19580. mode: this.player.mode
  19581. }
  19582. }
  19583. };
  19584. console.log("--------------------------"),
  19585. console.log(JSON.stringify(i));
  19586. var n = this.player.model.addtag(e, i).build();
  19587. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19588. n.visible || n.show(o.tags.startup.fadeInDuration))
  19589. }
  19590. ,
  19591. t.exports = n
  19592. }
  19593. , {
  19594. "../enum/RenderLayers": 41,
  19595. "../enum/RenderOrder": 42,
  19596. "../settings": 166,
  19597. "../shaders": 167,
  19598. "../util/lerp": 188,
  19599. "../util/texture": 194,
  19600. "../util/transitions": 195,
  19601. three: 217
  19602. }],
  19603. 150: [function(e, t, i) {
  19604. "use strict";
  19605. function n(e, t) {
  19606. this.chunks = [],
  19607. this.floorId = e,
  19608. this.roomId = t,
  19609. this.position = new r.Vector3
  19610. }
  19611. var r = e("three");
  19612. n.prototype.addChunk = function(e) {
  19613. this.chunks.push(e)
  19614. }
  19615. ,
  19616. n.prototype.calcBoundaries = function() {
  19617. 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++) {
  19618. var s = this.chunks[a]
  19619. , l = s.geometry.attributes.position;
  19620. if (l)
  19621. for (var c = 0; c < l.array.length; c += 3)
  19622. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19623. t.add(e),
  19624. 0 === c ? (i.copy(e),
  19625. n.copy(e)) : (i.max(e),
  19626. n.min(e)),
  19627. o++
  19628. }
  19629. o > 0 ? (t.multiplyScalar(1 / o),
  19630. this.average = t) : this.average = null,
  19631. this.boundsMax = i,
  19632. this.boundsMin = n,
  19633. this.center = new r.Vector3,
  19634. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19635. }
  19636. ,
  19637. t.exports = n
  19638. }
  19639. , {
  19640. three: 217
  19641. }],
  19642. 151: [function(e, t, i) {
  19643. (function(i) {
  19644. "use strict";
  19645. function n(e, t, i) {
  19646. this.obj3d = null,
  19647. this.nodes = [],
  19648. this.colorHull = [],
  19649. this.shortPaths = {},
  19650. this.floorHull = null,
  19651. this.cameraHull = null,
  19652. this.floorPathDistance = 0,
  19653. this.floorCurvePoints = null,
  19654. this.floorCurveColors = null,
  19655. this.camCurvePoints = null,
  19656. this.warpDestHeroLoc = null,
  19657. this.warpDestPano = null,
  19658. this.warpPathPoints = null,
  19659. this.warpPathLengths = [0],
  19660. this.warpLength = 0,
  19661. this.closeWarpDistance = 4,
  19662. this.UP = A.UP.clone(),
  19663. this.longestStep = 0,
  19664. this.upcomingTransType = null,
  19665. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19666. this.prevNextDist = 0,
  19667. this.nextI = 0,
  19668. this.activeTransType = null,
  19669. this.lastTransType = null,
  19670. this.bunnyObj = null,
  19671. this.director = e,
  19672. this.player = t,
  19673. this.playerControls = i,
  19674. this.modelManager = t.modelManager,
  19675. this.updateModel(),
  19676. this.updateDefaultsFromModelData(),
  19677. this.bindEvents(),
  19678. this.warping = !1,
  19679. this.waitingToWarp = !1,
  19680. this.warpInterrupted = !1,
  19681. this.warpInterruptionBlackoutStyle = null,
  19682. this.warpInterruptionTravelTime = null
  19683. }
  19684. var r = e("three")
  19685. , o = e("../util/logger")
  19686. , a = e("../enum/Viewmode")
  19687. , s = e("../enum/RenderOrder")
  19688. , l = e("../enum/WarpStyle")
  19689. , c = e("../settings")
  19690. , h = e("../util/math")
  19691. , u = e("../util/lerp")
  19692. , d = e("../util/easing")
  19693. , p = e("../util/transitions")
  19694. , f = e("../objects/Snapshot")
  19695. , g = e("../effects")
  19696. , m = e("../shaders")
  19697. , v = (e("../gui/gui"),
  19698. e("../util/texture"))
  19699. , A = e("../enum/Vectors")
  19700. , y = (e("../model/ModelManager"),
  19701. new o(i))
  19702. , C = e("../enum/PlayerEvents")
  19703. , I = e("../enum/BlackoutStyle")
  19704. , E = e("../enum/ModelManagerEvents")
  19705. , b = e("../constants")
  19706. , w = {
  19707. 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"),
  19708. pathEnd: v.load("images/End.png"),
  19709. 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==")
  19710. };
  19711. n.prototype.setScene = function(e) {
  19712. this.createCpm(e),
  19713. this.createBunnyObj(e)
  19714. }
  19715. ,
  19716. n.prototype.updateModel = function() {
  19717. this.model = this.modelManager.getActiveModel()
  19718. }
  19719. ,
  19720. n.prototype.bindEvents = function() {
  19721. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19722. }
  19723. ,
  19724. n.prototype.updateDefaultsFromModelData = function() {
  19725. this.model.data
  19726. }
  19727. ,
  19728. n.prototype.pointPathDistance = function(e) {
  19729. for (var t = 0, i = 1; i < e.length; i += 1)
  19730. t += e[i - 1].distanceTo(e[i]);
  19731. return t
  19732. }
  19733. ,
  19734. n.prototype.pointPathLengths = function(e) {
  19735. for (var t = [0], i = 1; i < e.length; i += 1)
  19736. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19737. return t
  19738. }
  19739. ,
  19740. n.prototype.interpAlongPath = function(e, t, i) {
  19741. var n, o = new r.Vector3, a = t[t.length - 1];
  19742. if (i < 1) {
  19743. n = i * a;
  19744. for (var s = 1; s < t.length; s += 1)
  19745. if (t[s] > n) {
  19746. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19747. return o.copy(e[s]),
  19748. o.sub(e[s - 1]),
  19749. o.multiplyScalar(l),
  19750. o.add(e[s - 1]),
  19751. o
  19752. }
  19753. } else
  19754. o.copy(e[e.length - 1]);
  19755. return o
  19756. }
  19757. ,
  19758. n.prototype.pathHeight = function() {
  19759. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19760. }
  19761. ,
  19762. n.prototype.createBunnyObj = function(e) {
  19763. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19764. this.bunnyObj.visible = c.warp.showBunny),
  19765. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19766. e.add(this.bunnyObj)
  19767. }
  19768. ,
  19769. n.prototype.createCpm = function(e) {
  19770. if (!this.currentPanoMarker) {
  19771. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19772. t.material.uniforms.opacity.value = 0,
  19773. this.currentPanoMarker = {
  19774. mesh: t,
  19775. placed: !1
  19776. }
  19777. }
  19778. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19779. this.placeCpm(),
  19780. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19781. }
  19782. ,
  19783. n.prototype.placeCpm = function() {
  19784. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19785. var e = this.player.currentPano.floor;
  19786. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19787. e.add(this.currentPanoMarker.mesh)),
  19788. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19789. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19790. this.currentPanoMarker.placed = !0
  19791. } else
  19792. this.popOutCpm()
  19793. }
  19794. ,
  19795. n.prototype.fadeInCpm = function(e) {
  19796. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  19797. }
  19798. ,
  19799. n.prototype.fadeOutCpm = function(e) {
  19800. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19801. }
  19802. ,
  19803. n.prototype.popInCpm = function() {
  19804. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19805. }
  19806. ,
  19807. n.prototype.popOutCpm = function() {
  19808. this.fadeOutCpm(2)
  19809. }
  19810. ,
  19811. n.prototype.brushPrefs = {
  19812. linewidth: 7,
  19813. strokeWidth: 15,
  19814. cvSegments: 48,
  19815. paveStep: .1,
  19816. paveWidth: .2,
  19817. lookBlendDist: 3,
  19818. maxTurn: r.Math.degToRad(2)
  19819. },
  19820. n.prototype.panoPathDistance = function(e) {
  19821. var t = this.model.panos;
  19822. if (!e || e.length < 2)
  19823. return 0;
  19824. for (var i = [], n = 0; n < e.length; n += 1)
  19825. i.push(t.get(e[n]).floorPosition);
  19826. return this.pointPathDistance(i)
  19827. }
  19828. ,
  19829. n.prototype.loadTileTexture = function(e) {
  19830. var t = v.load(e, function(t) {
  19831. t.wrapS = r.RepeatWrapping,
  19832. t.wrapT = r.RepeatWrapping,
  19833. t.needsUpdate = !0,
  19834. y.debug('path texture "' + e + '" is ready')
  19835. }, function() {
  19836. y.error('path texture "' + e + '" failed')
  19837. });
  19838. return t.mapping = r.UVMapping,
  19839. t
  19840. }
  19841. ,
  19842. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19843. var a = {
  19844. cameraMode: n,
  19845. position: e,
  19846. quaternion: t,
  19847. panoId: i,
  19848. orthoZoom: o,
  19849. floorVisibility: r,
  19850. thumbUrl: null,
  19851. name: null
  19852. };
  19853. return new f(a)
  19854. }
  19855. ,
  19856. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19857. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19858. }
  19859. ,
  19860. n.prototype.setWarpDestination = function(e) {
  19861. this.warpDestHeroLoc = e
  19862. }
  19863. ,
  19864. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19865. var t = this.getHeroDescriptorByHeroIndex(e);
  19866. return null !== t && (this.setWarpDestination(t),
  19867. !0)
  19868. }
  19869. ,
  19870. n.prototype.setWarpDestinationByPano = function(e, t) {
  19871. var i = this.model.panos.get(e.id);
  19872. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19873. }
  19874. ,
  19875. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19876. var i = this.model.panos.get(e);
  19877. if (i) {
  19878. t = t || new r.Quaternion;
  19879. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19880. return this.setWarpDestination(n),
  19881. !0
  19882. }
  19883. return !1
  19884. }
  19885. ,
  19886. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19887. var t = this.model.heroCount();
  19888. /* if (null !== this.warpDestHeroLoc && t < 2)
  19889. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19890. this.model.getHeroDescriptorByIndex(0); */
  19891. var i = this.model.getHeroDescriptorByIndex(e);
  19892. if (i) {
  19893. var n = i.isPano() ? i.panoId : i.cameraMode;
  19894. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19895. }
  19896. return i
  19897. }
  19898. ,
  19899. n.prototype.getHeroDescriptorByPano = function(e) {
  19900. var t = this.model.panos.get(e.id);
  19901. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19902. }
  19903. ,
  19904. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19905. var t = this.getHeroIndexFromPanoId(e);
  19906. return this.getHeroDescriptorByHeroIndex(t)
  19907. }
  19908. ,
  19909. n.prototype.getHeroIndexFromPanoId = function(e) {
  19910. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19911. var i = this.model.heroLocations[t]
  19912. , n = this.getHeroId(i);
  19913. if (n && n === e)
  19914. return t
  19915. }
  19916. return -1
  19917. }
  19918. ,
  19919. n.prototype.getHeroPano = function(e) {
  19920. if (null === e)
  19921. return y.warn("getHeroPano(): no destination"),
  19922. null;
  19923. var t = this.getHeroId(e)
  19924. , i = this.model.panos.get(t);
  19925. return void 0 === i && (i = null,
  19926. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19927. i
  19928. }
  19929. ,
  19930. n.prototype.getHeroId = function(e) {
  19931. return e.panoId
  19932. }
  19933. ,
  19934. n.prototype.setWarpDestPano = function() {
  19935. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19936. this.warpDestPano
  19937. }
  19938. ,
  19939. n.prototype.brushToWarpPano = function(e, t) {
  19940. if (this.discardPathObject(),
  19941. !this.setWarpDestPano())
  19942. return !1;
  19943. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19944. !this.warpDestPano)
  19945. return y.info("No brush"),
  19946. !1;
  19947. if (!this.player.currentPano)
  19948. return y.debug("No current pano, visibility undefined"),
  19949. !1;
  19950. if (!this.warpDestPano)
  19951. return y.info("No wPano, visibility undefined"),
  19952. !1;
  19953. if (!this.warpDestPano.isAligned())
  19954. return y.debug("Cannot brush to unaligned pano"),
  19955. !1;
  19956. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19957. , n = !0;
  19958. if (this.player.currentPano.id === this.warpDestPano.id)
  19959. y.debug("Already at destination pano");
  19960. else {
  19961. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19962. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19963. this.obj3d = new r.Object3D,
  19964. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19965. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19966. e = t) : (this.setPathHulls(this.nodes),
  19967. this.setFloorCurves(),
  19968. 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)))),
  19969. this.player.currentPano.floor.add(this.obj3d);
  19970. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19971. , s = e === l.STD;
  19972. if (!n && (i || s)) {
  19973. if (o) {
  19974. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19975. this.obj3d.add(h)
  19976. }
  19977. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19978. this.obj3d.add(u)
  19979. }
  19980. this.appearSlow()
  19981. }
  19982. return this.upcomingTransType = e,
  19983. !n
  19984. }
  19985. ,
  19986. n.prototype.findShortestPath = function(e, t) {
  19987. if (!e || !t)
  19988. return null;
  19989. var i = c.warp.walkExtraPanosDistance
  19990. , n = e.id + ":" + t.id + ":" + i;
  19991. if (this.shortPaths.hasOwnProperty(n))
  19992. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19993. var r = t.id + ":" + e.id + ":" + i;
  19994. if (this.shortPaths.hasOwnProperty(r))
  19995. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19996. var o = this.model.panos.aStarSearch(e, t);
  19997. return this.model.panos.includeNodesNearPath(o, i),
  19998. this.shortPaths[n] = o ? o.slice() : null,
  19999. o
  20000. }
  20001. ,
  20002. n.prototype.makePathHulls = function(e) {
  20003. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20004. t = u.get(e[0]),
  20005. r = t.floor.floorIndex;
  20006. for (var d = 0; d < e.length; d += 1)
  20007. t = u.get(e[d]),
  20008. i = t.floorPosition.clone().sub(this.model.position),
  20009. i.y += this.pathHeight(),
  20010. s.push(i),
  20011. l.push(t.position.clone()),
  20012. n = t.floor.floorIndex,
  20013. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20014. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20015. o > a && (a = o));
  20016. return a > this.longestStep && (this.longestStep = a,
  20017. y.debug("path contains " + a + " meter segment")),
  20018. {
  20019. floor: s,
  20020. camera: l,
  20021. color: h
  20022. }
  20023. }
  20024. ,
  20025. n.prototype.makeFloorCurves = function(e, t, i) {
  20026. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20027. , o = this.pointPathDistance(e) - 2 * n
  20028. , s = e.slice(0)
  20029. , l = s[1].clone().sub(s[0]);
  20030. l.y = 0,
  20031. l.normalize().multiplyScalar(n),
  20032. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20033. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20034. l.y = 0,
  20035. l.normalize().multiplyScalar(n),
  20036. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20037. var h = new r.CatmullRomCurve3(s)
  20038. , u = Math.floor(o / i);
  20039. u = 4 * Math.floor(u / 4),
  20040. u = Math.max(4, u);
  20041. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20042. f = 0,
  20043. d = g[A].distanceTo(e[0]);
  20044. for (var y = 1; y < e.length; y += 1)
  20045. v.copy(g[A]).sub(e[y]),
  20046. v.y *= 4,
  20047. p = v.length(),
  20048. p < d && (f = y);
  20049. m.push(t[f])
  20050. }
  20051. return {
  20052. distance: o,
  20053. points: g,
  20054. colors: m
  20055. }
  20056. }
  20057. ,
  20058. n.prototype.makeCameraCurvePoints = function(e, t) {
  20059. var i = this.pointPathDistance(e)
  20060. , n = new r.CatmullRomCurve3(e);
  20061. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20062. }
  20063. ,
  20064. n.prototype.makeCameraCurveTangents = function(e, t) {
  20065. var i = this.pointPathDistance(e)
  20066. , n = new r.CatmullRomCurve3(e)
  20067. , o = Math.max(2, Math.floor(i / t));
  20068. o || (o = 5);
  20069. for (var a = [], s = 0; s <= o; s++)
  20070. a.push(n.getTangentAt(s / o));
  20071. return a
  20072. }
  20073. ,
  20074. n.prototype.setPathHulls = function(e) {
  20075. var t = this.makePathHulls(e);
  20076. this.floorHull = t.floor,
  20077. this.cameraHull = t.camera,
  20078. this.colorHull = t.color
  20079. }
  20080. ,
  20081. n.prototype.setFloorCurves = function() {
  20082. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20083. this.floorPathDistance = e.distance,
  20084. this.floorCurvePoints = e.points,
  20085. this.floorCurveColors = e.colors
  20086. }
  20087. ,
  20088. n.prototype.setCameraCurvePoints = function() {
  20089. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20090. }
  20091. ,
  20092. n.prototype.chooseWarpPath = function(e) {
  20093. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20094. if (this.player.currentPano === this.warpDestPano || !e)
  20095. return this.warpPathPoints = null,
  20096. this.warpLength = 0,
  20097. !1;
  20098. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20099. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20100. t = this.warpDestPano.position.clone().sub(o.position),
  20101. i = t.clone().negate(),
  20102. t.multiplyScalar(.15).add(o.position),
  20103. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20104. t.y = o.position.y,
  20105. i.y = this.warpDestPano.position.y,
  20106. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20107. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20108. this.setCameraCurvePoints(),
  20109. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20110. this.warpLength = 0,
  20111. this.warpPathLengths = [0];
  20112. 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) {
  20113. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20114. var p = s.length();
  20115. s.y *= c.warp.climbEffort;
  20116. var f = s.length() / p;
  20117. if (d > 1) {
  20118. s.setY(0).normalize(),
  20119. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20120. var g = Math.min(1, s.dot(l))
  20121. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20122. f = Math.max(m, f)
  20123. }
  20124. this.warpLength += p * f,
  20125. this.warpPathLengths[d] = this.warpLength
  20126. }
  20127. return !0
  20128. }
  20129. ,
  20130. n.prototype.drawPathRibbon = function(e, t) {
  20131. this.bunnyObj.visible = c.warp.showBunny;
  20132. 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) {
  20133. h.copy(e[u]),
  20134. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20135. h.normalize(),
  20136. n.crossVectors(h, A.UP),
  20137. n.multiplyScalar(i);
  20138. var d = (new r.Vector3).copy(e[u]).add(o);
  20139. d.sub(n),
  20140. l.vertices.push(d),
  20141. d = (new r.Vector3).copy(e[u]).add(o),
  20142. d.add(n),
  20143. l.vertices.push(d)
  20144. }
  20145. var p, f = 0;
  20146. for (u = 0; u < e.length - 1; u += 1) {
  20147. var g = 2 * u
  20148. , v = f;
  20149. f += e[u + 1].distanceTo(e[u]);
  20150. var y = f
  20151. , C = t[u]
  20152. , I = t[u + 1];
  20153. p = new r.Face3(g,g + 1,g + 2),
  20154. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20155. l.faces.push(p),
  20156. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20157. p = new r.Face3(g + 2,g + 1,g + 3),
  20158. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20159. l.faces.push(p),
  20160. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20161. }
  20162. l.computeFaceNormals(),
  20163. l.computeVertexNormals();
  20164. var E, b;
  20165. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20166. b.map.value = w.path,
  20167. b.opacity.value = 0,
  20168. b.color.value.set(c.path.color),
  20169. E = new r.RawShaderMaterial({
  20170. side: r.DoubleSide,
  20171. depthWrite: !1,
  20172. transparent: !0,
  20173. vertexShader: m.ribbon.vertexShader,
  20174. fragmentShader: m.ribbon.fragmentShader,
  20175. uniforms: b,
  20176. name: "ribbonT",
  20177. opacity: 0
  20178. })) : E = new r.MeshBasicMaterial({
  20179. color: 16777215,
  20180. side: r.DoubleSide,
  20181. name: "ribbonOut",
  20182. vertexColors: r.VertexColors
  20183. });
  20184. var _ = new r.Mesh(l,E);
  20185. return _.name = "ribbon",
  20186. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20187. _
  20188. }
  20189. ,
  20190. n.prototype.drawPathPavement = function(e) {
  20191. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20192. s.copy(e[l]),
  20193. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20194. s.normalize(),
  20195. n.crossVectors(s, A.UP),
  20196. n.multiplyScalar(this.brushPrefs.paveWidth),
  20197. t = (new r.Vector3).copy(e[l]),
  20198. t.sub(n),
  20199. o.vertices.push(t),
  20200. o.vertices.push((new r.Vector3).copy(e[l])),
  20201. t = (new r.Vector3).copy(e[l]),
  20202. t.add(n),
  20203. o.vertices.push(t);
  20204. var h, u, d;
  20205. for (l = 0; l < e.length - 1; l += 1)
  20206. h = 3 * l + 1,
  20207. u = l * i,
  20208. d = u + i,
  20209. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20210. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20211. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20212. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20213. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20214. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20215. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20216. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20217. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20218. color: c.path.color,
  20219. side: r.DoubleSide,
  20220. transparent: !0,
  20221. depthWrite: !1,
  20222. opacity: 0,
  20223. name: "paveT",
  20224. map: w.path
  20225. }) : new r.MeshBasicMaterial({
  20226. color: c.path.color,
  20227. side: r.DoubleSide,
  20228. transparent: !0,
  20229. depthWrite: !1,
  20230. opacity: 1,
  20231. name: "paveO",
  20232. map: w.path
  20233. });
  20234. return new r.Mesh(o,p)
  20235. }
  20236. ,
  20237. n.prototype.hintPrefs = {
  20238. rad: .18,
  20239. width: .0125,
  20240. depth: .0625,
  20241. setBack: -.04,
  20242. markRad: .25,
  20243. markInnerRad: .16
  20244. },
  20245. n.prototype.makeWaypointObj = function(e, t) {
  20246. var i = new r.Geometry
  20247. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20248. , o = this.pathHeight();
  20249. 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)),
  20250. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20251. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20252. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20253. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20254. s.map.value = e,
  20255. s.opacity.value = 0,
  20256. s.color.value.set(c.path.color);
  20257. var l = {
  20258. side: r.DoubleSide,
  20259. depthWrite: !1,
  20260. transparent: !0,
  20261. vertexShader: m.waypoint.vertexShader,
  20262. fragmentShader: m.waypoint.fragmentShader,
  20263. uniforms: s,
  20264. name: "waypoint",
  20265. opacity: 0
  20266. };
  20267. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20268. l.name = "wayPtOut");
  20269. var h = new r.RawShaderMaterial(l)
  20270. , u = new r.Mesh(i,h);
  20271. return u.name = t,
  20272. u
  20273. }
  20274. ,
  20275. n.prototype.makeStartMarker = function(e, t) {
  20276. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20277. i.y = 0,
  20278. i.normalize();
  20279. var n = Math.acos(i.x)
  20280. , o = this.makeWaypointObj(w.pathStart, "Start");
  20281. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20282. o.position.copy(e),
  20283. o
  20284. }
  20285. ,
  20286. n.prototype.makeEndMarker = function(e) {
  20287. var t = this.makeWaypointObj(w.pathEnd, "End")
  20288. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20289. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20290. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20291. t.position.copy(e),
  20292. t
  20293. }
  20294. ,
  20295. n.prototype.pathClean = function(e) {
  20296. if (e) {
  20297. for (var t in e.children)
  20298. this.pathClean(e.children[t]);
  20299. e.geometry && e.geometry.dispose(),
  20300. e.material && e.material.dispose()
  20301. }
  20302. }
  20303. ,
  20304. n.prototype.discardPathObject = function() {
  20305. if (this.obj3d) {
  20306. var e = this.obj3d.parent;
  20307. e && e.remove(this.obj3d),
  20308. this.pathClean(this.obj3d)
  20309. }
  20310. this.obj3d = null,
  20311. this.popInCpm()
  20312. }
  20313. ,
  20314. n.prototype.discardSlow = function() {
  20315. if (this.obj3d) {
  20316. if (this.player.mode !== a.PANORAMA)
  20317. return void this.discardPathObject();
  20318. for (var e, t = this, i = 0, n = function() {
  20319. this.discardPathObject()
  20320. }
  20321. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20322. e = t.obj3d.children[r],
  20323. 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]),
  20324. i += 1,
  20325. n = null);
  20326. 0 === i && this.discardPathObject(),
  20327. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20328. }
  20329. }
  20330. ,
  20331. n.prototype.appearSlow = function() {
  20332. var e, t = this;
  20333. this.fadeOutCpm(c.path.fadeInTime);
  20334. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20335. e = t.obj3d.children[n],
  20336. 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]))
  20337. }
  20338. ,
  20339. n.prototype.update = function() {
  20340. this.obj3d && this.obj3d.updateMatrixWorld()
  20341. }
  20342. ,
  20343. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20344. var t = r.Math.degToRad(c.warp.burnsAngle);
  20345. if (this.player.mode === a.PANORAMA) {
  20346. var i = this.burnsDir * t;
  20347. if (this.upcomingTransType === l.BLACK)
  20348. return i;
  20349. var n = e;
  20350. if (null === n)
  20351. return y.warn("Transition request for non-highlight"),
  20352. i;
  20353. var o = this.getHeroDescriptorByHeroIndex(n);
  20354. if (null === o)
  20355. return i;
  20356. if (!o.isPano())
  20357. return i;
  20358. var s = this.getHeroPano(o)
  20359. , h = this.playerControls.cameras[a.PANORAMA]
  20360. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20361. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20362. , p = function(e) {
  20363. var i = Math.acos(Math.min(1, e.dot(u)))
  20364. , n = (new r.Vector3).crossVectors(u, e);
  20365. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20366. };
  20367. if (s === this.player.currentPano)
  20368. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20369. var f = this.findShortestPath(this.player.currentPano, s);
  20370. if (void 0 === f || null === f || f.length < 1)
  20371. return y.debug("Empty path ahead..."),
  20372. i;
  20373. var g = this.makePathHulls(f)
  20374. , m = new r.CatmullRomCurve3(g.camera)
  20375. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20376. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20377. }
  20378. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20379. }
  20380. ,
  20381. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20382. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20383. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20384. var n = new r.Euler
  20385. , o = new r.Vector3;
  20386. y.debug("Starting wait: " + (void 0 !== t));
  20387. var s = this.calcBurnsAmount(e)
  20388. , h = function() {
  20389. this.endWarpState(),
  20390. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20391. t && t()
  20392. }
  20393. .bind(this)
  20394. , u = function(e, t) {
  20395. if (this.warpInterrupted)
  20396. return h(),
  20397. !0;
  20398. var r = t || 1e3 / 60;
  20399. if (c.warp.doBurns)
  20400. if (this.player.mode === a.PANORAMA) {
  20401. var l = this.playerControls.cameras[a.PANORAMA];
  20402. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20403. var u = r * s / i;
  20404. u = -1*Math.abs(u);//add
  20405. n.y += u,
  20406. o.set(0, 0, -1),
  20407. o.applyEuler(n),
  20408. o.add(l.position),
  20409. l.controls.lookAt(o),
  20410. l.controls.lookVector.copy(o)
  20411. ,l.lookAt(o)
  20412. } else
  20413. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20414. }
  20415. .bind(this);
  20416. this.startWarpState(),
  20417. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20418. }
  20419. ,
  20420. n.prototype.warpToNonPano = function(e) {
  20421. if (this.discardPathObject(),
  20422. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20423. var t = function() {
  20424. e && e()
  20425. }
  20426. .bind(this);
  20427. this.player.flyToNewMode({
  20428. mode: this.warpDestHeroLoc.cameraMode,
  20429. duration: c.warp.outsideTime,
  20430. warpDest: this.warpDestHeroLoc,
  20431. callback: t,
  20432. force: !0
  20433. })
  20434. } else
  20435. y.warn("no warp destination!!!"),
  20436. e && e()
  20437. }
  20438. ,
  20439. n.prototype._resetWarpShaderParams = function(e) {
  20440. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20441. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20442. }
  20443. ,
  20444. n.prototype._clearWarpShading = function() {
  20445. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20446. this._resetWarpShaderParams(e[t]),
  20447. e[t].visible = !0;
  20448. this._resetWarpShaderParams(this.model.skybox)
  20449. }
  20450. ,
  20451. n.prototype._warpStopFlying = function() {
  20452. this.activeTransType = null,
  20453. this.placeCpm()
  20454. }
  20455. ,
  20456. n.prototype._wrapupTravelOnlyBits = function() {
  20457. this._warpStopFlying(),
  20458. this.warpPathPoints && (this.player.currentPano.exit(),
  20459. this.warpDestPano.enter(),
  20460. this.player.currentPano = this.warpDestPano),
  20461. this.player.spider.draw(),
  20462. this.placeCpm()
  20463. }
  20464. ,
  20465. n.prototype._wrapupTravel = function(e) {
  20466. this._wrapupTravelOnlyBits(),
  20467. this.warpCameraAim(e)
  20468. }
  20469. ,
  20470. n.prototype._wrapupWarpShading = function(e) {
  20471. this._clearWarpShading(),
  20472. this._wrapupTravel(e)
  20473. }
  20474. ,
  20475. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20476. t !== I.END && this._clearWarpShading(),
  20477. this._wrapupTravelOnlyBits(),
  20478. this.upcomingTransType = null,
  20479. e && e()
  20480. }
  20481. ,
  20482. n.prototype._warpCameraAim = function(e, t) {
  20483. var i = this.warpDestHeroLoc.quaternion
  20484. , n = this.playerControls.cameras[a.PANORAMA]
  20485. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20486. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20487. , l = s.dot(o)
  20488. , u = r.Math.radToDeg(Math.acos(l))
  20489. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20490. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20491. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20492. m.y = h.constrainedTurn(m.y),
  20493. this.burnsDir = Math.sign(m.y);
  20494. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20495. , A = new r.Vector3
  20496. , C = function(e, t) {
  20497. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20498. v.y = g.y + e * m.y,
  20499. v.z = g.z + e * m.z,
  20500. A.set(0, 0, -1),
  20501. A.applyEuler(v),
  20502. A.add(n.position),
  20503. n.controls.lookAt(A),
  20504. n.controls.lookVector.copy(A),
  20505. void n.lookAt(A))
  20506. }
  20507. .bind(this);
  20508. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20509. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20510. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20511. ):
  20512. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20513. ,void (t && t())
  20514. ) */
  20515. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20516. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20517. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20518. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20519. ,void (t && t())
  20520. )
  20521. }
  20522. ,
  20523. n.prototype._warpBendAim = function(e, t, i, n) {
  20524. var o = n || 0
  20525. , s = this.playerControls.cameras[a.PANORAMA]
  20526. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20527. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20528. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20529. f.y = h.constrainedTurn(f.y);
  20530. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20531. f.x = g * Math.sign(f.x),
  20532. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20533. this.burnsDir = Math.sign(f.y),
  20534. g *= Math.sign(f.y),
  20535. f.y = g;
  20536. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20537. , v = new r.Vector3
  20538. , A = function(e, t) {
  20539. if (e < .5)
  20540. m.x = u.x + e * f.x,
  20541. m.y = u.y + e * f.y,
  20542. m.z = u.z + e * f.z;
  20543. else {
  20544. var i = (1 - e) * c.warp.softBendEnd;
  20545. m.x = l.x - i * f.x,
  20546. m.y = l.y - i * f.y,
  20547. m.z = l.z - i * f.z
  20548. }
  20549. v.set(0, 0, -1),
  20550. v.applyEuler(m),
  20551. v.add(s.position);
  20552. s.controls.lookAt(v),
  20553. s.controls.lookVector.copy(v),
  20554. s.lookAt(v);
  20555. }
  20556. .bind(this);
  20557. return p.start(A, t, i, o, d[c.warp.movementEasing])
  20558. }
  20559. ,
  20560. n.prototype._warpStepCameraAim = function(e, t, i) {
  20561. var n = this.playerControls.cameras[a.PANORAMA]
  20562. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20563. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20564. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20565. l.y = h.constrainedTurn(l.y),
  20566. this.burnsDir = Math.sign(l.y);
  20567. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20568. , f = new r.Vector3
  20569. , g = function(e, t) {
  20570. e < .5 ? u.copy(s) : u.copy(o),
  20571. f.set(0, 0, -1),
  20572. f.applyEuler(u),
  20573. f.add(n.position),
  20574. n.controls.lookAt(f),
  20575. n.controls.lookVector.copy(f),
  20576. n.lookAt(f)
  20577. }
  20578. .bind(this);
  20579. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20580. }
  20581. ,
  20582. n.prototype.setBurnsDir = function() {
  20583. var e = this.playerControls.cameras[a.PANORAMA]
  20584. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20585. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20586. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20587. n.y = h.constrainedTurn(n.y),
  20588. this.burnsDir = Math.sign(n.y)
  20589. }
  20590. ,
  20591. n.prototype.stepWarpPath = function(e, t) {
  20592. var i = this.playerControls.cameras[a.PANORAMA];
  20593. if (!this.warpPathPoints)
  20594. return i.position.copy(this.warpDestPano.position),
  20595. !0;
  20596. var n = this.warpPathPoints[0]
  20597. , o = this.warpDestPano.position;
  20598. if (null !== this.nodes && this.cameraHull.length > 1) {
  20599. var s = new r.Vector3;
  20600. 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),
  20601. i.position.copy(s)
  20602. } else
  20603. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20604. }
  20605. ,
  20606. n.prototype.interruptAndFastForward = function(e, t) {
  20607. this.warping && (this.warpInterrupted = !0,
  20608. this.warpInterruptionBlackoutStyle = e,
  20609. this.warpInterruptionTravelTime = t,
  20610. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20611. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20612. }
  20613. ,
  20614. n.prototype.warpCameraAim = function(e) {
  20615. var t = c.warp.minWarpTime;
  20616. if (this.upcomingTransType === l.BLACK)
  20617. t = c.warp.teleportTime;
  20618. else {
  20619. var i = this.playerControls.cameras[a.PANORAMA]
  20620. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20621. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20622. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20623. s.y = h.constrainedTurn(s.y);
  20624. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20625. t = Math.max(t, u)
  20626. }
  20627. var d = function() {
  20628. this._warpStopFlying(),
  20629. this.discardSlow(),
  20630. e && e()
  20631. }
  20632. .bind(this);
  20633. this._warpCameraAim(t, d)
  20634. }
  20635. ,
  20636. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20637. this.model.skybox.material.uniforms.blackout.value = n;
  20638. var r = u.uniform(this.model.skybox, "progress", 1)
  20639. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20640. , a = !1
  20641. , s = function() {
  20642. if (this.warpInterrupted)
  20643. return a = !0,
  20644. !0
  20645. }
  20646. .bind(this)
  20647. , l = function(e, t) {
  20648. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20649. !0) : void r(e, t)
  20650. }
  20651. .bind(this)
  20652. , h = function(e, t) {
  20653. return i && a ? (o(0),
  20654. !0) : void o(e, t)
  20655. }
  20656. .bind(this);
  20657. p.start(s, e, null, t, null, "safeHaltWatch"),
  20658. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20659. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20660. }
  20661. ,
  20662. n.prototype.warpTravel_STD = function(e) {
  20663. 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),
  20664. 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;
  20665. w += this.warpLength * c.warp.timePerMeter,
  20666. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20667. var _ = !1
  20668. , T = this.warpDestHeroLoc.quaternion
  20669. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20670. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20671. , M = S.dot(x)
  20672. , R = r.Math.radToDeg(Math.acos(M))
  20673. , P = function(e) {
  20674. var t = o
  20675. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20676. return i
  20677. }
  20678. , O = function() {
  20679. return E.lookAt(C, t, A.UP),
  20680. s.setFromRotationMatrix(E, c.warp.eOrder),
  20681. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20682. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20683. h.constrainedTurn(b.y)
  20684. }
  20685. .bind(this)
  20686. , L = function(e, t) {
  20687. if (this.warpInterrupted)
  20688. return _ = !0,
  20689. !0
  20690. }
  20691. .bind(this)
  20692. , D = function(e, t) {
  20693. return _ || !this.warpPathPoints ? (g.blur(0),
  20694. !0) : void g.blur(e)
  20695. }
  20696. .bind(this)
  20697. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20698. , B = function(e, t) {
  20699. return _ || !this.warpPathPoints ? (N(0),
  20700. !0) : void N(e, t)
  20701. }
  20702. .bind(this)
  20703. , F = function(e, t) {
  20704. if (!this.warpPathPoints)
  20705. return n.position.copy(this.warpDestPano.position),
  20706. !0;
  20707. if (_)
  20708. return !0;
  20709. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20710. n.position.copy(i),
  20711. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20712. }
  20713. .bind(this)
  20714. , V = function(e, n) {
  20715. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20716. !0)
  20717. }
  20718. .bind(this)
  20719. , U = function(e, o) {
  20720. if (_)
  20721. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20722. !0;
  20723. if (!this.warpPathPoints)
  20724. return !0;
  20725. var a = this.warpLength * e
  20726. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20727. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20728. c.warp.matchCam && (l *= 1 - u),
  20729. E.lookAt(C, t, A.UP),
  20730. s.setFromRotationMatrix(E, c.warp.eOrder),
  20731. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20732. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20733. b.y = h.constrainedTurn(b.y),
  20734. s.x = m.x + l * b.x,
  20735. s.y = m.y + l * b.y,
  20736. s.z = m.z + l * b.z,
  20737. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20738. b.y = h.constrainedTurn(b.y);
  20739. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20740. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20741. v.x = v.x + b.x * c.warp.turnFriction,
  20742. v.y = v.y + b.y * c.warp.turnFriction,
  20743. v.z = v.z + b.z * c.warp.turnFriction,
  20744. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20745. var p = t.clone().sub(C).normalize();
  20746. if (R < c.warp.maxAimRotation && u > 0) {
  20747. var g = 1 - u;
  20748. p.x = p.x * g + u * S.x,
  20749. p.y = p.y * g + u * S.y,
  20750. p.z = p.z * g + u * S.z,
  20751. p.normalize()
  20752. }
  20753. this.bunnyObj.position.copy(n.position).add(p),
  20754. f.set(0, 0, -1).applyEuler(v).normalize(),
  20755. f.multiplyScalar(8),
  20756. f.add(n.position),
  20757. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20758. n.controls.lookVector.copy(f),
  20759. n.lookAt(f))
  20760. }
  20761. .bind(this)
  20762. , k = function() {
  20763. _ ? (this.discardSlow(),
  20764. this.upcomingTransType = l.BLACK,
  20765. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20766. }
  20767. .bind(this);
  20768. V(0);
  20769. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20770. w += H;
  20771. var G = H / w;
  20772. this.warpCommonParameters(w, G, !0, I.NONE),
  20773. p.start(L, w, null, 0, null, "_haltWatcher"),
  20774. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20775. p.start(D, w, null, G, P, "blurring")),
  20776. p.start(B, w, null, G, P, "modelAlpha"),
  20777. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20778. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20779. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20780. }
  20781. ,
  20782. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20783. var r = e || 0;
  20784. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  20785. this.warpCommonParameters(t, r, !1, i),
  20786. this.model.chunks.forEach(function(e) {
  20787. e.material.uniforms.blackout.value = i
  20788. }),
  20789. this._warpBendAim(null, t, null, r);
  20790. var o = function() {
  20791. this.wrapupWarpShadingOnly(n, i);
  20792. }
  20793. .bind(this);
  20794. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20795. }
  20796. ,
  20797. n.prototype.flightStepWalk = function(e, t, i) {
  20798. var n = .001
  20799. , o = 1
  20800. , a = 1.2
  20801. , s = new r.Vector3
  20802. , h = new r.Vector3
  20803. , u = function(e, t) {
  20804. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20805. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20806. h.copy(A.FORWARD),
  20807. this.player.getDirection(h),
  20808. s.copy(t).sub(e.position).normalize();
  20809. var l = s.dot(h)
  20810. , u = Math.acos(l)
  20811. , d = u / r;
  20812. return d > n && (r *= d / n,
  20813. u < o && (r *= a)),
  20814. r
  20815. };
  20816. return function(e, t, i) {
  20817. if (this.warpInterrupted)
  20818. i && i();
  20819. else if (this.activeTransType !== l.WALK)
  20820. this._clearWarpShading(),
  20821. this._warpStopFlying(),
  20822. this.player.spider.draw(),
  20823. this.placeCpm(),
  20824. i && i();
  20825. else if (this.player.currentPano !== e) {
  20826. var n = {
  20827. pano: e,
  20828. lookAtPoint: t,
  20829. duration: null,
  20830. maxDistanceOverride: c.warp.walkMaxDist,
  20831. skipWarpingCheck: !1,
  20832. constantMoveSpeed: !0
  20833. };
  20834. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20835. n.zoomLevel = this.warpDestHeroLoc.zoom
  20836. }
  20837. n.duration = u.call(this, e, t),
  20838. this.player.nonInterruptingFlyToPano(n, i)
  20839. } else
  20840. i && i()
  20841. }
  20842. }(),
  20843. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20844. return this.flightStepWalk.bind(this, e, t, i)
  20845. }
  20846. ,
  20847. n.prototype.warpTravel_WALK = function() {
  20848. var e = [];
  20849. return function(t) {
  20850. var i = this.player.model.panos;
  20851. e.length = 0;
  20852. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20853. var s = this.nodes[a]
  20854. , l = i.get(s);
  20855. a === this.nodes.length - 1;
  20856. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20857. n && o || (e.push(s),
  20858. n = l)
  20859. }
  20860. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20861. var h = e.length
  20862. , u = i.get(e[h - 1])
  20863. , d = new Array(h + 1);
  20864. d[d.length - 1] = function() {
  20865. t && t()
  20866. }
  20867. .bind(this);
  20868. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20869. var g = e[p];
  20870. u = i.get(g);
  20871. var m = new r.Vector3;
  20872. this.getLookAtForWalkingTourNode(e, p, m),
  20873. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20874. p--
  20875. }
  20876. d[0]()
  20877. }
  20878. }(),
  20879. n.prototype.getLookAtForWalkingTourNode = function() {
  20880. var e = new r.Vector3
  20881. , t = new r.Vector3
  20882. , i = new r.Vector3
  20883. , n = new r.Vector3
  20884. , o = new r.Vector3
  20885. , a = .65
  20886. , s = .75
  20887. , l = .2
  20888. , c = .4
  20889. , h = .2
  20890. , u = 3;
  20891. return function(r, d, p) {
  20892. var f = r.length;
  20893. if (d >= f)
  20894. return !1;
  20895. var g = 1
  20896. , m = 1;
  20897. t.set(0, 0, 0),
  20898. o.set(0, 0, 0);
  20899. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20900. if (v = this.player.model.panos.get(r[A]),
  20901. this.getOrientationForWalkingTourNode(r, A, i),
  20902. A === d && e.copy(i),
  20903. n.copy(i),
  20904. A > d) {
  20905. var y = n.dot(e) < a;
  20906. g *= y ? l : s,
  20907. m *= y ? h : c
  20908. }
  20909. i.multiplyScalar(g),
  20910. t.add(i),
  20911. o.lerp(v.position, m)
  20912. }
  20913. return t.normalize(),
  20914. p.copy(o),
  20915. p.add(t),
  20916. !0
  20917. }
  20918. }(),
  20919. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20920. var n = e.length;
  20921. if (t >= n)
  20922. return !1;
  20923. if (t === n - 1)
  20924. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20925. else {
  20926. var r = this.player.model.panos.get(e[t])
  20927. , o = this.player.model.panos.get(e[t + 1]);
  20928. i.copy(o.position).sub(r.position)
  20929. }
  20930. return i.normalize(),
  20931. !0
  20932. }
  20933. ,
  20934. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20935. if (this.activeTransType = this.upcomingTransType,
  20936. this.lastTransType = this.activeTransType,
  20937. this.upcomingTransType = null,
  20938. !e) {
  20939. var r = function() {
  20940. this._wrapupTravel(n)
  20941. }
  20942. .bind(this)
  20943. , o = {
  20944. pano: this.warpDestPano,
  20945. lookAtPoint: null,
  20946. duration: null,
  20947. maxDistanceOverride: null,
  20948. skipWarpingCheck: !1
  20949. };
  20950. return void this.player.flyToPano(o, r)
  20951. }
  20952. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20953. this._clearWarpShading(),
  20954. this._warpStopFlying(),
  20955. this.player.spider.draw(),
  20956. this.placeCpm(),
  20957. n && n()
  20958. }
  20959. .bind(this)) : this.warpTravel_STD(n)
  20960. }
  20961. ,
  20962. n.prototype.startWarpState = function() {
  20963. this.warping = !0,
  20964. this.warpInterrupted = !1,
  20965. this.warpInterruptionBlackoutStyle = null,
  20966. this.warpInterruptionTravelTime = null
  20967. }
  20968. ,
  20969. n.prototype.endWarpState = function() {
  20970. this.warping = !1
  20971. }
  20972. ,
  20973. n.prototype.warpToPano = function(e, t, i, n) {
  20974. if (this.warping)
  20975. return void y.warn("Cannot warp when already warping");
  20976. if (this.upcomingTransType = e,
  20977. this.activeTransType = null,
  20978. !this.setWarpDestPano())
  20979. return this.upcomingTransType = null,
  20980. void this.warpToNonPano(n);
  20981. if (this.player.mode !== a.PANORAMA)
  20982. return this.upcomingTransType = null,
  20983. this.discardSlow(),
  20984. void this.player.flyToNewMode({
  20985. mode: a.PANORAMA,
  20986. pano: this.warpDestPano,
  20987. duration: c.warp.outsideTime,
  20988. warpDest: this.warpDestHeroLoc,
  20989. callback: n,
  20990. force: !0
  20991. });
  20992. if (!this.warpDestPano)
  20993. return y.warn("no warp destination, callback dropped"),
  20994. void (this.upcomingTransType = null);
  20995. 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)
  20996. , o = this.chooseWarpPath(r);
  20997. if (o && this.upcomingTransType !== l.WALK) {
  20998. var s = function() {
  20999. this.waitingToWarp = !1,
  21000. this.warpToPano(e, t, i, n)
  21001. }
  21002. .bind(this);
  21003. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21004. return void (this.waitingToWarp = !0)
  21005. }
  21006. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21007. this.player.currentPano = this.warpDestPano,
  21008. this.placeCpm(),
  21009. this.fadeOutCpm(c.path.fadeOutTime),
  21010. this.player.spider.draw()),
  21011. y.debug("Warping to pano ", this.warpDestPano.position),
  21012. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21013. this.startWarpState();
  21014. var h = function() {
  21015. this.endWarpState(),
  21016. n && n()
  21017. }
  21018. .bind(this);
  21019. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21020. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21021. }
  21022. ,
  21023. t.exports = n
  21024. }
  21025. ).call(this, "/js/objects/ShowPath.js")
  21026. }
  21027. , {
  21028. "../constants": 8,
  21029. "../effects": 16,
  21030. "../enum/BlackoutStyle": 18,
  21031. "../enum/ModelManagerEvents": 33,
  21032. "../enum/PlayerEvents": 40,
  21033. "../enum/RenderOrder": 42,
  21034. "../enum/Vectors": 50,
  21035. "../enum/Viewmode": 51,
  21036. "../enum/WarpStyle": 52,
  21037. "../gui/gui": 65,
  21038. "../model/ModelManager": 140,
  21039. "../objects/Snapshot": 153,
  21040. "../settings": 166,
  21041. "../shaders": 167,
  21042. "../util/easing": 186,
  21043. "../util/lerp": 188,
  21044. "../util/logger": 189,
  21045. "../util/math": 190,
  21046. "../util/texture": 194,
  21047. "../util/transitions": 195,
  21048. three: 217
  21049. }],
  21050. 152: [function(e, t, i) {
  21051. "use strict";
  21052. function n() {
  21053. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21054. , t = new r.RawShaderMaterial({
  21055. fragmentShader: o.skysphere.fragmentShader,
  21056. vertexShader: o.skysphere.vertexShader,
  21057. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21058. side: r.BackSide,
  21059. name: "skysphere"
  21060. });
  21061. t.uniforms.radius.value = e.parameters.radius,
  21062. r.Mesh.call(this, e, t)
  21063. }
  21064. var r = e("three")
  21065. , o = e("../shaders")
  21066. , a = e("../settings");
  21067. n.prototype = Object.create(r.Mesh.prototype),
  21068. n.prototype.constructor = n,
  21069. t.exports = n
  21070. }
  21071. , {
  21072. "../settings": 166,
  21073. "../shaders": 167,
  21074. three: 217
  21075. }],
  21076. 153: [function(e, t, i) {
  21077. (function(i) {
  21078. "use strict";
  21079. function n(e) {
  21080. o.call(this, e),
  21081. this.sid = e.sid,//xzw add
  21082. this.panoId = e.panoId,
  21083. this.orthoZoom = e.orthoZoom,
  21084. this.floorVisibility = e.floorVisibility,
  21085. this.thumbUrl = e.thumbUrl,
  21086. this.name = e.name,
  21087. this.zoom = e.zoom
  21088. }
  21089. var r = (e("three"),
  21090. e("../util/logger"))
  21091. , o = (e("../settings"),
  21092. e("../enum/Viewmode"),
  21093. e("../util/common"),
  21094. e("../util/transitions"),
  21095. e("../util/lerp"),
  21096. e("../util/ajax"),
  21097. e("../util/texture"),
  21098. e("./View"));
  21099. e("events").EventEmitter,
  21100. new r(i);
  21101. n.prototype = Object.create(o.prototype),
  21102. n.prototype.isPano = function() {
  21103. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21104. }
  21105. ,
  21106. t.exports = n
  21107. }
  21108. ).call(this, "/js/objects/Snapshot.js")
  21109. }
  21110. , {
  21111. "../enum/Viewmode": 51,
  21112. "../settings": 166,
  21113. "../util/ajax": 181,
  21114. "../util/common": 185,
  21115. "../util/lerp": 188,
  21116. "../util/logger": 189,
  21117. "../util/texture": 194,
  21118. "../util/transitions": 195,
  21119. "./View": 154,
  21120. events: 202,
  21121. three: 217
  21122. }],
  21123. 154: [function(e, t, i) {
  21124. (function(i) {
  21125. "use strict";
  21126. function n(e) {
  21127. e = e || {},
  21128. this.position = new r.Vector3,
  21129. this.quaternion = new r.Quaternion,
  21130. this.update(e)
  21131. }
  21132. var r = e("three")
  21133. , o = e("../util/logger")
  21134. , a = (e("../settings"),
  21135. e("../enum/Viewmode"),
  21136. e("../util/common"),
  21137. e("../util/transitions"),
  21138. e("../util/lerp"),
  21139. e("../util/ajax"),
  21140. e("../util/texture"),
  21141. e("events").EventEmitter);
  21142. new o(i);
  21143. n.prototype = Object.create(a.prototype),
  21144. n.prototype.isValid = function() {
  21145. return !!this.cameraMode
  21146. }
  21147. ,
  21148. n.prototype.update = function(e) {
  21149. return this.cameraMode = e.cameraMode || this.cameraMode,
  21150. this.pano = e.pano || this.pano,
  21151. e.position && this.position.copy(e.position),
  21152. e.quaternion && this.quaternion.copy(e.quaternion),
  21153. this
  21154. }
  21155. ,
  21156. t.exports = n
  21157. }
  21158. ).call(this, "/js/objects/View.js")
  21159. }
  21160. , {
  21161. "../enum/Viewmode": 51,
  21162. "../settings": 166,
  21163. "../util/ajax": 181,
  21164. "../util/common": 185,
  21165. "../util/lerp": 188,
  21166. "../util/logger": 189,
  21167. "../util/texture": 194,
  21168. "../util/transitions": 195,
  21169. events: 202,
  21170. three: 217
  21171. }],
  21172. 155: [function(e, t, i) {//player.js
  21173. (function(i) {
  21174. "use strict";
  21175. function n(e) {
  21176. this.currentPano = null,
  21177. this.nextPano = null,
  21178. this.camera = null,
  21179. this.paused = !1,
  21180. this.flying = !1,
  21181. this.sceneIntersectionPlane = null,
  21182. this.target = new r.Vector3,
  21183. this.mouse = new r.Vector3(1.1,1.1,.5),
  21184. this.mouseAtMouseDown = new r.Vector2,
  21185. this.mouseCouldBeClickToMove = !1,
  21186. this.mouseLastMoveTime = Date.now(),
  21187. this.mouseDown = !1,
  21188. this.mouseDownTimer = null,
  21189. this.couldBeLongTap = !1,
  21190. this.containsMouse = !1,
  21191. this.isTouchEvent = !1,
  21192. this.isPanoHover = !1,
  21193. this.reticule = new a(this),
  21194. this.panoMarkers = [],
  21195. this.spider = new h(this),
  21196. this.quaternion = new r.Quaternion,
  21197. this.position = new r.Vector3(15,10,15),
  21198. this.previousState = null,
  21199. this.lastInsideView = new c,
  21200. this.last360View = new c,
  21201. this.raycaster = new r.Raycaster,
  21202. this.intersect = null,
  21203. this.lastChangeTime = Date.now(),
  21204. this.history = new I,
  21205. this.cameraControls = null,
  21206. this.path = null,
  21207. this.model = null,
  21208. this.domElement = null,
  21209. this.cachedPanoCandidates = null,
  21210. this.basePanoSize = 0,
  21211. this.standardPanoSize = 0,
  21212. this.highPanoSize = 0,
  21213. this.ultraHighPanoSize = 0,
  21214. this.zoomLevel = 1,
  21215. this.zooming = 0,
  21216. this.zoomSpeed = .5,
  21217. this.scrollZoomSpeed = .06,
  21218. this.zoomSpeedAdjust = .05,
  21219. this.defaultZoomIncrement = .2,
  21220. this.baseFov = f.insideFOV,
  21221. this.zoomFov = this.baseFov,
  21222. this.zoomEnabled = !0,
  21223. this.preRenderingEnabled = !1,
  21224. this.setupCustomProperties(e),
  21225. this.zoomStats = new L
  21226. }
  21227. var r = e("three")
  21228. , o = e("./util/logger")
  21229. , a = e("./objects/Reticule")
  21230. , s = e("./objects/Panorama")
  21231. , l = e("./objects/ShowPath")
  21232. , c = e("./objects/View")
  21233. , h = (e("./objects/Snapshot"),
  21234. e("./objects/NSpider"))
  21235. , u = e("./enum/Viewmode")
  21236. , d = (e("./enum/TagStates"),
  21237. e("./enum/Vectors"))
  21238. , p = e("./enum/Keys")
  21239. , f = (e("./enum/AlignmentType"),
  21240. e("./settings"))
  21241. , g = e("./util/common")
  21242. , m = (e("./util/browser"),
  21243. e("./util/math"))
  21244. , v = e("./util/lerp")
  21245. , A = e("./util/easing")
  21246. , y = e("./util/transitions")
  21247. , C = e("events").EventEmitter
  21248. , I = (e("./shaders"),
  21249. e("./util/history"))
  21250. , E = (e("./util/camera"),
  21251. e("./model/ModelManager"),
  21252. e("./enum/PathDiscardMode"))
  21253. , b = e("./enum/PathDisplayMode")
  21254. , w = e("./enum/PlayerEvents")
  21255. , _ = e("./enum/ControlEvents")
  21256. , T = e("./enum/ModelManagerEvents")
  21257. , x = e("./enum/WarpStyle")
  21258. , S = e("./enum/BlackoutStyle")
  21259. , M = e("./exception/BasicException")
  21260. , R = e("./enum/PanoSizeClass")
  21261. , P = (e("./tile/TileDownloader"),
  21262. e("./tile/TilePrioritizer"))
  21263. , O = (e("./enum/PanoramaEvents"),
  21264. e("./enum/ZoomEvents"))
  21265. , L = e("./util/ZoomStats")
  21266. , D = e("./constants")
  21267. , N = e("./util/common")
  21268. , B = e("./util/cameraLight")
  21269. , Hot = e('hot')
  21270. , F = new o(i)
  21271. , V = Object.freeze({
  21272. FlyToPano: y.getUniqueId(),
  21273. FlyToNewMode: y.getUniqueId(),
  21274. FlyToSameMode: y.getUniqueId(),
  21275. FlyToViewFloor: y.getUniqueId(),
  21276. LookTransition: y.getUniqueId(),
  21277. ZoomTransition: y.getUniqueId()
  21278. });
  21279. n.prototype = Object.create(C.prototype),
  21280. n.prototype.init = function(e) {
  21281. window.player = this
  21282. this.modelManager = e.modelManager,
  21283. this.tileDownloader = e.tileDownloader,
  21284. this.panoRenderer = e.panoRenderer,
  21285. this.qualityManager = e.qualityManager,
  21286. this.domElement = e.container,
  21287. this.camera = e.camera,
  21288. this.tagManager = e.tagManager,
  21289. this.cameraControls = e.controls,
  21290. this.path = new l(e.director,this,e.controls),
  21291. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21292. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21293. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21294. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21295. this.tileDownloader.processPriorityQueue = !1,
  21296. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21297. this.bindEvents(e.container),
  21298. this.updateModel()
  21299. }
  21300. //xzw add: 截图
  21301. function dataURLtoBlob(dataurl) {
  21302. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21303. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21304. while(n--){
  21305. u8arr[n] = bstr.charCodeAt(n);
  21306. };
  21307. return new Blob([u8arr], {type:mime});
  21308. }
  21309. n.prototype.screenShot = function(o){
  21310. if(this.flying || this.flyingToTag) return;
  21311. var R = this.sceneRenderer;
  21312. R.updateScreenSize(o);
  21313. for(var i in this.model.panos.index){
  21314. if(!this.model.panos.index[i].marker) continue;
  21315. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21316. this.model.panos.index[i].marker.visible = false;
  21317. }
  21318. for(var i in this.model.hots){
  21319. this.model.hots[i].mesh.visible = false;
  21320. }
  21321. this.reticule.visible = false;
  21322. this.reticule.forceUnvisible = true;
  21323. this.path.currentPanoMarker.mesh.visible = false;
  21324. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21325. R.renderer.clear(true,true,true);
  21326. R.renderer.render(R.scene, R.camera);
  21327. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21328. o.f && o.f(imgData)
  21329. R.updateScreenSize({resize:true});
  21330. this.reticule.visible = true;
  21331. for(var i in this.model.hots){
  21332. this.model.hots[i].mesh.visible = true;
  21333. }
  21334. for(var i in this.model.panos.index){
  21335. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21336. }
  21337. this.path.currentPanoMarker.mesh.visible = true;
  21338. R.renderer.render(R.scene, R.camera);
  21339. }.bind(this),30) //这个数字不能太小
  21340. }
  21341. var scaleImg = e("scaleImg");
  21342. var ResizeImg = function(img, option){
  21343. var img2; //不能直接改img 否则可能触发第二次img.onload
  21344. var compress = function(ratio,type){
  21345. var image = img2 || img;
  21346. var c = document.createElement('canvas');
  21347. c.width = image.width; c.height = image.height;
  21348. var ctx = c.getContext('2d');
  21349. ctx.drawImage(image,0,0,image.width,image.height);
  21350. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21351. }
  21352. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21353. var image = img2 || img;
  21354. var blob = dataURLtoBlob(image.src);
  21355. if(option.maxWeight && blob.size > option.maxWeight){
  21356. compress(option.maxWeight/blob.size, "jpeg")
  21357. blob = dataURLtoBlob(image.src);
  21358. }
  21359. if(!img2){
  21360. img2 = new Image();
  21361. }
  21362. img2.base64Src = image.src;
  21363. img2.src = window.URL.createObjectURL(blob);
  21364. }
  21365. var oldSize = Math.max(img.width, img.height);
  21366. if(option.toType != "png"){//不是非要png的话
  21367. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21368. if(oldSize > option.maxSize){
  21369. compress(option.maxSize/oldSize, "jpeg");
  21370. }
  21371. reCom();
  21372. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21373. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21374. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21375. reCom();
  21376. }
  21377. }
  21378. }else{
  21379. //?貌似png会越压缩越大?
  21380. }
  21381. return img2 || img;
  21382. }
  21383. var _fixType=function(type) {
  21384. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21385. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21386. return 'image/' + r;
  21387. };
  21388. var saveFile=function(data, filename){
  21389. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21390. save_link.href = data;
  21391. save_link.download = filename;
  21392. var event = document.createEvent('MouseEvents');
  21393. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21394. save_link.dispatchEvent(event);
  21395. };
  21396. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21397. var info = this.getSnapAngleInfo();
  21398. var str = ',{\r\t' + info;
  21399. var arg = arguments[0];
  21400. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21401. if (arg && arg.__callback) {
  21402. return arg.__callback(imgData, info)
  21403. }
  21404. var img = new Image();
  21405. img.src = imgData;
  21406. img.onload = function(){
  21407. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21408. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21409. var filename = "snap" + (new Date()).getTime();
  21410. saveFile(img2.src,filename + ".jpg");
  21411. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21412. str +=('\r\t"sid":"'+filename+'",');
  21413. str +=('\r\t"name":"'+filename+'"\r}');
  21414. logData(str)
  21415. }
  21416. }});
  21417. }
  21418. ,
  21419. n.prototype.getSnapAngleInfo = function(){
  21420. var info = {};
  21421. var str = '"metadata":{';
  21422. var q = this.camera.quaternion.clone();
  21423. switch (this.mode) {
  21424. case "panorama":
  21425. info.scan_id = this.currentPano.id;
  21426. str += ('"scan_id":"'+this.currentPano.id+'",');
  21427. break;
  21428. case "floorplan":
  21429. info.camera_mode = 1;
  21430. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21431. q.multiply(this.camera.quaternion);
  21432. str += ('"camera_mode":1,');
  21433. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21434. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21435. break;
  21436. case "dollhouse":
  21437. info.camera_mode = 2;
  21438. str += ('"camera_mode":2,');
  21439. break;
  21440. }
  21441. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21442. console.log(info.camera_position)
  21443. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21444. /**fyz 对相机截屏的角度进行校对 */
  21445. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21446. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21447. out.x *= -1;
  21448. out.w *= -1;
  21449. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21450. }else{
  21451. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21452. }
  21453. info.zoom = this.zoomLevel;
  21454. console.log(info.camera_quaternion)
  21455. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21456. // fyz 扩展编辑页面, 加上导览点缩放值
  21457. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21458. return str;
  21459. }
  21460. //------end
  21461. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21462. if(!g_currentHot) return;
  21463. g_currentHot = null;
  21464. var hotPop = document.getElementById('popup');
  21465. hotPop.style.display = "none";
  21466. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21467. $("#popup iframe:last").remove();
  21468. var _bgaudio = document.getElementById("bgaudio");
  21469. //判断音乐是否暂停或者是否存在
  21470. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21471. {
  21472. //g_bgAudio.play();
  21473. manage.switchBgmState(true)
  21474. }; */
  21475. if(g_bgAudio && g_bgAudio.pauseByHot){
  21476. manage.switchBgmState(true)
  21477. }
  21478. try{
  21479. window.parent.postMessage("closeHot",'*')
  21480. }catch(e){
  21481. console.log(e)
  21482. }
  21483. //$('#player').off("click",this.closePopup);
  21484. $("#volume").removeClass("hide")
  21485. return false
  21486. }
  21487. n.prototype.setupCustomProperties = function(e) {
  21488. var t = e || u.PANORAMA;
  21489. Object.defineProperty(this, "mode", {
  21490. get: function() {
  21491. return t
  21492. },
  21493. set: function(e) {
  21494. var i = t;
  21495. t = e,
  21496. this.onModeUpdated(i, t)
  21497. }
  21498. })
  21499. }
  21500. ,
  21501. n.prototype.isInMode = function() {
  21502. for (var e = 0; e < arguments.length; e++)
  21503. if (this.mode === arguments[e])
  21504. return !0;
  21505. return !1
  21506. }
  21507. ,
  21508. n.prototype.isOutsideMode = function(e) {
  21509. return e = e || this.mode,
  21510. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21511. }
  21512. ,
  21513. n.prototype.is360View = function(e, t) {
  21514. return e === u.PANORAMA && t && !t.isAligned()
  21515. }
  21516. ,
  21517. n.prototype.setScene = function(e) {
  21518. this.sceneIntersectionPlane = e.plane,
  21519. this.path.setScene(e),
  21520. this.moveReticuleToScene(e)
  21521. }
  21522. ,
  21523. n.prototype.moveReticuleToScene = function(e) {
  21524. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21525. e.add(this.reticule)
  21526. }
  21527. ,
  21528. n.prototype.updateModel = function() {
  21529. function e(e, t, n) {
  21530. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21531. }
  21532. function t(e, t) {
  21533. if (this.mode === u.DOLLHOUSE) {
  21534. var n = e ? this.model.center.y : n = t.center.y;
  21535. i.call(this, n)
  21536. }
  21537. }
  21538. function i(e) {
  21539. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21540. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21541. , n = t.position.y + (e - i.target.y)
  21542. , r = f.showFloorDuration + f.showFloorDelay;
  21543. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21544. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21545. }
  21546. this.model = this.modelManager.getActiveModel(),
  21547. this.model.on("floor.changed", e.bind(this)),
  21548. this.model.on("allfloors.toggled", t.bind(this)),
  21549. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21550. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21551. var e2 = this;
  21552. this.model.panos.list.forEach(function(a) {
  21553. a.vrMarker.addEventListener("click", function() {
  21554. e2.flyToPano({
  21555. pano: a
  21556. })
  21557. })
  21558. })
  21559. /********************************************************************************************************************************************/
  21560. }
  21561. ,
  21562. n.prototype.updateModelDependentData = function() {
  21563. this.cameraControls.setModelForControls(this.model),
  21564. this.getPanoMarkersFromModel(this.model)
  21565. }
  21566. ,
  21567. n.prototype.onModelChanged = function() {
  21568. this.updateModel(),
  21569. this.updateModelDependentData()
  21570. }
  21571. ,
  21572. n.prototype.getPanoMarkersFromModel = function(e) {
  21573. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21574. return t.marker ? e.concat(t.marker) : e
  21575. }, [])
  21576. }
  21577. ,
  21578. n.prototype.handleControlMove = function(e) {
  21579. this.emit(w.Move, e)
  21580. }
  21581. ,
  21582. n.prototype.handleControlInputStart = function(e) {
  21583. this.emit(w.InputStart, e)
  21584. }
  21585. ,
  21586. n.prototype.onModeUpdated = function(e, t) {
  21587. this.cameraControls.activateControls(t),
  21588. this.emit(w.ModeChanged, e, t)
  21589. }
  21590. ,
  21591. n.prototype.isWarping = function() {
  21592. return this.path.warping
  21593. }
  21594. ,
  21595. n.prototype.isWaitingToWarp = function() {
  21596. return this.path.waitingToWarp
  21597. }
  21598. ,
  21599. n.prototype.getLabelScaleFactor = function() {
  21600. if (this.isOutsideMode()) {
  21601. var e = 10
  21602. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21603. return t
  21604. }
  21605. return .5
  21606. }
  21607. ,
  21608. n.prototype.changeMusic = function() {//xzw add
  21609. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  21610. g_playAudio = g_bgAudio;
  21611. //g_bgAudio.play();
  21612. manage.switchBgmState(true)
  21613. }else{
  21614. if(!g_play){
  21615. g_playAudio = g_bgAudio;
  21616. }else{//防止再次播放时重播一遍
  21617. g_playAudio = null;
  21618. }
  21619. } */
  21620. /* if(!this.director.tourIsPlaying && g_bgAudio){
  21621. manage.switchBgmState(true)
  21622. } */
  21623. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21624. }
  21625. ,
  21626. n.prototype.bindEvents = function(e) {
  21627. e !== document && e.setAttribute("tabindex", -1),
  21628. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21629. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21630. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21631. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21632. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21633. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21634. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21635. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21636. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21637. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21638. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21639. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21640. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21641. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21642. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21643. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21644. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21645. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21646. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21647. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21648. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21649. // lzb
  21650. window.getSeft && getSeft(this);
  21651. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  21652. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  21653. $('#closepop').on("touchstart",this.closePopup.bind(this));
  21654. }else{
  21655. $('#closepop').on("click",this.closePopup.bind(this));
  21656. }
  21657. }
  21658. ,
  21659. n.prototype.onMouseDown = function(e) {
  21660. e.currentTarget !== document && e.currentTarget.focus(),
  21661. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21662. this.updateIntersect())
  21663. }
  21664. ,
  21665. n.prototype.onMouseMove = function(e) {
  21666. this.isTouchEvent = !1,
  21667. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21668. }
  21669. ,
  21670. n.prototype.onMouseOver = function(e) {
  21671. this.containsMouse = !0,
  21672. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21673. }
  21674. ,
  21675. n.prototype.onMouseOut = function(e) {
  21676. this.containsMouse = !1
  21677. }
  21678. ,
  21679. n.prototype.onMouseUp = function(e) {
  21680. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21681. }
  21682. ,
  21683. n.prototype.onTouchStart = function(e) {
  21684. if (e.currentTarget !== document && e.currentTarget.focus(),
  21685. !this.mouseDown) {
  21686. this.couldBeLongTap = !0;
  21687. var t = g.average(e.changedTouches, "clientX")
  21688. , i = g.average(e.changedTouches, "clientY");
  21689. this.handleInputStart.call(this, t, i, !0),
  21690. this.mouseDownTimer = setTimeout(function() {
  21691. this.updateIntersect(),
  21692. this.handleInputEnd.call(this, t, i, !0)
  21693. }
  21694. .bind(this), f.input.longTapThreshold)
  21695. }
  21696. }
  21697. ,
  21698. n.prototype.onTouchMove = function(e) {
  21699. var t = g.average(e.changedTouches, "clientX")
  21700. , i = g.average(e.changedTouches, "clientY");
  21701. this.handleInputMove.call(this, t, i, !0)
  21702. }
  21703. ,
  21704. n.prototype.onTouchEnd = function(e) {
  21705. if (clearTimeout(this.mouseDownTimer),
  21706. this.mouseDown) {
  21707. this.couldBeLongTap = !1,
  21708. this.updateIntersect();
  21709. var t = g.average(e.changedTouches, "clientX")
  21710. , i = g.average(e.changedTouches, "clientY");
  21711. this.handleInputEnd.call(this, t, i, !0)
  21712. }
  21713. }
  21714. ,
  21715. n.prototype.onPointerDown = function(e) {
  21716. return e.currentTarget !== document && e.currentTarget.focus(),
  21717. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21718. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21719. void (this.mouseDownTimer = setTimeout(function() {
  21720. this.updateIntersect(),
  21721. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21722. }
  21723. .bind(this), f.input.longTapThreshold)))
  21724. }
  21725. ,
  21726. n.prototype.onPointerMove = function(e) {
  21727. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21728. }
  21729. ,
  21730. n.prototype.onPointerUp = function(e) {
  21731. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21732. this.couldBeLongTap = !1,
  21733. this.updateIntersect(),
  21734. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21735. }
  21736. ,
  21737. n.prototype.onPointerOut = function(e) {
  21738. this.mouseDown = !1
  21739. }
  21740. ,
  21741. n.prototype.onPointerCancel = function(e) {
  21742. this.mouseDown = !1
  21743. }
  21744. ,
  21745. n.prototype.onKeyDown = function(e) {
  21746. var t = function() {
  21747. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21748. }
  21749. .bind(this)
  21750. , i = e.which;
  21751. switch (i) {
  21752. case p.F:
  21753. t(),
  21754. this.changeFloor(-1);
  21755. break;
  21756. case p.R:
  21757. t(),
  21758. this.changeFloor(1)
  21759. }
  21760. if (this.mode === u.PANORAMA)
  21761. switch (i) {
  21762. case p.UPARROW:
  21763. case p.W:
  21764. this.flyLocalDirection(d.FORWARD.clone());
  21765. break;
  21766. case p.DOWNARROW:
  21767. case p.S:
  21768. this.flyLocalDirection(d.BACK.clone());
  21769. break;
  21770. case p.A:
  21771. this.flyLocalDirection(d.LEFT.clone());
  21772. break;
  21773. case p.D:
  21774. this.flyLocalDirection(d.RIGHT.clone())
  21775. }
  21776. }
  21777. ,
  21778. n.prototype.handleScrollPinchZoom = function() {
  21779. return function(e) {
  21780. var t = e
  21781. , i = this.zoomLevel;
  21782. this.zoomBy(t),
  21783. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21784. }
  21785. }(),
  21786. n.prototype.handleControlPinch = function(e) {
  21787. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21788. }
  21789. ,
  21790. n.prototype.handleControlScroll = function(e) {
  21791. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21792. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21793. }
  21794. ,
  21795. n.prototype.handleInputStart = function(e, t, i) {
  21796. //许钟文加
  21797. var pad = this.handelPadding(e, t);
  21798. e = pad.x;
  21799. t = pad.y;
  21800. this.isTouchEvent = i,
  21801. m.convertScreenPositionToNDC(e, t, this.mouse),
  21802. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21803. this.mouseCouldBeClickToMove = !0,
  21804. this.mouseDown = !0;
  21805. if (this.mouseCouldBeClickToMove) {
  21806. //window.DownInterface && new DownInterface().state(this,Hot);
  21807. window.Hotpoint && new Hotpoint().state(this,Hot);
  21808. }
  21809. /* if( this.overlayGroup.children.length){
  21810. this.overlayGroup.children.forEach((overlay)=>{
  21811. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  21812. })
  21813. } */
  21814. }
  21815. ,
  21816. n.prototype.handelPadding = function(x, y) {
  21817. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21818. if (!this.pad)
  21819. this.pad = {
  21820. x: dom.getOffset("left", $("#player")[0]),
  21821. y: dom.getOffset("top", $("#player")[0])
  21822. }
  21823. return {
  21824. x: x - this.pad.x,
  21825. y: y - this.pad.y
  21826. }
  21827. }
  21828. n.prototype.handleInputMove = function(e, t, i) {
  21829. //许钟文加
  21830. var pad = this.handelPadding(e, t);
  21831. e = pad.x;
  21832. t = pad.y;
  21833. this.isTouchEvent = i,
  21834. m.convertScreenPositionToNDC(e, t, this.mouse),
  21835. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21836. this.couldBeLongTap = !1,
  21837. clearTimeout(this.mouseDownTimer)),
  21838. this.mouseLastMoveTime = Date.now(),
  21839. this.reticule.move(e, t, i)
  21840. }
  21841. ,
  21842. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21843. if (this.isTouchEvent = i,
  21844. this.mouseDown = !1,
  21845. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21846. !i && this.couldBeLongTap)
  21847. return !0;
  21848. if (this.handleLongTap())
  21849. return !0;
  21850. if (this.mouseCouldBeClickToMove) {
  21851. if (this.flying)
  21852. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21853. !0;
  21854. //add----
  21855. if(this.checkHotClick())//add
  21856. return !0;
  21857. if(this.hoveringPlane){
  21858. this.clickOverlay(this.hoveringPlane)
  21859. return;
  21860. }
  21861. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21862. this.history.invalidate(),
  21863. this.intersect)
  21864. return this.flyToPanoClosestToMouse();
  21865. if (this.mode === u.PANORAMA) {
  21866. var n = this.closestPanoInDirection(this.getMouseDirection());
  21867. return n ? this.flyToPano({
  21868. pano: n
  21869. }) : this.bump(this.getMouseDirection())
  21870. }
  21871. }
  21872. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21873. }
  21874. ,
  21875. n.prototype.handleLongTap = function() {
  21876. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21877. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21878. !0
  21879. }
  21880. ,
  21881. n.prototype.checktagClick = function() {
  21882. if (this.tagManager.intersectTag) {
  21883. var e = this.isTouchEvent
  21884. , t = this.tagManager.clickedOnTag(e, this);
  21885. return e || t || y.cancelById(V.LookTransition),
  21886. !0
  21887. }
  21888. if (this.tagManager.activeTag)
  21889. return this.tagManager.dismissActiveTag(),
  21890. !1
  21891. }
  21892. ,
  21893. n.prototype.rankedtagInDirection = function(e, t) {
  21894. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21895. }
  21896. ,
  21897. n.prototype.start = function(e) {
  21898. //-------------------
  21899. window.initOverlay(r)
  21900. this.model.loadOverlays()
  21901. createEnterLogo()
  21902. //-------------------
  21903. var t = e.mode
  21904. , i = e.pano
  21905. , n = e.position
  21906. , rr = e.quaternion
  21907. , o = e.tag
  21908. , a = e.quickstart
  21909. , s = $.Deferred();
  21910. this.updateModelDependentData(),
  21911. this.updateFromControls(),
  21912. this.findDefaultViews();
  21913. var l = this.is360View(t, i);
  21914. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21915. s.done(function(e) {
  21916. this.emit(w.Ready, l, e, o)
  21917. }
  21918. .bind(this)),
  21919. s.promise()
  21920. }
  21921. ,
  21922. n.prototype.startOutside = function(e, t) {
  21923. var i = e.mode
  21924. , n = e.pano
  21925. , r = e.position
  21926. , o = e.quaternion
  21927. , a = e.zoom
  21928. , s = e.floorVisibility
  21929. , l = e.tag;
  21930. this.emit(w.StartOutside, f[i].transitionTime),
  21931. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21932. y.cancelById(V.FlyToViewFloor),
  21933. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21934. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21935. }
  21936. ,
  21937. n.prototype.startInside = function(e, t, i, n, r) {
  21938. r = r || $.Deferred(),
  21939. this.currentPano = e;
  21940. var o = e && !e.isAligned();
  21941. if (t = o ? e.position : t || e.position,
  21942. i = i || e.quaternion,
  21943. e) {
  21944. var a = this.startInside.bind(this, e, t, i, n, r);
  21945. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21946. return
  21947. }
  21948. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21949. this.updateHotVisible()
  21950. return this.mode = u.PANORAMA,
  21951. e.floor.enter(this.mode),
  21952. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21953. this.switchCameraMode(this.mode, i),
  21954. this.emit(w.StartInside, o),
  21955. r.resolve(!0),
  21956. r
  21957. }
  21958. ,
  21959. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21960. if (r = r || $.Deferred(),
  21961. this.dollhouseMode(),
  21962. !e)
  21963. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21964. r.resolve(!1),
  21965. r;
  21966. t = t || e.position;
  21967. var o = i || this.cameraControls.activeControl.camera.quaternion
  21968. , a = e.position;
  21969. return this.fitDollhouse(a, t, o),
  21970. setTimeout(function(t) {
  21971. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21972. var n = {
  21973. mode: u.PANORAMA,
  21974. pano: e,
  21975. quaternion: i,
  21976. callback: function() {
  21977. this.emit(w.FlyinFinished),
  21978. r.resolve(!0)
  21979. }
  21980. .bind(this)
  21981. };
  21982. this.flyToNewMode(n)
  21983. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21984. r
  21985. }
  21986. ,
  21987. n.prototype.checkAndWaitForPanoLoad = function() {
  21988. var e = {}
  21989. , t = {}
  21990. , i = 5e3
  21991. , n = function() {
  21992. for (var n in e)
  21993. if (e.hasOwnProperty(n) && e[n]) {
  21994. var r = performance.now() - t[n];
  21995. if (r < i)
  21996. return !0
  21997. }
  21998. return !1
  21999. };
  22000. return function(r, o, a, s, l, c, h, u, d, p) {
  22001. if (n())
  22002. return !0;
  22003. var f = function(t, i, n) {
  22004. N.delayOneFrame(function() {
  22005. e[t] = !1,
  22006. l && l(i, n)
  22007. }
  22008. .bind(this))
  22009. }
  22010. .bind(this, r.id)
  22011. , g = function(t, i) {
  22012. N.delayOneFrame(function() {
  22013. e[t] = !1,
  22014. c && c(i)
  22015. }
  22016. .bind(this))
  22017. }
  22018. .bind(this, r.id);
  22019. try {
  22020. return null !== u && void 0 !== u || (u = !0),
  22021. 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),
  22022. e[r.id] && (t[r.id] = performance.now()),
  22023. e[r.id]
  22024. } catch (n) {
  22025. throw e[r.id] = !1,
  22026. t[r.id] = performance.now() - i,
  22027. n
  22028. }
  22029. }
  22030. }(),
  22031. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22032. if (!e)
  22033. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22034. return r && this.model.waitForLoad(e, function() {
  22035. return e.isLoaded(i)
  22036. }),
  22037. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22038. !0)
  22039. }
  22040. ,
  22041. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22042. var e = new r.Vector3;
  22043. return function(t, i, n, r, o, a, s, l) {
  22044. if (!t)
  22045. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22046. return e.copy(d.FORWARD),
  22047. this.getDirection(e),
  22048. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22049. return t.isLoaded(i)
  22050. }),
  22051. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22052. n && n(e, t)
  22053. }
  22054. .bind(this)).fail(function(e) {
  22055. r && r(e)
  22056. }
  22057. .bind(this)).progress(function(e, t, i) {
  22058. o && o(e, t, i)
  22059. }
  22060. .bind(this)),
  22061. !0)
  22062. }
  22063. }(),
  22064. n.prototype.switchCameraMode = function(e, t) {
  22065. var i = this.cameraControls.controls[e]
  22066. , n = i.camera;
  22067. switch (e) {
  22068. case u.PANORAMA:
  22069. n.position.copy(this.currentPano.position);
  22070. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22071. i.lookAt(o.add(n.position));
  22072. break;
  22073. case u.DOLLHOUSE:
  22074. /* var a = this.position.clone();
  22075. 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),
  22076. n.position.copy(a),
  22077. i.target.copy(this.target.clone().setY(this.model.center.y));
  22078. break; */
  22079. //for多楼层 且 让模型刚好适应屏幕
  22080. var box = this.model.boundingBox.clone();
  22081. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22082. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22083. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22084. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22085. console.log(boxSize.x,distance, boxSize.length() / 2)
  22086. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22087. if(this.mode === u.PANORAMA){
  22088. i.target.copy(this.model.center);
  22089. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22090. }else{
  22091. i.target.copy(this.target.clone().setY(this.model.center.y))
  22092. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22093. }
  22094. vec.multiplyScalar(distance )
  22095. n.position.copy(i.target.clone().add(vec))
  22096. break
  22097. case u.FLOORPLAN:
  22098. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22099. i.target.copy(this.model.center).setY(0),
  22100. i.zoomToContain(this.model.size),
  22101. i.rotateToView(this.model.size, this.getDirection())
  22102. }
  22103. i.update(0)
  22104. }
  22105. ,
  22106. n.prototype.update = function() {
  22107. var e = (new r.Vector3,
  22108. {})
  22109. , t = [];
  22110. return function(i) {
  22111. this.updatePersistentZooming(i),
  22112. this.updateFromControls(i),
  22113. this.getCurrentNodePanos(t)
  22114. if(this.hasChanged(e) ) {
  22115. this.lastChangeTime = Date.now(),
  22116. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22117. this.emit(w.ViewChanged),
  22118. this.intersectHot && this.intersectHot.showTitle()
  22119. }
  22120. if(e.cameraChanged){
  22121. //this.controlVideosPlay()
  22122. for(var i in this.model.hots){
  22123. this.model.hots[i].update(this.camera)
  22124. }
  22125. if(this.mode == 'panorama')this.overlayGroup.children.forEach(overlay=>{
  22126. if(overlay.overlayType == "video"){
  22127. if(overlay.visible && overlay.inSight()){
  22128. overlay.videoControl(true)
  22129. }else{
  22130. overlay.videoControl(false)
  22131. }
  22132. }else if(this.animateInfo){
  22133. if(this.visible && this.inSight()){
  22134. GifTexDeal.start(this.animation)
  22135. }else{
  22136. GifTexDeal.stop(this.animation)
  22137. }
  22138. }
  22139. })
  22140. }
  22141. this.model.supportsTiles && (this.updateTileDownloader(t),
  22142. this.updatePanoRenderer(t)),
  22143. this.updatePreRendering(t),
  22144. this.reticule.update(),
  22145. this.path.update(),
  22146. this.spider.update(),
  22147. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22148. this.updateControlLocks(),
  22149. this.model.supportsTiles && this.updateZoomPano()
  22150. }
  22151. }(),
  22152. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22153. var lastMode, lastPano;
  22154. return function(){
  22155. var mode = this.mode;
  22156. var pano = mode == "panorama" ? this.currentPano : "";
  22157. if(mode != "panorama" || pano != lastPano){
  22158. overlay.noBlock = null
  22159. }
  22160. this.overlayGroup.children.forEach((overlay)=>{
  22161. if(overlay.overlayType == "video" ){
  22162. var matrix = overlay.plane.matrixWorld;
  22163. var inSight = false;
  22164. var cameraDir = this.getDirection();
  22165. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22166. var vertexes = []
  22167. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22168. for(let i=0; i<4; i++){
  22169. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22170. vertexes.push(vertex)
  22171. if(overlay.noBlock == null){
  22172. if(!m.ifShelter(vertex)){
  22173. overlay.noBlock = true
  22174. }
  22175. inSight = true; break;
  22176. }else{
  22177. overlay.noBlock = true
  22178. }
  22179. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22180. inSight = true; break;
  22181. }
  22182. }
  22183. }
  22184. overlay.inSight = inSight
  22185. if(!inSight)overlay.plane.material.map.image.pause()
  22186. else overlay.plane.material.map.image.play()//maybe fail
  22187. }
  22188. })
  22189. lastMode = mode, lastPano = pano
  22190. }
  22191. }() */
  22192. n.prototype.updatePersistentZooming = function(e) {
  22193. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22194. }
  22195. ,
  22196. n.prototype.updateControlLocks = function() {
  22197. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22198. }
  22199. ,
  22200. n.prototype.updatePanoRenderer = function() {
  22201. var e = new r.Vector3;
  22202. return function(t) {
  22203. var i = this.nextPano || this.currentPano;
  22204. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22205. this.getDirection(e),
  22206. this.panoRenderer.updateDirection(e))
  22207. }
  22208. }(),
  22209. n.prototype.cleanupInactivePanos = function() {
  22210. var e = []
  22211. , t = [];
  22212. return function() {
  22213. e.length = 0,
  22214. e.push(this.currentPano),
  22215. this.nextPano && e.push(this.nextPano),
  22216. t.length = 0;
  22217. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22218. t.push(this.panoRenderer.activePanos[i]);
  22219. for (var n = 0; n < t.length; n++) {
  22220. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22221. r.id === e[a].id && (o = !1);
  22222. o && r.exit()
  22223. }
  22224. }
  22225. }(),
  22226. n.prototype.updatePreRendering = function() {
  22227. var e = {};
  22228. return function(t) {
  22229. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22230. var i = this.nextPano || this.currentPano;
  22231. if (i && t && t.length > 1) {
  22232. var n = t.findIndex(function(e) {
  22233. if (e.id === i.id)
  22234. return !0
  22235. });
  22236. if (n >= 0 && n + 1 < t.length) {
  22237. var r = t[n + 1];
  22238. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22239. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22240. window.setTimeout(function(t) {
  22241. e[t.id] = !1
  22242. }
  22243. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22244. }
  22245. .bind(this, r), f.tiling.panoPreRenderDelay),
  22246. e[r.id] = !0)
  22247. }
  22248. }
  22249. }
  22250. }
  22251. }(),
  22252. n.prototype.enablePreRendering = function() {
  22253. this.preRenderingEnabled = !0
  22254. }
  22255. ,
  22256. n.prototype.disablePreRendering = function() {
  22257. this.preRenderingEnabled = !1,
  22258. this.cleanupInactivePanos()
  22259. }
  22260. ,
  22261. n.prototype.updateTileDownloader = function() {
  22262. var e = new r.Vector3;
  22263. return function(t) {
  22264. var i = this.nextPano || this.currentPano;
  22265. i && (e.copy(d.FORWARD),
  22266. this.getDirection(e),
  22267. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22268. this.tileDownloader.processPriorityQueue = !0)
  22269. }
  22270. }(),
  22271. n.prototype.updateFromControls = function(e) {
  22272. null !== e && void 0 !== e || (e = 0),
  22273. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22274. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22275. this.position.copy(this.cameraControls.activeControl.camera.position),
  22276. this.target.copy(this.cameraControls.activeControl.target),
  22277. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22278. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22279. this.camera.position.copy(this.position),
  22280. this.camera.quaternion.copy(this.quaternion),
  22281. this.camera.updateMatrix(),
  22282. this.camera.updateMatrixWorld()
  22283. }
  22284. ,
  22285. n.prototype.hasChanged = function(e) {
  22286. /* if (!this.previousState)
  22287. return this.previousState = {
  22288. allFloorsVisible: this.model.allFloorsVisible,
  22289. position: this.position.clone(),
  22290. quaternion: this.quaternion.clone(),
  22291. mouse: this.mouse.clone(),
  22292. labelScaleFactor: this.getLabelScaleFactor(),
  22293. currentFloor: this.model.currentFloor,
  22294. projectionMatrix: this.camera.projectionMatrix.clone(),
  22295. worldMatrix: this.camera.matrixWorld.clone(),
  22296. mode: this.mode,
  22297. modelPosition: this.model.position.clone(),
  22298. modelCenter: this.model.center.clone(),
  22299. zoomLevel: this.zoomLevel
  22300. },
  22301. !0;
  22302. 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;
  22303. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22304. e.moved = !this.position.equals(this.previousState.position),
  22305. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22306. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22307. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22308. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22309. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22310. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22311. e.modeChanged = this.mode !== this.previousState.mode,
  22312. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22313. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22314. e.nextPanoActive = null !== this.nextPano,
  22315. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22316. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22317. this.previousState.position.copy(this.position),
  22318. this.previousState.quaternion.copy(this.quaternion),
  22319. this.previousState.mouse.copy(this.mouse),
  22320. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22321. this.previousState.currentFloor = this.model.currentFloor,
  22322. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22323. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22324. this.previousState.mode = this.mode,
  22325. this.previousState.modelPosition.copy(this.model.position),
  22326. this.previousState.modelCenter.copy(this.model.center),
  22327. this.previousState.zoomLevel = this.zoomLevel,
  22328. !t */
  22329. if (!this.previousState)
  22330. {
  22331. this.previousState = {
  22332. allFloorsVisible: this.model.allFloorsVisible,
  22333. position: this.position.clone(),
  22334. quaternion: this.quaternion.clone(),
  22335. mouse: this.mouse.clone(),
  22336. //labelScaleFactor: this.getLabelScaleFactor(),
  22337. currentFloor: this.model.currentFloor,
  22338. projectionMatrix: this.camera.projectionMatrix.clone(),
  22339. worldMatrix: this.camera.matrixWorld.clone(),
  22340. mode: this.mode,
  22341. modelPosition: this.model.position.clone(),
  22342. modelCenter: this.model.center.clone(),
  22343. zoomLevel: this.zoomLevel
  22344. };
  22345. return !0;
  22346. }
  22347. //许钟文改 分成相机是否改变cameraChanged 和其他
  22348. 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)
  22349. 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 ;
  22350. e.cameraChanged = !a;
  22351. /* if(!t){//主要判断相机是否旋转
  22352. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22353. }else e.cameraChanged2 = false */
  22354. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22355. e.moved = !this.position.equals(this.previousState.position),
  22356. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22357. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22358. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22359. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22360. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22361. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22362. e.modeChanged = this.mode !== this.previousState.mode,
  22363. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22364. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22365. e.nextPanoActive = null !== this.nextPano,
  22366. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22367. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22368. this.previousState.position.copy(this.position),
  22369. this.previousState.quaternion.copy(this.quaternion),
  22370. this.previousState.mouse.copy(this.mouse),
  22371. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22372. this.previousState.currentFloor = this.model.currentFloor,
  22373. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22374. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22375. this.previousState.mode = this.mode,
  22376. this.previousState.modelPosition.copy(this.model.position),
  22377. this.previousState.modelCenter.copy(this.model.center),
  22378. this.previousState.zoomLevel = this.zoomLevel;
  22379. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22380. return !t
  22381. }
  22382. ,
  22383. n.prototype.updateIntersect = function() {
  22384. var e = this.flying || this.isWarping()
  22385. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22386. , i = y.getById(V.LookTransition)
  22387. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22388. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22389. this.intersect = this.getMouseIntersect(); //xzw change
  22390. this.intersect && this.updateClosestPano(this.intersect),
  22391. // this.intersect && console.log(this.intersect.point),
  22392. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22393. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22394. }
  22395. ,
  22396. n.prototype.checkHotClick = function() {
  22397. if(this.intersectHot){
  22398. this.intersectHot.examine(this)
  22399. /* g_touraudio.pause();
  22400. g_bgaudio = false;
  22401. document.getElementById("bgaudio").pause();
  22402. var sWidth = document.body.scrollWidth;
  22403. var sHeight = document.body.scrollHeight;
  22404. var pop1 = document.getElementById('popup');
  22405. pop1.style.display = "block";
  22406. var myElement = document.createElement("iframe");
  22407. myElement.src = g_HotMeshes[i].hotLink;
  22408. myElement.id = "id1";
  22409. myElement.allowTransparency = "true";
  22410. myElement.style.width = "100%";
  22411. myElement.style.height = "100%";
  22412. myElement.scrolling = "no";
  22413. var element=document.getElementById("id1");
  22414. if (typeof(element)== "undefined" || element == null){
  22415. document.getElementById("popup").appendChild(myElement);
  22416. }
  22417. var oClose = document.getElementById("closepop");
  22418. oClose.onclick = function() {
  22419. pop1.style.display = "none";
  22420. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22421. $("#popup iframe:last").remove();
  22422. document.getElementById("bgaudio").play();
  22423. } */
  22424. return true;
  22425. }
  22426. },
  22427. n.prototype.getMouseDirection = function(e) {
  22428. e = e || this.mouse;
  22429. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22430. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22431. return i.sub(t).normalize()
  22432. }
  22433. ,
  22434. n.prototype.hoverOverlay = function(mesh){
  22435. if(!mesh){
  22436. this.hoveringPlane = null;
  22437. $("#player").css("cursor",this.currentCursor || "" );
  22438. }else{
  22439. var overlay = mesh.parent;
  22440. $("#player").css("cursor","pointer");
  22441. this.hoveringPlane = overlay;
  22442. return true;
  22443. }
  22444. },
  22445. n.prototype.clickOverlay = function(overlay){
  22446. if(this.openOverlay && !overlay)return;
  22447. var plane = overlay.plane;
  22448. if(overlay.overlayType == "video"){
  22449. if(plane.material.map.image.paused)plane.material.map.image.play()
  22450. else plane.material.map.image.pause();
  22451. }else if(overlay == enterObjects){//add
  22452. //window.location.href = "http://www.4dmodel.com/SuperTwo762/index.html?m=762&qust=1"
  22453. try{
  22454. window.parent.postMessage("goInside",'*')
  22455. //$("#app .aside li" , parent.document)[0].click();
  22456. }catch(e){
  22457. console.log(e)
  22458. }
  22459. }
  22460. /* if(window.EditOverlay &&EditOverlay.editing){
  22461. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22462. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22463. EditOverlay.endAddPlane();
  22464. EditOverlay.updateOverlayPanel(overlay)
  22465. EditOverlay.controlSelectOverlay(overlay)
  22466. return;
  22467. } */
  22468. },
  22469. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22470. e = e || this.mouse.clone(),
  22471. t = t || this.model.floors.reduce(function(e, t) {
  22472. return t.hidden ? e : e.concat(t.collider.children)
  22473. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22474. for(var i in this.model.hots){
  22475. t.push(this.model.hots[i].mesh);
  22476. }
  22477. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  22478. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22479. this.raycaster.set(i, this.getMouseDirection(e));
  22480. var n = this.raycaster.intersectObjects(t, true);//add true
  22481. // n[0] && console.log(n[0].point);
  22482. if(g_HotStatus=="add"){
  22483. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22484. console.log(points[0]);
  22485. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22486. }
  22487. this.intersectHot && this.intersectHot.hideTitle()
  22488. if (0 === n.length){
  22489. this.intersectHot = null; //add
  22490. if(g_HotStatus!="add") $("#player").css("cursor","");
  22491. return null;
  22492. }
  22493. var o = n[0];
  22494. if(o.object.type == "hotSprite"){ //add
  22495. this.intersectHot = o.object.belongHot;
  22496. this.intersectHot.showTitle()
  22497. this.intersectHot.actionType == 'noAction' || $("#player").css("cursor","pointer");
  22498. return;
  22499. }
  22500. this.intersectHot = null;
  22501. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22502. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22503. if (o.face) {
  22504. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22505. var a = this.position.clone().sub(o.point);
  22506. a.dot(o.normal) < 0 && o.normal.negate(),
  22507. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22508. o.horizontal = o.normal.y > .8
  22509. }
  22510. // console.log(o.point);
  22511. return o
  22512. }
  22513. ,
  22514. n.prototype.updateClosestPano = function(e) {
  22515. var t = [s.filters.isPanoAligned()];
  22516. if (this.mode === u.PANORAMA) {
  22517. if (!this.currentPano)
  22518. return;
  22519. t.push(s.filters.not(this.currentPano)),
  22520. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22521. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22522. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22523. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22524. } else{
  22525. t.push((pano)=>{ // add
  22526. return this.checkHasNeighbor(pano)
  22527. })
  22528. t.push(s.filters.isOnVisibleFloor()),
  22529. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22530. }
  22531. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22532. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22533. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22534. this.closestPano = i) : this.isPanoHover = !1
  22535. }
  22536. ,
  22537. n.prototype.dollhouseMode = function(e, t) {
  22538. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22539. this.mode = u.DOLLHOUSE,
  22540. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22541. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22542. , n = new r.Vector3(15,10,15);
  22543. if (e && t) {
  22544. var o = d.FORWARD.clone().applyQuaternion(t)
  22545. , a = this.model.center.clone().sub(e)
  22546. , s = a.dot(o);
  22547. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22548. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22549. }
  22550. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22551. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22552. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22553. this.updateFromControls(),
  22554. this.model.alpha = 1,
  22555. this.model.skybox.material.uniforms.opacity.value = 0
  22556. }
  22557. ,
  22558. n.prototype.insideMode = function(e, t) {
  22559. var i = $.Deferred()
  22560. , n = t || null;
  22561. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22562. var r = [s.filters.isPanoAligned()];
  22563. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22564. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22565. this.flyToNewMode({
  22566. mode: u.PANORAMA,
  22567. pano: e,
  22568. callback: n
  22569. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22570. } else {
  22571. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22572. i.reject(o)
  22573. }
  22574. return i.promise()
  22575. }
  22576. ,
  22577. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22578. //if(urlHasValue('oldEntry')){
  22579. //搬自一代。
  22580. var n = d.FORWARD.clone().applyQuaternion(i)
  22581. , i = n.clone().add(e);
  22582. this.cameraControls.activeControl.target.copy(i),
  22583. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  22584. //return;
  22585. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22586. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22587. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22588. this.cameraControls.activeControl.target.copy(n).add(e);
  22589. var o = d.RIGHT.clone().applyQuaternion(i)
  22590. , a = d.UP.clone()
  22591. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22592. , l = this.model.boundingBox.max.clone()
  22593. , c = this.model.boundingBox.min.clone()
  22594. , 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)]
  22595. , u = 0
  22596. , p = 0
  22597. , g = 0;
  22598. h.forEach(function(e, t, i) {
  22599. var n = Math.abs(e.dot(o))
  22600. , r = e.dot(s);
  22601. n > u && (u = n,
  22602. p = r),
  22603. r > g && (g = r)
  22604. });
  22605. 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)))
  22606. , v = s.clone().multiplyScalar(p).add(t)
  22607. , A = s.clone().multiplyScalar(g).add(t);
  22608. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22609. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22610. p = Math.max(p, 10),
  22611. g = Math.max(g, 10);
  22612. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22613. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22614. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22615. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22616. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22617. */
  22618. }
  22619. ,
  22620. n.prototype.floorplanMode = function(e, t, i) {
  22621. this.mode = u.FLOORPLAN;
  22622. var n = this.cameraControls.controls[u.FLOORPLAN];
  22623. n.reset();
  22624. var r = e ? e : this.model.center;
  22625. if (n.target.copy(r).setY(0),
  22626. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22627. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22628. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22629. t) {
  22630. var o = d.LEFT.clone().applyQuaternion(t);
  22631. n.rotateLeft(-Math.atan2(o.x, o.z))
  22632. } else
  22633. n.rotateToView(this.model.size, this.getDirection());
  22634. n.update(0)
  22635. }
  22636. ,
  22637. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22638. return e.skipWarpingCheck = !0,
  22639. this.flyToPano(e, t)
  22640. }
  22641. ,
  22642. n.prototype.updateMarkerVisi = function() {//加
  22643. if(this.mode != "panorama")return;
  22644. this.model.panos.list.forEach((pano)=>{
  22645. if(!pano.marker)return;
  22646. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22647. })
  22648. }
  22649. ,
  22650. n.prototype.updateHotVisible = function(pano){
  22651. var hots = this.model.hots;
  22652. pano = pano || this.currentPano;
  22653. for (var index in hots){
  22654. var visible;
  22655. if(this.mode != "panorama"){
  22656. visible = true;
  22657. }else{
  22658. //hots[index].mesh.material.depthTest = false;
  22659. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22660. }
  22661. hots[index].mesh.visible = visible;
  22662. }
  22663. },
  22664. n.prototype.flyToPano = function(e, t) {
  22665. var i = e.pano
  22666. , aim = e.lookAtPoint
  22667. , aimQua = e.quaternion //ADD
  22668. , o = e.duration
  22669. , a = e.aimDuration
  22670. , s = e.maxDistanceOverride
  22671. , l = e.skipWarpingCheck
  22672. , c = e.constantMoveSpeed
  22673. , h = null
  22674. , p = null
  22675. if (aim){
  22676. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22677. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22678. }
  22679. else aimQua = aimQua
  22680. var zoomLevel = e.zoomLevel || 1 //add
  22681. if(this.flying) return t && t(e)
  22682. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22683. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22684. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22685. t && t(),
  22686. !1;
  22687. if (this.updateLastView(),
  22688. this.mode !== u.PANORAMA) {
  22689. var m;
  22690. void this.flyToNewMode({
  22691. mode: u.PANORAMA,
  22692. pano: i,
  22693. duration: o,
  22694. quaternion: aimQua ,
  22695. callback: t
  22696. })
  22697. }
  22698. if (!i || (h = g.deepExtend(e),
  22699. p = function() {
  22700. N.delayOneFrame(function() {
  22701. this.flyToPano(h, t)
  22702. }
  22703. .bind(this))
  22704. }
  22705. .bind(this),
  22706. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22707. var C = function(e) {
  22708. t && t(e)
  22709. }
  22710. .bind(this);
  22711. this.currentPano || (this.currentPano = i,
  22712. this.path.placeCpm(),
  22713. this.path.fadeOutCpm(f.path.fadeOutTime),
  22714. this.spider.draw());
  22715. var I = o;
  22716. if ("number" != typeof o) {
  22717. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22718. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22719. }
  22720. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22721. zoomLevel !== this.zoomLevel)
  22722. switch (f.zoom.transitionStyle) {
  22723. case 1:
  22724. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22725. break;
  22726. case 2:
  22727. return h = g.deepExtend(e),
  22728. p = this.flyToPano.bind(this, h, t),
  22729. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22730. }
  22731. if (aimQua) {
  22732. y.cancelById(V.LookTransition),
  22733. I *= f.transition.aimSlowFactor;
  22734. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22735. , S = b.clone()
  22736. , M = new r.Vector3;
  22737. if (i === this.currentPano) {
  22738. var R = d.FORWARD.clone().applyQuaternion(b)
  22739. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22740. , O = R.angleTo(P);
  22741. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22742. void y.start(function(e) {
  22743. S.copy(b),
  22744. v.quaternion(S, aimQua)(e),
  22745. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22746. this.cameraControls.activeControl.lookAt(M)
  22747. }
  22748. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22749. }
  22750. }
  22751. if (i === this.currentPano )
  22752. return void C();
  22753. this.flying = !0;
  22754. var L = this.position.clone()
  22755. , D = this.currentPano;
  22756. F.debug("Flying to pano ", i.position),
  22757. this.emit(w.PanoChosen, this.currentPano, i),
  22758. this.emit(w.FlyingStarted, i.position, L, i, D)
  22759. //---------before fly--------------- add
  22760. this.updateHotVisible(i); //更新热点显示
  22761. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22762. Overlay.updateVisibles([this.currentPano, i])
  22763. //地标变化
  22764. if(this.model.floorLogos){
  22765. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22766. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22767. //this.model.adjustfloorLogoHeight();
  22768. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22769. this.model.floorLogos[1].visible = true;
  22770. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22771. }
  22772. //=======================================
  22773. aimQua && y.start(function(e) {
  22774. S.copy(b),
  22775. v.quaternion(S, aimQua)(e),
  22776. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22777. this.cameraControls.activeControl.lookAt(M)
  22778. }
  22779. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22780. var B = c ? null : A[f.transition.movementEasing];
  22781. this.nextPano = i,
  22782. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22783. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22784. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22785. this.flying = !1,
  22786. this.currentPano !== i && this.currentPano.exit(),
  22787. i.enter(),
  22788. this.currentPano = i,
  22789. this.nextPano = null,
  22790. this.path.placeCpm(),
  22791. this.path.fadeOutCpm(f.path.fadeOutTime),
  22792. this.spider.draw(),
  22793. this.emit(w.FlyingEnded, i.position, L, i, D),
  22794. this.updateMarkerVisi(),//add
  22795. C(e)
  22796. //add:
  22797. if(this.mode == "panorama" ){
  22798. if(this.model.floorLogos){
  22799. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22800. //this.model.adjustfloorLogoHeight()
  22801. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22802. this.model.floorLogos[1].visible = false;
  22803. }
  22804. Overlay.updateVisibles([this.currentPano])//add
  22805. }
  22806. }
  22807. .bind(this), 0, B, "camFly", V.FlyToPano)
  22808. }
  22809. }
  22810. ,
  22811. n.prototype.controlEntryOpacity = function(o){//add
  22812. if(o.entryShowing!=void 0) entryShowing = o.entryShowing
  22813. var startOpa = enterObjects.children[0].material.opacity;
  22814. var aimOpa = o.on ? 1 : entryShowing ? 0.3 : 0
  22815. if(startOpa == aimOpa)return;
  22816. y.cancelById(_entryOpacityId);
  22817. y.start((progress)=>{
  22818. var opa = startOpa * (1-progress) + aimOpa * progress
  22819. enterObjects.children.forEach(plane=>{
  22820. plane.material.opacity = opa
  22821. })
  22822. }, 1500, ()=>{//done
  22823. if(entryShowing){
  22824. this.controlEntryOpacity({on:!o.on})
  22825. }
  22826. }, 0, A[f.transition.movementEasing], null, _entryOpacityId);
  22827. }
  22828. window._transitionPosId = 9999
  22829. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22830. y.cancelById(_transitionPosId)
  22831. var begin = function(object, pos, qua, scale){
  22832. if(pos){
  22833. if(!same(object.position, pos, 0.01)){
  22834. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22835. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22836. }
  22837. if(qua && !same(object.quaternion, qua, 1e-6)){
  22838. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22839. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22840. }
  22841. if(scale && !same(object.scale, scale, 0.001)){
  22842. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22843. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22844. }
  22845. }
  22846. }
  22847. var same = function(vec1, vec2, diff){
  22848. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22849. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22850. return s
  22851. }
  22852. var sid = o.pano != void 0 ? o.pano.id : "outside";
  22853. this.overlayGroup.children.forEach(overlay=>{
  22854. if(!overlay.transformAtPanos)return
  22855. var panoData = overlay.transformAtPanos[sid]
  22856. var useCustom = !panoData
  22857. //if(overlay.usingTransformData || !useCustom){
  22858. var pos = useCustom ? overlay.posCustom : panoData.pos;
  22859. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  22860. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  22861. overlay.getScaleBySize(panoData.width , panoData.height)
  22862. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  22863. begin(overlay, pos, qua, scale )
  22864. //}
  22865. overlay.usingTransformData = !useCustom
  22866. })
  22867. for(let i in this.model.hots){//是否判断visible?
  22868. var hot = this.model.hots[i];
  22869. var panoData = hot.transformAtPanos[sid];
  22870. var useCustom = !panoData
  22871. //if(hot.usingTransformData || !useCustom){
  22872. var pos = useCustom ? hot.position : panoData.pos;
  22873. var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  22874. begin(hot.mesh, pos, qua )
  22875. //}
  22876. hot.usingTransformData = !useCustom;
  22877. }
  22878. }
  22879. window._tranOutsideFocus = 4399
  22880. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22881. console.log("focusPoint")
  22882. if(this.mode == "floorplan"){
  22883. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22884. var control = this.cameraControls.controls.floorplan;
  22885. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22886. var currentScale = control.absoluteScale;
  22887. var currentTarget = control.target.clone()
  22888. y.cancelById(window._tranOutsideFocus, true);
  22889. y.start(function(progress){
  22890. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22891. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22892. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22893. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22894. }else if(player.mode == "dollhouse"){
  22895. var control = player.cameraControls.controls.dollhouse;
  22896. var radius = o.radius || 8;
  22897. var currentTarget = control.target.clone()
  22898. var dir = control.offset.clone().normalize()
  22899. var currentRadius = control.offset.length();
  22900. y.cancelById(window._tranOutsideFocus, true);
  22901. y.start(function(progress){
  22902. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22903. let radius_ = radius*progress+currentRadius*(1-progress)
  22904. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22905. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22906. }else if(this.mode == 'panorama'){
  22907. this.flyToPano({
  22908. lookAtPoint: o.aim.clone() ,
  22909. pano: this.currentPano,
  22910. aimDuration: o.dur || 600
  22911. })
  22912. }
  22913. }
  22914. n.prototype.fastForwardActivePanoFlight = function(e) {
  22915. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  22916. y.adjustSpeed(V.FlyToPano, e),
  22917. y.adjustSpeed(V.LookTransition, e)
  22918. }
  22919. ,
  22920. n.prototype.flyToPanoClosestToMouse = function() {
  22921. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22922. this.intersect && this.updateClosestPano(this.intersect)),
  22923. this.closestPano)
  22924. return this.flyToPano({
  22925. pano: this.closestPano
  22926. });
  22927. var e = this.getMouseDirection();
  22928. this.flyDirection(e) || this.flyToPano({
  22929. pano: this.currentPano
  22930. })
  22931. }
  22932. ,
  22933. n.prototype.flyLocalDirection = function(e) {
  22934. var t = this.getDirection(e)
  22935. , i = 1 === e.z ? .4 : .75
  22936. , n = 1 === Math.abs(e.x);
  22937. return this.flyDirection(t, i, n)
  22938. }
  22939. ,
  22940. n.prototype.flyDirection = function(e, t, i) {
  22941. this.closePopup();//xzw add
  22942. var n = $.Deferred();
  22943. this.history.invalidate();
  22944. var r = this.closestPanoInDirection(e, t, i);
  22945. return r ? this.flyToPano({
  22946. pano: r
  22947. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22948. n.resolve(!1)),
  22949. n.promise()
  22950. }
  22951. ,
  22952. n.prototype.closestPanoInDirection = function(e, t, i) {
  22953. return this.rankedPanoInDirection(0, e, t, i)
  22954. }
  22955. ,
  22956. n.prototype.rankedPanoInDirection = function() {
  22957. var e = {
  22958. pano: null,
  22959. candidates: []
  22960. };
  22961. return function(t, i, n, r) {
  22962. t || (t = 0),
  22963. n = void 0 !== n ? n : .75;
  22964. var o = r ? "angle" : "direction";
  22965. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  22966. this.cachedPanoCandidates = e.candidates,
  22967. e.pano
  22968. }
  22969. }(),
  22970. n.prototype.bump = function(e) {
  22971. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22972. 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;
  22973. if (s)
  22974. t = function() {
  22975. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22976. }
  22977. .bind(this),
  22978. i = function() {
  22979. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22980. }
  22981. .bind(this);
  22982. else {
  22983. var l = this.camera.position.clone()
  22984. , c = e.clone();
  22985. this.raycaster.set(l, c);
  22986. var h = this.model.floors.reduce(function(e, t) {
  22987. return e.concat(t.collider.children)
  22988. }, [])
  22989. , d = this.raycaster.intersectObjects(h)
  22990. , p = d.length > 0 ? d[0].distance / 25 : .04
  22991. , g = l.clone().add(c.multiplyScalar(p));
  22992. t = function() {
  22993. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22994. }
  22995. .bind(this),
  22996. i = function() {
  22997. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22998. }
  22999. .bind(this)
  23000. }
  23001. n = function() {
  23002. this.flying = !1
  23003. }
  23004. .bind(this),
  23005. this.flying = !0,
  23006. t()
  23007. }
  23008. }
  23009. ,
  23010. n.prototype.changeFloor = function(e) {
  23011. if (!this.is360View(this.mode, this.currentPano))
  23012. if (this.mode === u.PANORAMA) {
  23013. var t = this.history.reversePano(e);
  23014. t && t.isAligned() ? this.flyToPano({
  23015. pano: t
  23016. }) : this.changeFloorByScore(e)
  23017. } else
  23018. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23019. }
  23020. ,
  23021. n.prototype.changeFloorByScore = function() {
  23022. var e = {
  23023. pano: null,
  23024. candidates: []
  23025. };
  23026. return function(t) {
  23027. var i = this.model.nextFloor(t);
  23028. 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),
  23029. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23030. this.history.push(t, this.currentPano),
  23031. this.flyToPano({
  23032. pano: e.pano
  23033. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23034. }
  23035. }(),
  23036. n.prototype.gotoFloor = function(e) {
  23037. var t = e - this.model.currentFloor.floorIndex;
  23038. this.changeFloor(t)
  23039. }
  23040. ,
  23041. n.prototype.getDirection = function(e) {
  23042. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23043. e.applyQuaternion(this.camera.quaternion)
  23044. }
  23045. ,
  23046. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23047. if (o = o || $.Deferred(),
  23048. this.mode === u.TRANSITIONING)
  23049. return F.warn("should not be transitioning here"),
  23050. n && n(!1),
  23051. o.reject().promise();
  23052. var a = i || !1
  23053. , s = i ? i.position : this.position
  23054. , l = this.position.clone()
  23055. , c = this.currentPano;
  23056. if (F.debug("New pose in mode " + this.mode),
  23057. !e || (retryCallback = function() {
  23058. N.delayOneFrame(function() {
  23059. this.flyToSameMode(e, t, i, n, o)
  23060. }
  23061. .bind(this))
  23062. }
  23063. .bind(this),
  23064. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23065. var h = function() {
  23066. this.emit(w.FlyingEnded, s, l, e, c),
  23067. n && n(!0)
  23068. }
  23069. .bind(this)
  23070. , d = f[this.mode]
  23071. , p = void 0 !== t ? t : d.transitionTime
  23072. , g = new r.Vector3
  23073. , C = new r.Vector3;
  23074. if (this.emit(w.FlyingStarted, s, l, e, c),
  23075. this.mode === u.PANORAMA)
  23076. F.warn("we should not be here for panorama views");
  23077. else if (this.mode === u.DOLLHOUSE)
  23078. if (a) {
  23079. var I = new r.Vector3(0,1,0);
  23080. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23081. this.model.warpDestFloors(i.floorVisibility),
  23082. C.copy(i.position);
  23083. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23084. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23085. , _ = b.intersectObjects(this.model.colliders)
  23086. , T = 3;
  23087. _.length ? (g.copy(_[0].point),
  23088. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23089. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23090. var x = (new r.Matrix4).lookAt(C, g, I)
  23091. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23092. , M = g.distanceTo(C)
  23093. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23094. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23095. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23096. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23097. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23098. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23099. this.path.burnsDir = Math.sign(L.y);
  23100. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23101. , B = new r.Vector3;
  23102. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23103. y.start(function(e, t) {
  23104. D.x = P.x + e * L.x,
  23105. D.y = P.y + e * L.y,
  23106. D.z = P.z + e * L.z;
  23107. var i = O + e * (M - O);
  23108. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23109. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23110. }
  23111. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23112. y.start(function(e, t) {
  23113. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23114. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23115. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23116. }
  23117. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23118. } else
  23119. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23120. else if (this.path.placeCpm(),
  23121. this.path.fadeInCpm(f.path.fadeInTime),
  23122. i) {
  23123. this.model.warpDestFloors(i.floorVisibility);
  23124. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23125. , k = this.cameraControls.controls[u.FLOORPLAN]
  23126. , H = k.target.clone()
  23127. , G = i.position.clone().sub(H)
  23128. , z = U.position.clone().sub(k.target)
  23129. , W = z.length()
  23130. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23131. , Y = Math.atan2(k.offset.x, k.offset.z)
  23132. , X = Math.atan2(j.x, j.z)
  23133. , Z = k.absoluteScale
  23134. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23135. y.start(function(e, t) {
  23136. k.target.copy(G).multiplyScalar(e).add(H);
  23137. var i = Y + (X - Y) * e;
  23138. k.offset.x = W * Math.sin(i),
  23139. k.offset.z = W * Math.cos(i),
  23140. U.position.copy(k.target).add(k.offset),
  23141. k.absoluteScale = Z + e * (q - Z),
  23142. k.update(),
  23143. this.quaternion.copy(U.quaternion),
  23144. this.position.copy(U.position),
  23145. this.target.copy(k.target),
  23146. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23147. }
  23148. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23149. } else
  23150. F.info("flyToSameMode() funny floorplan view? skipping");
  23151. return y.setTimeout(function(e) {
  23152. this.mode = e,
  23153. h(),
  23154. o.resolve(!0)
  23155. }
  23156. .bind(this, this.mode), p, V.FlyToSameMode),
  23157. this.mode = u.TRANSITIONING,
  23158. o.promise()
  23159. }
  23160. }
  23161. ,
  23162. n.prototype.flyToNewMode = function(e, t) {
  23163. e = e || {};
  23164. var i = e.mode
  23165. , n = e.pano
  23166. , o = e.duration
  23167. , a = e.warpDest
  23168. , s = e.callback
  23169. , l = e.force
  23170. , c = e.quaternion;
  23171. if (t = t || $.Deferred(),
  23172. this.isWarping())
  23173. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23174. s && s(!1),
  23175. t.reject("Cannot change mode during tour transition").promise();
  23176. if (this.mode === u.TRANSITIONING)
  23177. return s && s(!1),
  23178. t.reject("Cannot change mode during mode transition").promise();
  23179. if (i === this.mode)
  23180. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23181. t.promise()) : (s && s(!1),
  23182. t.reject("Already in " + i + " mode").promise());
  23183. var h = a || !1;
  23184. F.debug("Switching mode to " + i);
  23185. var d = function() {
  23186. N.delayOneFrame(function() {
  23187. this.flyToNewMode(e, t)
  23188. }
  23189. .bind(this))
  23190. }
  23191. .bind(this);
  23192. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23193. return t.promise();
  23194. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23195. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23196. this.model.waitForLoad(this.model, function() {
  23197. return this.model.meshTexturesLoaded;
  23198. }
  23199. .bind(this)),
  23200. this.model.loadMeshTextures().done(d),
  23201. t.promise();
  23202. this.history.invalidate(),
  23203. this.updateLastView();
  23204. var p = this.mode
  23205. , C = this.cameraControls.cameras[i];
  23206. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23207. var I = void 0 !== o ? o : e.transitionTime;
  23208. this.emit(w.ModeChanging, p, i, n),
  23209. n && (this.currentPano = n),
  23210. this.switchCameraMode(i, c),
  23211. y.cancelById(V.LookTransition);
  23212. //before fly---------------------
  23213. if(this.mode == "panorama"){
  23214. if(this.model.floorLogos){
  23215. this.model.floorLogos[0].visible = false;
  23216. this.model.floorLogos[1].visible = false;
  23217. }
  23218. if(i == "panorama"){
  23219. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23220. }else{
  23221. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23222. }
  23223. }
  23224. //------------------------------------
  23225. var _ = (new r.Vector3).copy(this.position);
  23226. if (i === u.PANORAMA){
  23227. this.emit(w.PanoChosen, n, n),
  23228. setTimeout(function() {
  23229. n.floor.enter(i)
  23230. }
  23231. .bind(this), I / 2),
  23232. this.path.fadeOutCpm(f.path.fadeOutTime);
  23233. if(this.model.floorLogos){
  23234. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23235. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23236. }
  23237. }else if (i === u.DOLLHOUSE) {
  23238. if (h && (this.model.stayPut = !0),
  23239. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23240. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23241. this.path.placeCpm(),
  23242. this.path.fadeInCpm(f.path.fadeInTime),
  23243. h) {
  23244. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23245. _.set(15, 10, 15);
  23246. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23247. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23248. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23249. P.length ? (T.copy(P[0].point),
  23250. _.copy(a.position),
  23251. 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),
  23252. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23253. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23254. _.add(this.model.position),
  23255. C.position.copy(_),
  23256. this.cameraControls.controls[u.DOLLHOUSE].update()
  23257. }
  23258. } else if (this.path.placeCpm(),
  23259. this.path.fadeInCpm(f.path.fadeInTime),
  23260. a) {
  23261. this.model.warpDestFloors(a.floorVisibility);
  23262. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23263. , L = this.cameraControls.controls[u.FLOORPLAN]
  23264. , D = O.position.clone().sub(L.target)
  23265. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23266. , U = Math.atan2(B.x, B.z);
  23267. L.target.copy(a.position);
  23268. var k = D.length();
  23269. L.offset.x = k * Math.sin(U),
  23270. L.offset.y = 0,
  23271. L.offset.z = k * Math.cos(U),
  23272. O.position.copy(L.target).add(L.offset);
  23273. L.target.clone().sub(C.position);
  23274. C.quaternion.copy(a.quaternion),
  23275. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23276. L.absoluteScale = L.currentScale,
  23277. L.update()
  23278. } else
  23279. this.model.currentFloor.enter(i);
  23280. var H = this.currentPano
  23281. , G = this.position.clone();
  23282. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23283. this.flying = !0,
  23284. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23285. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23286. C.controls.update()),
  23287. e.blackoutStyle = S.FADEIN,
  23288. I = f.show360Views.transitionTime,
  23289. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23290. this.mode = i,
  23291. this.path && this.path.popOutCpm(),
  23292. e.blackoutStyle = S.END,
  23293. I = f.show360Views.transitionTime,
  23294. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23295. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23296. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23297. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23298. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23299. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23300. y.setTimeout(function() {
  23301. this.flying = !1,
  23302. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23303. this.currentPano.enter(),
  23304. this.path.placeCpm(),
  23305. this.path.fadeOutCpm(f.path.fadeOutTime),
  23306. this.spider.draw()),
  23307. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23308. this.mode = i,
  23309. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23310. //add:
  23311. this.updateMarkerVisi() ;
  23312. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  23313. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23314. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23315. this.model.floorLogos[0].visible = true
  23316. )
  23317. /* if(this.mode == u.PANORAMA) updateEntryShowing()
  23318. else player.controlEntryOpacity({on:false, entryShowing:false}) */
  23319. //-------
  23320. if(this.mode == u.PANORAMA){
  23321. Overlay.updateVisibles([this.currentPano])
  23322. }else{
  23323. Overlay.updateVisibles(true)
  23324. }
  23325. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23326. t.resolve())
  23327. }
  23328. .bind(this), I, V.FlyToNewMode),
  23329. this.mode = u.TRANSITIONING,
  23330. p == "panorama" && this.updateHotVisible(),
  23331. t.promise()
  23332. }
  23333. ,
  23334. n.prototype.fade360View = function(e, t, i) {
  23335. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23336. $(this.domElement).fadeOut(.5 * e, function() {
  23337. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23338. this.model.alpha = i.modelAlpha,
  23339. this.position.copy(t.position),
  23340. this.quaternion.copy(t.quaternion),
  23341. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23342. $(this.domElement).fadeIn(.5 * e)
  23343. }
  23344. .bind(this))
  23345. }
  23346. ,
  23347. n.prototype.findDefaultViews = function() {
  23348. this.findDefaultView(this.lastInsideView, !0),
  23349. this.findDefaultView(this.last360View, !1)
  23350. }
  23351. ,
  23352. n.prototype.findDefaultView = function(e, t) {
  23353. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23354. if (e.cameraMode !== u.PANORAMA)
  23355. return !1;
  23356. var i = r.get(e.panoId);
  23357. return i && i.isAligned() === t
  23358. });
  23359. o >= 0 ? (i = r.get(n[o].panoId),
  23360. e.update({
  23361. cameraMode: u.PANORAMA,
  23362. pano: i,
  23363. position: n[o].position,
  23364. quaternion: n[o].quaternion
  23365. })) : (o = r.list.findIndex(function(e) {
  23366. return e.isAligned() === t
  23367. }),
  23368. o >= 0 ? (i = r.list[o],
  23369. e.update({
  23370. cameraMode: u.PANORAMA,
  23371. pano: i,
  23372. position: i.position
  23373. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23374. }
  23375. ,
  23376. n.prototype.updateLastView = function() {
  23377. if (this.mode === u.PANORAMA) {
  23378. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23379. e.update({
  23380. pano: this.currentPano,
  23381. position: this.position,
  23382. quaternion: this.quaternion
  23383. })
  23384. }
  23385. }
  23386. ,
  23387. n.prototype.goToLastView = function(e, t) {
  23388. var i = $.Deferred()
  23389. , n = i.resolve.bind(i)
  23390. , r = i.reject.bind(i)
  23391. , o = e ? this.lastInsideView : this.last360View;
  23392. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23393. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23394. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23395. mode: o.cameraMode,
  23396. pano: o.pano,
  23397. quaternion: o.quaternion,
  23398. callback: t
  23399. }).done(n).fail(r),
  23400. i.promise()
  23401. }
  23402. ,
  23403. n.prototype.fadeToView = function(e, t, i, n) {
  23404. var r = $.Deferred()
  23405. , o = r.resolve.bind(r)
  23406. , a = r.reject.bind(r);
  23407. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23408. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23409. a("Cannot go to illegal view"),
  23410. r.promise();
  23411. var s = (f[t.cameraMode],
  23412. function() {
  23413. $(this.domElement).fadeIn(.5 * i),
  23414. n && n(),
  23415. o()
  23416. }
  23417. .bind(this))
  23418. , l = e ? S.FADEIN : S.END;
  23419. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23420. $(this.domElement).fadeOut(.5 * i, function() {
  23421. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23422. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23423. pano: t.pano,
  23424. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23425. duration: 0
  23426. }, s) : this.flyToNewMode({
  23427. mode: t.cameraMode,
  23428. quaternion: t.quaternion,
  23429. duration: 0,
  23430. callback: s
  23431. })
  23432. }
  23433. .bind(this)),
  23434. r.promise()
  23435. }
  23436. ,
  23437. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23438. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23439. this.flying)
  23440. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23441. o && o(),
  23442. !1;
  23443. null !== e && void 0 !== e || (e = b.Show),
  23444. this.history.invalidate()
  23445. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23446. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23447. return this.emit(w.WarpStarted, a, i, n, r),
  23448. n = n || S.MIDDLE,
  23449. this.path.warpToPano(i, n, r, function() {
  23450. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23451. this.emit(w.WarpEnded, i),
  23452. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23453. o && o()
  23454. }
  23455. .bind(this)),
  23456. e === b.Hide && this.path.discardPathObject(),
  23457. !0
  23458. }
  23459. ,
  23460. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23461. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23462. s && s(),
  23463. !1)
  23464. }
  23465. ,
  23466. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23467. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23468. a && a(),
  23469. !1)
  23470. }
  23471. ,
  23472. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23473. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23474. }
  23475. ,
  23476. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23477. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23478. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23479. t && t(),
  23480. !1)
  23481. }
  23482. ,
  23483. n.prototype.aimTourCamera = function(e, t, i, n) {
  23484. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23485. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23486. }
  23487. ,
  23488. n.prototype.showPathToHeroLocation = function(e) {
  23489. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23490. }
  23491. ,
  23492. n.prototype.tourInterlude = function(e, t) {
  23493. this.history.invalidate();
  23494. this.path.discardSlow();
  23495. //xzw:
  23496. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23497. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23498. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23499. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  23500. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23501. var timeEachItem = 2000;//假设每个item飞的时间
  23502. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23503. }
  23504. rotTime = Math.max(0, rotTime)
  23505. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  23506. this.path.waitNextStep(e, function() {
  23507. t && t()
  23508. }.bind(this), rotTime)
  23509. }
  23510. ,
  23511. n.prototype.stopInterlude = function() {
  23512. this.interruptAndFastForward(null, 0)
  23513. }
  23514. ,
  23515. n.prototype.interruptAndFastForward = function(e, t) {
  23516. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23517. this.flying && this.emit(w.FlyingInterrupted),
  23518. this.path.interruptAndFastForward(e, t)
  23519. }
  23520. ,
  23521. n.prototype.setSize = function(e, t) {
  23522. var i = e / t;
  23523. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23524. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23525. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23526. for (var r in this.cameraControls.cameras) {
  23527. var o = this.cameraControls.cameras[r];
  23528. o.fov = this.baseFov * (1 / this.zoomLevel),
  23529. o.updateAspect(i)
  23530. }
  23531. }
  23532. ,
  23533. n.prototype.toJSON = function() {
  23534. var e = {};
  23535. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23536. e.camera_mode = u.toInt(this.mode),
  23537. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23538. return e.hidden ? 0 : 1
  23539. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23540. e) : e
  23541. }
  23542. ,
  23543. n.prototype.getCurrentNodePanos = function(e) {
  23544. this.model.panos.map;
  23545. if (e.length = 0, this.path.nodes){
  23546. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23547. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23548. if(this.path.nodes.length){
  23549. e.push(this.model.panos.get(this.path.nodes[0]))
  23550. }
  23551. if(this.path.nodes.length>1){
  23552. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23553. }
  23554. }else{
  23555. for (var t = 0; t < this.path.nodes.length; t++) {
  23556. var i = this.path.nodes[t];
  23557. e.push(this.model.panos.get(i))
  23558. }
  23559. }
  23560. }
  23561. }
  23562. ,
  23563. n.prototype.zoomIncrementally = function(e) {
  23564. var t = this.zoomLevel;
  23565. this.zoomTo(this.zoomLevel + e),
  23566. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23567. }
  23568. ,
  23569. n.prototype.zoomInIncrementally = function(e) {
  23570. e = e || this.defaultZoomIncrement,
  23571. this.zoomIncrementally(e)
  23572. }
  23573. ,
  23574. n.prototype.zoomOutIncrementally = function(e) {
  23575. e = e || -this.defaultZoomIncrement,
  23576. this.zoomIncrementally(e)
  23577. }
  23578. ,
  23579. n.prototype.zoomBy = function(e) {
  23580. this.zoomTo(this.zoomLevel * e)
  23581. }
  23582. ,
  23583. n.prototype.zoomIn = function() {
  23584. this.zoomBy(1 + this.zoomSpeed)
  23585. }
  23586. ,
  23587. n.prototype.zoomOut = function() {
  23588. this.zoomBy(1 - this.zoomSpeed)
  23589. }
  23590. ,
  23591. n.prototype.zoomTo = function(e, t) {
  23592. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23593. if (e < f.zoom.min && (e = f.zoom.min),
  23594. e > f.zoom.max && (e = f.zoom.max),
  23595. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23596. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23597. e === f.zoom.min && this.emit(O.ZoomMin)),
  23598. this.cameraControls.activeControl) {
  23599. var i = this.cameraControls.activeControl.camera;
  23600. this.zoomLevel = e,
  23601. i.fov = this.baseFov * (1 / this.zoomLevel),
  23602. i.updateProjectionMatrix(),
  23603. this.zoomFov = i.fov
  23604. }
  23605. }
  23606. }
  23607. ,
  23608. n.prototype.increaseZoomSpeed = function() {
  23609. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23610. }
  23611. ,
  23612. n.prototype.decreaseZoomSpeed = function() {
  23613. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23614. }
  23615. ,
  23616. n.prototype.clampZoomSpeed = function(e) {
  23617. return e < 0 ? 0 : e
  23618. }
  23619. ,
  23620. n.prototype.activatePersistentZooming = function(e) {
  23621. this.zooming = e ? 1 : -1
  23622. }
  23623. ,
  23624. n.prototype.deactivatePersistentZooming = function() {
  23625. this.zooming = 0
  23626. }
  23627. ,
  23628. n.prototype.zoomDefault = function() {
  23629. this.zoomTo(1, !0)
  23630. }
  23631. ,
  23632. window.fovTranId = 333;//add
  23633. n.prototype.smoothZoomToDefault = function(e, t) {
  23634. y.cancelById(window.fovTranId)
  23635. var i, n = this.zoomLevel,
  23636. r = function(e) {
  23637. e > 1 && (e = 1),
  23638. i = n * (1 - e) + e,
  23639. this.zoomTo(i, !0)
  23640. }.bind(this),
  23641. o = function() {
  23642. this.zoomDefault(),
  23643. t && window.setTimeout(t, 50)
  23644. }.bind(this);
  23645. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23646. }
  23647. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23648. y.cancelById(window.fovTranId)
  23649. console.log("smoothZoomFovTo "+zoomLevel)
  23650. var i,
  23651. n = this.zoomLevel,
  23652. aimLevel = zoomLevel || this.baseFov / fov
  23653. if (n == aimLevel) return
  23654. var fun = function (e) {
  23655. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23656. this.zoomTo(i, !0)
  23657. }.bind(this)
  23658. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23659. }
  23660. ,
  23661. n.prototype.updateZoomPano = function() {
  23662. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  23663. var e = this.currentPano;
  23664. if (e) {
  23665. var t = this.zoomLevel > f.zoom.activationThreshold
  23666. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23667. , n = !i && !this.isWarping()
  23668. , r = t /*&& n*/; // 允许flying状态下加载4K图
  23669. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23670. this.panoRenderer.setZoomingActive(r, e, !0);
  23671. var o = function(e, t) {
  23672. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23673. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  23674. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  23675. e.setZoomed(t)
  23676. }
  23677. .bind(this);
  23678. r && !e.zoomed ? (o(e, !0),
  23679. this.panoRenderer.enableUltraHighQualityMode(function() {
  23680. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  23681. r && o(e, !0)
  23682. }
  23683. .bind(this))) : !t && e.zoomed && o(e, !1)
  23684. }
  23685. }
  23686. },
  23687. n.prototype.checkHasNeighbor = function(pano){//add
  23688. for(var i in pano.neighbourPanos ){
  23689. if(i == pano.id)continue;
  23690. if(pano.neighbourPanos[i]){
  23691. return true;
  23692. }
  23693. }
  23694. }
  23695. ,
  23696. t.exports = n
  23697. }
  23698. ).call(this, "/js/player.js")
  23699. }
  23700. , {
  23701. "./constants": 8,
  23702. "./enum/AlignmentType": 17,
  23703. "./enum/BlackoutStyle": 18,
  23704. "./enum/ControlEvents": 21,
  23705. "./enum/Keys": 30,
  23706. "./enum/ModelManagerEvents": 33,
  23707. "./enum/PanoSizeClass": 36,
  23708. "./enum/PanoramaEvents": 37,
  23709. "./enum/PathDiscardMode": 38,
  23710. "./enum/PathDisplayMode": 39,
  23711. "./enum/PlayerEvents": 40,
  23712. "./enum/TagStates": 44,
  23713. "./enum/Vectors": 50,
  23714. "./enum/Viewmode": 51,
  23715. "./enum/WarpStyle": 52,
  23716. "./enum/ZoomEvents": 53,
  23717. "./exception/BasicException": 55,
  23718. "./model/ModelManager": 140,
  23719. "./objects/NSpider": 147,
  23720. "./objects/Panorama": 148,
  23721. "./objects/Reticule": 149,
  23722. "./objects/ShowPath": 151,
  23723. "./objects/Snapshot": 153,
  23724. "./objects/View": 154,
  23725. "./settings": 166,
  23726. "./shaders": 167,
  23727. "./tile/TileDownloader": 171,
  23728. "./tile/TilePrioritizer": 172,
  23729. "./util/ZoomStats": 179,
  23730. "./util/browser": 182,
  23731. "./util/camera": 183,
  23732. "./util/cameraLight": 184,
  23733. "./util/common": 185,
  23734. "./util/easing": 186,
  23735. "./util/history": 187,
  23736. "./util/lerp": 188,
  23737. "./util/logger": 189,
  23738. "./util/math": 190,
  23739. "./util/transitions": 195,
  23740. "hot":"hot",
  23741. "scaleImg":"scaleImg",
  23742. events: 202,
  23743. three: 217
  23744. }],
  23745. "scaleImg":[function(t, e){// xzw
  23746. var OUTPUT = e;
  23747. (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")}
  23748. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23749. 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}
  23750. return G.getImageData(0,0,s,f)}
  23751. 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}
  23752. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23753. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23754. 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}
  23755. else
  23756. 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)
  23757. 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)
  23758. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23759. 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)
  23760. 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)
  23761. W=new Float32Array(at);else
  23762. for(W=[],et=0;at>et;++et)
  23763. W[et]=0;for(b=0;w>b;b++)
  23764. 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)
  23765. 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;}
  23766. delete p,h(),J=n(W)}
  23767. 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}
  23768. if("png-src"===i||"jpeg-src"===i)
  23769. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23770. return B}
  23771. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23772. OUTPUT.exports = c;
  23773. }, {}
  23774. ],
  23775. 156: [function(e, t, i) {
  23776. (function(i) {
  23777. "use strict";
  23778. function n(e, t) {
  23779. this.model = e,
  23780. this.panos = e.panos,
  23781. this.player = t,
  23782. this.imagePanos = this.listImagePanos(),
  23783. this.retryMinimumTime = 1e4
  23784. }
  23785. var r = (e("three"),
  23786. e("./enum/Viewmode"))
  23787. , o = (e("./settings"),
  23788. e("./objects/Panorama"))
  23789. , a = e("./util/logger")
  23790. , s = new a(i);
  23791. n.prototype.start = function() {
  23792. this.loadNextPano(function(e) {
  23793. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23794. setTimeout(function() {
  23795. this.start()
  23796. }
  23797. .bind(this), 1e3))
  23798. }
  23799. .bind(this))
  23800. }
  23801. ,
  23802. n.prototype.validLoadTarget = function(e) {
  23803. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23804. }
  23805. ,
  23806. n.prototype.listImagePanos = function() {
  23807. var e = []
  23808. , t = this;
  23809. return this.model.images.forEach(function(i) {
  23810. if (i.metadata && i.metadata.scan_id) {
  23811. var n = t.model.panos.get(i.metadata.scan_id);
  23812. n && !n.isLoaded("high") && e.push(n)
  23813. }
  23814. }),
  23815. e
  23816. }
  23817. ,
  23818. n.prototype.nextNotLoadedImage = function() {
  23819. for (; this.imagePanos.length > 0; ) {
  23820. var e = this.imagePanos[0];
  23821. if (!e.isLoaded("high"))
  23822. return e;
  23823. this.imagePanos.shift()
  23824. }
  23825. return null
  23826. }
  23827. ,
  23828. n.prototype.loadNextPano = function(e) {
  23829. var t, i, n = this.model.waitQueue.filter(function(e) {
  23830. return e.object instanceof o
  23831. });
  23832. n.length > 0 ? (t = n[0].object,
  23833. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23834. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23835. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23836. t = this.imagePanos[0],
  23837. 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())]),
  23838. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23839. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23840. s.debug("Preloading " + i + "-res pano " + t.id),
  23841. t.loadCube(i).done(e).fail(function() {
  23842. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23843. e()
  23844. })) : e && e(null)
  23845. }
  23846. ,
  23847. t.exports = n
  23848. }
  23849. ).call(this, "/js/preloaders.js")
  23850. }
  23851. , {
  23852. "./enum/Viewmode": 51,
  23853. "./objects/Panorama": 148,
  23854. "./settings": 166,
  23855. "./util/logger": 189,
  23856. three: 217
  23857. }],
  23858. 157: [function(e, t, i) {
  23859. (function(i) {
  23860. "use strict";
  23861. function n(e, t, i, n, r) {
  23862. this.qualityManager = e,
  23863. this.scene = t,
  23864. this.camera = i,
  23865. this.container = r,
  23866. this.controls = n,
  23867. this.controls.enabled = !0,
  23868. this.controls.locked = !0,
  23869. this.quickstartCamera = n.camera,
  23870. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23871. this.skybox = null
  23872. }
  23873. var r = e("three")
  23874. , o = e("../util/logger")
  23875. , a = e("../constants")
  23876. , s = (e("../util/transitions"),
  23877. e("../util/lerp"),
  23878. e("../util/easing"),
  23879. e("../enum/Vectors"))
  23880. , l = e("../enum/PanoSizeClass")
  23881. , c = (e("../materials/ModelTextureMaterial"),
  23882. e("../materials/CubemapMaterial"))
  23883. , h = (e("../cameras/PanoramaCamera"),
  23884. e("../controls/PanoramaControls"),
  23885. e("../tile/TileUtils"),
  23886. e("../util/camera"),
  23887. e("../util/cameraLight"))
  23888. , u = (e("../util/browser"),
  23889. e("../settings"),
  23890. e("../gui/helpManager"),
  23891. new o(i));
  23892. n.prototype.load = function(e) {
  23893. e.pano.shouldRedrawOnBaseLoaded = !0;
  23894. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23895. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23896. var a = this.qualityManager.getPanoSize(l.BASE)
  23897. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23898. if (e.pano.tiled) {
  23899. u.warn("Loading startPano, TILED", e.pano.id);
  23900. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23901. , p = this.quickstartCamera.fov;
  23902. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23903. t = e.pano.loadTiledPano(c, r, {
  23904. hFov: d,
  23905. vFov: p
  23906. }, !1, !1, !0),
  23907. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23908. } else
  23909. u.warn("Loading startPano", e.pano.id),
  23910. t = e.pano.loadCube("high");
  23911. return $.when(t).then(function() {
  23912. n.init(e.pano, e.quaternion),
  23913. e.pano.tiled ? i.done(function() {
  23914. e.pano.lockUntilRenderingComplete = !1,
  23915. this.controls.locked = !1
  23916. }
  23917. .bind(this)) : this.controls.locked = !1
  23918. }
  23919. .bind(this))
  23920. }
  23921. ,
  23922. n.prototype.init = function(e, t) {
  23923. u.info("Quickstart done loading, adding scene objects"),
  23924. e.lockUntilRenderingComplete = !0,
  23925. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23926. side: r.BackSide
  23927. })),
  23928. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23929. this.skybox.quaternion.copy(e.quaternion),
  23930. this.scene.add(this.skybox),
  23931. $(this.container).show()
  23932. }
  23933. ,
  23934. n.prototype.update = function(e) {
  23935. this.controls.update(e),
  23936. this.camera.copy(this.quickstartCamera)
  23937. }
  23938. ,
  23939. n.prototype.setSize = function(e, t) {
  23940. this.quickstartCamera.updateAspect(e / t)
  23941. }
  23942. ,
  23943. n.prototype.destroy = function() {
  23944. this.scene.remove(this.skybox)
  23945. }
  23946. ,
  23947. t.exports = n
  23948. }
  23949. ).call(this, "/js/scene/QuickstartManager.js")
  23950. }
  23951. , {
  23952. "../cameras/PanoramaCamera": 7,
  23953. "../constants": 8,
  23954. "../controls/PanoramaControls": 13,
  23955. "../enum/PanoSizeClass": 36,
  23956. "../enum/Vectors": 50,
  23957. "../gui/helpManager": 68,
  23958. "../materials/CubemapMaterial": 117,
  23959. "../materials/ModelTextureMaterial": 118,
  23960. "../settings": 166,
  23961. "../tile/TileUtils": 174,
  23962. "../util/browser": 182,
  23963. "../util/camera": 183,
  23964. "../util/cameraLight": 184,
  23965. "../util/easing": 186,
  23966. "../util/lerp": 188,
  23967. "../util/logger": 189,
  23968. "../util/transitions": 195,
  23969. three: 217
  23970. }],
  23971. 158: [function(e, t, i) {
  23972. "use strict";
  23973. function n(e, t, i) {
  23974. this.scene = e,
  23975. this.camera = t,
  23976. this.renderer = null,
  23977. this.effects = i,
  23978. this.animateCallback = null,
  23979. this.composer = null,
  23980. this.qualityManager = null,
  23981. e.renderWidth = 0,
  23982. e.renderHeight = 0,
  23983. this.updateClock = new r.Clock,
  23984. this.components = [],
  23985. this.updateListeners = [],
  23986. this.resizeListeners = [],
  23987. this.forceUpdateSize = !1,
  23988. this.started = !1,
  23989. this.textures = {},
  23990. this.suspendedObjects = []
  23991. }
  23992. var r = e("three")
  23993. , o = e("../shaders")
  23994. , a = e("../enum/SceneRendererEvents")
  23995. , s = e("../enum/GLTextureType")
  23996. , l = e("../enum/GLCubeFaces")
  23997. , c = e("../exception/BasicException")
  23998. , h = e("../exception/RendererCreationException")
  23999. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24000. , m = e("../util/browser")
  24001. /**************************************************************************************************************************************************/
  24002. , u = e("../settings")
  24003. , d = e("events").EventEmitter;
  24004. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24005. n.prototype = Object.create(d.prototype),
  24006. n.prototype.addComponent = function(e) {
  24007. this.components.push(e),
  24008. e.update && this.updateListeners.push(e),
  24009. e.setSize && (this.resizeListeners.push(e),
  24010. this.forceUpdateSize = !0)
  24011. }
  24012. ,
  24013. n.prototype.removeComponent = function(e) {
  24014. var t = function(t) {
  24015. return t !== e
  24016. };
  24017. this.components = this.components.filter(t),
  24018. this.updateListeners = this.updateListeners.filter(t),
  24019. this.resizeListeners = this.resizeListeners.filter(t)
  24020. }
  24021. ,
  24022. n.prototype.start = function(e) {
  24023. if (this.started)
  24024. throw new c("Can't start SceneRenderer, already started");
  24025. this.createContext(e),
  24026. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24027. m.isMobile() && this.boluoVrInit(),
  24028. /*******************************************************************************************************************************/
  24029. this.initComposer(),
  24030. this.started = !0,
  24031. (p = p.bind(this))()
  24032. }
  24033. ,
  24034. n.prototype.createContext = function(e) {
  24035. try {
  24036. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:true}),//透明
  24037. this.renderer.autoClear = !0,
  24038. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24039. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24040. this.renderer.setClearColor( 0x000000, 0 ); //透明
  24041. this.emit(a.ContextCreated)
  24042. } catch (e) {
  24043. throw new h("Unable to create a WebGL rendering context")
  24044. }
  24045. u.profiling.enabled && this.overrideTextures(),
  24046. e.appendChild(this.renderer.domElement)
  24047. }
  24048. ,
  24049. n.prototype.overrideTextures = function() {
  24050. var e = this.renderer.context
  24051. , t = 0
  24052. , i = e.createTexture;
  24053. e.createTexture = function() {
  24054. var n = i.call(e);
  24055. return n.id = t++,
  24056. this.textures[n.id] = n,
  24057. n
  24058. }
  24059. .bind(this);
  24060. var n = e.texImage2D;
  24061. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24062. var d, p = this.getTextureTypeFromTarget(e, t);
  24063. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24064. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24065. h = a,
  24066. u = l,
  24067. o = u.naturalWidth,
  24068. a = u.naturalHeight,
  24069. n.call(e, t, i, r, c, h, u));
  24070. var f = this.textures[d.id];
  24071. f.width = p === s.TextureCube ? 6 * o : o,
  24072. f.height = a
  24073. }
  24074. .bind(this);
  24075. var r = e.deleteTexture;
  24076. e.deleteTexture = function(t) {
  24077. delete this.textures[t.id],
  24078. r.call(e, t)
  24079. }
  24080. .bind(this)
  24081. }
  24082. ,
  24083. n.prototype.updateTextureMemory = function() {
  24084. var e = null;
  24085. return function() {
  24086. var t = 0;
  24087. for (var i in this.textures) {
  24088. var n = this.textures[i];
  24089. n.width && n.height && (t += n.width * n.height * 4)
  24090. }
  24091. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24092. e = t
  24093. }
  24094. }(),
  24095. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24096. switch (t) {
  24097. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24098. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24099. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24100. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24101. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24102. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24103. return s.TextureCube;
  24104. case e.TEXTURE_2D:
  24105. return s.Texture2D;
  24106. default:
  24107. return null
  24108. }
  24109. }
  24110. ,
  24111. n.prototype.initComposer = function() {
  24112. this.composer = new r.EffectComposer(this.renderer),
  24113. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24114. this.composer.addPass(this.effects.hblurPass),
  24115. this.composer.addPass(this.effects.vblurPass)
  24116. }
  24117. ,
  24118. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24119. this.renderWidth = e,
  24120. this.renderHeight = t,
  24121. this.effects.aspect = e / t,
  24122. /* this.renderer.setSize(e, t), -----MP */
  24123. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24124. this.composer.setSize(e, t);
  24125. for (var i = 0; i < this.resizeListeners.length; i++)
  24126. this.resizeListeners[i].setSize(e, t)
  24127. }
  24128. ,
  24129. n.prototype.render = function() {
  24130. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24131. }
  24132. /******************************************************************************************************徐世廷**********************************************************************/
  24133. var vrPermission = {};
  24134. var vrPermissionCallBack = function(info1,info2){
  24135. if(info1 == "reset"){
  24136. vrPermission = {};
  24137. }else{
  24138. vrPermission[info1] = info2
  24139. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24140. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24141. }
  24142. }
  24143. }
  24144. n.prototype.boluoVrInit = function() {
  24145. console.log("boluoVrInit")
  24146. this.isHuawei5X = m.detectHUAWEI5X(),
  24147. this.oldRenderer = this.renderer,
  24148. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24149. window.panoCamera = this.camera;
  24150. var a = this;
  24151. window._vrEnabled = !1,
  24152. Object.defineProperty(window, "vrEnabled", {
  24153. get: function() {
  24154. return window._vrEnabled
  24155. },
  24156. set: function(b) {
  24157. b = !!b,
  24158. b ? (a.renderer = a.newRenderer,
  24159. window.vrMarkers.forEach(function(a) {
  24160. a.visible = !0
  24161. })) : (a.renderer = a.oldRenderer,
  24162. window.vrMarkers.forEach(function(a) {
  24163. a.visible = !1
  24164. })),
  24165. a.cursor.visible = b,
  24166. a.setSize(window.innerWidth, window.innerHeight),
  24167. window._vrEnabled = b
  24168. if(b){
  24169. setTimeout(function(){
  24170. console.log("orientEnable"+window.orientEnable)
  24171. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24172. if(m.detectIOS()/* && m.detectSafari() */){
  24173. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24174. console.log("开始获取权限 major"+b.major)
  24175. if(b.major == 12 && b.minor>=2){
  24176. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24177. else{//app??
  24178. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24179. }
  24180. }else if(b.major >= 13){
  24181. if(!window.location.href.includes("https://")){
  24182. console.log("需要https");
  24183. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24184. return;
  24185. }
  24186. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24187. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24188. if(!window.vrEnabled || window.orientEnable)return;
  24189. vrPermissionCallBack("reset")
  24190. console.log(window.DeviceMotionEvent)
  24191. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24192. console.log("开始获取权限1")
  24193. ///注意:需要https 本地服务器permissionState会得到denied
  24194. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24195. console.log("permissionState1: "+permissionState)
  24196. vrPermissionCallBack("deviceMotion", permissionState)
  24197. }).catch(function(e){
  24198. vrPermissionCallBack("deviceMotion", false)
  24199. console.log(e)
  24200. })
  24201. }else{
  24202. console.log("window.DeviceMotionEvent undefined")
  24203. vrPermissionCallBack("deviceMotion", false)
  24204. }
  24205. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24206. console.log("开始获取权限2")
  24207. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24208. console.log("permissionState2: "+permissionState)
  24209. vrPermissionCallBack("deviceOrientation", permissionState)
  24210. }).catch(function(e){
  24211. vrPermissionCallBack("deviceOrientation", false)
  24212. console.log(e)
  24213. })
  24214. }else{
  24215. console.log("window.DeviceOrientationEvent undefined")
  24216. vrPermissionCallBack("deviceOrientation", false)
  24217. }
  24218. },hasFailed ? 0 : 150)
  24219. /* /* setTimeout(function(){
  24220. if(settings.vrEnabled && !window.orientEnable){
  24221. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24222. }
  24223. },4000) */
  24224. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24225. }else{
  24226. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24227. }
  24228. }else{
  24229. //已经触发了
  24230. }
  24231. },200);
  24232. }
  24233. }
  24234. }),
  24235. this.createCursor(.5, !1, 1, 16777215, 0);
  24236. var b = {
  24237. setSize: function(b, c) {
  24238. a.camera.aspect = b / c
  24239. }
  24240. };
  24241. this.resizeListeners.push(b),
  24242. this.vrLoadingInit()
  24243. }
  24244. ,
  24245. n.prototype.vrLoadingInit = function() {
  24246. var a = function(camera) {
  24247. var a = this
  24248. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24249. , c = new r.MeshBasicMaterial({
  24250. color: 4967932,
  24251. side: r.DoubleSide
  24252. })
  24253. , d = new r.Mesh(b,c);
  24254. this.mesh = d,
  24255. d.position.z = -2,
  24256. d.scale.set(.08, .08, .08),
  24257. d.visible = !1,
  24258. camera.add(d),
  24259. //window.player.camera.add(d),
  24260. a.enabled = !1,
  24261. this.update = function(b) {
  24262. 1 == a.enabled && (d.rotation.z += 15 * b)
  24263. }
  24264. }
  24265. , a = new a(this.camera);
  24266. window.Loading = a,
  24267. this.updateListeners.push(a)
  24268. }
  24269. ,
  24270. n.prototype.createCursor = function(a, b, c, d, e) {
  24271. var g, h = new r.SpriteMaterial({
  24272. opacity: c,
  24273. color: d,
  24274. transparent: b,
  24275. map: this.boluoGetTexture("images/cursor.png"),
  24276. needsUpdate: !0,
  24277. side: r.DoubleSide
  24278. });
  24279. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24280. h.map.repeat = new r.Vector2(1 / 17,1),
  24281. h.depthTest = !1,
  24282. h.blending = r.AdditiveBlending,
  24283. g = new r.Sprite(h),
  24284. // g.scale.set(a, a, a),
  24285. g.scale.set(.3,.3,.3)
  24286. g.position.z = -2,
  24287. g.visible = !1,
  24288. g.name = "cursor",
  24289. this.camera.add(g),
  24290. this.scene.add(this.camera),
  24291. this.cursor = g;
  24292. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24293. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24294. this.updateListeners.push(i)
  24295. }
  24296. ,
  24297. window.orientEnable = 0; //是否能触发deviceorientation
  24298. n.prototype.CursorAnimation = function(a, b, c) {
  24299. function d() {
  24300. g.orient = r.Math.degToRad(window.orientation || 0)
  24301. }
  24302. function e(a) {
  24303. if(!window.vrEnabled && window.orientEnable) return;
  24304. window.orientEnable || (window.orientEnable = 1);
  24305. var b = r.Math.degToRad(a.alpha)
  24306. , c = r.Math.degToRad(a.beta)
  24307. , d = r.Math.degToRad(a.gamma);
  24308. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24309. -1e3 === g.beta && (g.beta = c),
  24310. -1e3 === g.gamma && (g.gamma = d),
  24311. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24312. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24313. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24314. g.beta = c,
  24315. g.gamma = d),
  24316. n.vrDebug) {
  24317. $("#info-device-orientation").css("display", "block");
  24318. var e = "";
  24319. e += "alpha=(" + g.alpha + ")<BR/>",
  24320. e += "beta=(" + g.beta + ")<BR/>",
  24321. e += "gamma=" + g.gamma + "<BR/>",
  24322. document.getElementById("info-device-orientation").innerHTML = e
  24323. }
  24324. }
  24325. this.cursor = b,
  24326. this.raycaster = new r.Raycaster,
  24327. this.targetEventObj = {},
  24328. this.type = 1,
  24329. this.tweenFlag = !0;
  24330. var g = this;
  24331. this.target = c,
  24332. console.log(c.uuid),
  24333. this.euler = new r.Euler,
  24334. this.q0 = new r.Quaternion,
  24335. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24336. this.zee = new r.Vector3(0,0,1),
  24337. this.alpha = -1e3,
  24338. this.beta = -1e3,
  24339. this.gamma = -1e3,
  24340. this.orient = r.Math.degToRad(window.orientation || 0),
  24341. window.addEventListener("orientationchange", d),
  24342. window.addEventListener("deviceorientation", e),
  24343. this.setObjectQuaternion = function(a, b, d, e, f) {
  24344. g.euler.set(d, b, -e, "YXZ"),
  24345. a.setFromEuler(g.euler),
  24346. a.multiply(g.q1),
  24347. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24348. c.updateMatrixWorld()
  24349. }
  24350. ,
  24351. parent !== window && window.addEventListener("message", function(a) {
  24352. var b = JSON.parse(a.data)
  24353. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24354. b && b.alpha && b.beta && b.gamma && function(a) {
  24355. var c = r.Math.degToRad(b.alpha)
  24356. , d = r.Math.degToRad(b.beta)
  24357. , e = r.Math.degToRad(b.gamma);
  24358. a ? (-1e3 === g.alpha && (g.alpha = c),
  24359. -1e3 === g.beta && (g.beta = d),
  24360. -1e3 === g.gamma && (g.gamma = e),
  24361. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24362. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24363. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24364. g.beta = d,
  24365. g.gamma = e)
  24366. }(c)
  24367. }),
  24368. this.update = function(a) {
  24369. TWEEN.update();
  24370. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24371. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24372. this.triggerTargetEvent())
  24373. }
  24374. ,
  24375. this.triggerTargetEvent = function() {
  24376. var a = this.choseObj()
  24377. , b = a ? a.object : void 0;
  24378. this.targetEventObj.currentObj = b,
  24379. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24380. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24381. b && b.enabled && this.startAnimate(function() {
  24382. this.clickCallback(b)
  24383. }
  24384. .bind(this))) : this.type,
  24385. this.targetEventObj.lastObj = b)
  24386. }
  24387. ,
  24388. this.choseObj = function() {
  24389. this.raycaster.setFromCamera({
  24390. x: 0,
  24391. y: 0
  24392. }, c);
  24393. var a = (this.raycaster.ray,
  24394. window.vrMarkers)
  24395. , b = this.raycaster.intersectObjects(a);
  24396. if (b.length > 0)
  24397. return b[0]
  24398. }
  24399. ,
  24400. this.clickCallback = function(a) {
  24401. this.runTHREEAction(a, "onclick")
  24402. }
  24403. ,
  24404. this.runTHREEAction = function(a, b) {
  24405. switch (b) {
  24406. case "onclick":
  24407. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24408. a()
  24409. });
  24410. break;
  24411. case "onhover":
  24412. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24413. a()
  24414. });
  24415. break;
  24416. case "onout":
  24417. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24418. a()
  24419. })
  24420. }
  24421. }
  24422. ,
  24423. this.startAnimate = function(a) {
  24424. this.tweenFlag && this.initAnimation(a)
  24425. }
  24426. ,
  24427. this.initAnimation = function(a) {
  24428. var b = this
  24429. , c = this.cursor.material.map.offset
  24430. , d = function(a) {
  24431. return Math.floor(17 * a) / 17
  24432. };
  24433. b.tweenFlag = !1,
  24434. this.cursorAnimate = new TWEEN.Tween(c).to({
  24435. x: 1
  24436. }, 1e3).onStart(function() {
  24437. b.tweenFlag = !1
  24438. }).onStop(function() {
  24439. b.tweenFlag = !0,
  24440. this.x = 0,
  24441. c.x = 0
  24442. }).onUpdate(function() {}).onComplete(function() {
  24443. a(),
  24444. c.x = 0,
  24445. setTimeout(function() {
  24446. b.tweenFlag = !0
  24447. }, 1500)
  24448. }),
  24449. this.cursorAnimate.easing(d),
  24450. this.cursorAnimate.start()
  24451. }
  24452. ,
  24453. this.autoCursorPosition = function(a) {
  24454. // var b = Math.abs(a.distance - 10);
  24455. // this.cursor.position.z = -b,
  24456. // b /= 10;
  24457. // alert(b);
  24458. // this.cursor.scale.set(b, b, b)
  24459. this.cursor.scale.set(.3,.3,.3)
  24460. }
  24461. }
  24462. ,
  24463. n.prototype.vrRenderer = function(a, b, c) {
  24464. var d = new b.vrCamera(c);
  24465. d.bananaAspect = .8,
  24466. this.width,
  24467. this.height;
  24468. var b = this;
  24469. this.setSize = function(c, d) {
  24470. a.setSize.call(this, c, d),
  24471. b.width = c,
  24472. b.height = d
  24473. }
  24474. ,
  24475. this.render = function(b, c, e, f) {
  24476. window.cameraQua = c.quaternion.clone();
  24477. var g, h;
  24478. if (c.__RESS__SKIP__STEREO__)
  24479. return a.render(b, c, e, f);
  24480. if ("PerspectiveCamera" === c.type)
  24481. g = d.cameraL,
  24482. h = d.cameraR,
  24483. b.updateMatrixWorld(),
  24484. null === c.parent && c.updateMatrixWorld(),
  24485. d.vrCameraUpdate(c);
  24486. else {
  24487. if ("OrthographicCamera" !== c.type)
  24488. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24489. g = h = c
  24490. }
  24491. a.setScissorTest(!0),
  24492. a.setScissor(0, 0, this.width / 2, this.height),
  24493. a.setViewport(0, 0, this.width / 2, this.height),
  24494. a.render.call(this, b, g, e, f),
  24495. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24496. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24497. a.render.call(this, b, h, e, f),
  24498. a.setScissorTest(!1)
  24499. }
  24500. ,
  24501. this.__proto__ = {
  24502. __proto__: a
  24503. }
  24504. }
  24505. ,
  24506. n.prototype.vrCamera = function(a) {
  24507. this.type = "StereoCamera",
  24508. this._aspect = 1,
  24509. this._overlap = .064,
  24510. this.cameraL = new r.PerspectiveCamera,
  24511. this.cameraL.layers.enable(1),
  24512. this.cameraL.near = 0.01,//xzw add
  24513. this.cameraL.matrixAutoUpdate = !1,
  24514. this.cameraR = new r.PerspectiveCamera,
  24515. this.cameraR.layers.enable(2),
  24516. this.cameraR.near = 0.01,//xzw add
  24517. this.cameraR.matrixAutoUpdate = !1,
  24518. this.eyeRight = new r.Matrix4,
  24519. this.eyeLeft = new r.Matrix4,
  24520. this.vrCameraNeedsUpdate = !0,
  24521. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24522. Object.defineProperty(this, "bananaAspect", {
  24523. get: function() {
  24524. return this._aspect
  24525. },
  24526. set: function(a) {
  24527. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24528. this._aspect = a
  24529. }
  24530. }),
  24531. Object.defineProperty(this, "overlap", {
  24532. get: function() {
  24533. return this._overlap
  24534. },
  24535. set: function(a) {
  24536. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24537. this._overlap = a
  24538. }
  24539. }),
  24540. this.vrCameraUpdate = function(a) {
  24541. this.vrCameraNeedsUpdate = true;
  24542. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24543. this.vrCameraNeedsUpdate) {
  24544. this.vrCameraNeedsUpdate = !1,
  24545. //console.debug("vrCameraUpdate"),
  24546. this.bananaFocus = a.focus,
  24547. this.bananaFov = a.fov,
  24548. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24549. this.bananaNear = a.near,
  24550. this.bananaFar = a.far,
  24551. //console.debug(a.aspect),
  24552. this.bananaFocus = 10;
  24553. 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);
  24554. this.eyeLeft.elements[12] = -e,
  24555. this.eyeRight.elements[12] = e,
  24556. b = -g * this.bananaReal_aspect + f,
  24557. c = g * this.bananaReal_aspect + f,
  24558. d.elements[0] = 2 * this.bananaNear / (c - b),
  24559. d.elements[8] = (c + b) / (c - b),
  24560. this.cameraL.projectionMatrix.copy(d),
  24561. b = -g * this.bananaReal_aspect - f,
  24562. c = g * this.bananaReal_aspect - f,
  24563. d.elements[0] = 2 * this.bananaNear / (c - b),
  24564. d.elements[8] = (c + b) / (c - b),
  24565. this.cameraR.projectionMatrix.copy(d)
  24566. }
  24567. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24568. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24569. }
  24570. }
  24571. ,
  24572. n.prototype.boluoGetTexture = function(a) {
  24573. var b = new r.TextureLoader;
  24574. return b.crossOrigin = "anonymous",
  24575. b.load(a)
  24576. }
  24577. ,
  24578. /***********************************************************************************************************************************************************************************/
  24579. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24580. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24581. return function(o){
  24582. var render = false;
  24583. var ratio;
  24584. var w, h; //记录应当render的大小
  24585. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24586. w = o.width, h = o.height, render = true, ratio=1;
  24587. }else{
  24588. w = $('#player').width();
  24589. h = $('#player').height();
  24590. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24591. (w !== W || h !== H || this.forceUpdateSize) &&
  24592. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24593. }
  24594. if(render){
  24595. this.setSize(w, h, ratio);
  24596. this.forceUpdateSize = !1
  24597. }
  24598. }
  24599. }()
  24600. ,
  24601. n.prototype.updateComponents = function() {
  24602. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24603. this.updateListeners[t].update(e)
  24604. }
  24605. ,
  24606. n.prototype.suspend = function() {
  24607. this.started = !1,
  24608. this.suspendedObjects = this.scene.children.map(function(e) {
  24609. return this.scene.remove(e),
  24610. e
  24611. }
  24612. .bind(this)),
  24613. this.render()
  24614. }
  24615. ,
  24616. n.prototype.resume = function() {
  24617. this.suspendedObjects.forEach(function(e) {
  24618. this.scene.add(e)
  24619. }
  24620. .bind(this)),
  24621. this.suspendedObjects = [],
  24622. this.started = !0,
  24623. p()
  24624. }
  24625. ;
  24626. var p = function() {
  24627. this.started && (window.requestAnimationFrame(p),
  24628. this.updateScreenSize(), // fyz resize
  24629. this.updateComponents(),
  24630. this.updateTextureMemory(),
  24631. this.render(),
  24632. this.emit(a.AfterRender))
  24633. };
  24634. n.prototype.getImageData = function() {
  24635. var e = document.createElement("canvas")
  24636. , t = e.getContext("2d");
  24637. return function(i, n, r) {
  24638. return e.width === n && e.height === r || (e.width = n,
  24639. e.height = r),
  24640. t.drawImage(i, 0, 0, n, r),
  24641. t.getImageData(0, 0, n, r)
  24642. }
  24643. }(),
  24644. n.prototype.initSizedTexture2D = function(e, t, i) {
  24645. var n = this.renderer
  24646. , o = n.context
  24647. , a = n.state
  24648. , s = new r.Texture(null);
  24649. s.flipY = !1,
  24650. i !== !0 && (i = !1),
  24651. s.generateMipmaps = i;
  24652. var l = n.paramThreeToGL(s.format)
  24653. , c = n.paramThreeToGL(s.type)
  24654. , h = n.properties.get(s)
  24655. , u = o.createTexture();
  24656. a.bindTexture(o.TEXTURE_2D, u),
  24657. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24658. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24659. s.wrapS = t,
  24660. s.wrapT = t;
  24661. var d = n.paramThreeToGL(t);
  24662. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24663. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24664. i ? (s.magFilter = r.LinearFilter,
  24665. s.minFilter = r.LinearMipMapLinearFilter,
  24666. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24667. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24668. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24669. s.minFilter = r.LinearFilter,
  24670. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24671. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24672. a.bindTexture(o.TEXTURE_2D, null),
  24673. h.__webglTexture = u,
  24674. s
  24675. }
  24676. ,
  24677. n.prototype.initSizedCubeMap = function(e, t) {
  24678. var i = this.renderer
  24679. , n = i.context
  24680. , o = i.state
  24681. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24682. a.flipY = !1,
  24683. a.generateMipmaps = t;
  24684. var s = i.paramThreeToGL(a.format)
  24685. , l = i.paramThreeToGL(a.type)
  24686. , c = i.properties.get(a)
  24687. , h = n.createTexture();
  24688. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24689. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24690. for (var u = 0; u < 6; u++)
  24691. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24692. return t ? (a.magFilter = r.LinearFilter,
  24693. a.minFilter = r.LinearMipMapLinearFilter,
  24694. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24695. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24696. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24697. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24698. a.minFilter = r.LinearFilter,
  24699. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24700. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24701. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24702. c.__image__webglTextureCube = h,
  24703. a
  24704. }
  24705. ,
  24706. n.prototype.deallocateCubeTexture = function(e) {
  24707. var t = this.renderer
  24708. , i = t.context
  24709. , n = t.properties.get(e);
  24710. i.deleteTexture(n.__image__webglTextureCube)
  24711. }
  24712. ,
  24713. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24714. var a = this.renderer
  24715. , s = a.context
  24716. , l = a.state
  24717. , c = a.properties.get(t);
  24718. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24719. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24720. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24721. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24722. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24723. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24724. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24725. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24726. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24727. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24728. l.bindTexture(s.TEXTURE_2D, null)
  24729. }
  24730. ,
  24731. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24732. var s = this.renderer
  24733. , l = s.context
  24734. , c = s.state
  24735. , h = s.properties.get(t);
  24736. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24737. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24738. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24739. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24740. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24741. }
  24742. ,
  24743. n.prototype.rebuildMipMaps2D = function(e) {
  24744. var t = this.renderer
  24745. , i = t.context
  24746. , n = t.state;
  24747. t.properties.get(e);
  24748. i.generateMipmap(i.TEXTURE_2D),
  24749. n.bindTexture(i.TEXTURE_2D, null)
  24750. }
  24751. ,
  24752. n.prototype.rebuildMipMaps3D = function(e) {
  24753. var t = this.renderer
  24754. , i = t.context
  24755. , n = t.state
  24756. , r = t.properties.get(e);
  24757. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24758. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24759. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24760. }
  24761. ,
  24762. n.prototype.renderToCubeMap = function() {
  24763. var e = !1
  24764. , t = null
  24765. , i = null
  24766. , n = null
  24767. , a = null
  24768. , s = null
  24769. , l = 1;
  24770. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24771. var _ = this.renderer;
  24772. _.context;
  24773. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24774. i.position.z = 150,
  24775. t = new r.Scene,
  24776. t.add(i),
  24777. n = new r.ShaderMaterial({
  24778. uniforms: {
  24779. tDiffuse: {
  24780. type: "t",
  24781. value: null
  24782. },
  24783. alpha: {
  24784. type: "f",
  24785. value: 1
  24786. }
  24787. },
  24788. vertexShader: o.basicTextured.vertexShader,
  24789. fragmentShader: o.basicTextured.fragmentShader,
  24790. depthWrite: !1,
  24791. depthTest: !1,
  24792. side: r.DoubleSide
  24793. }),
  24794. a = new r.PlaneBufferGeometry(l,l),
  24795. s = new r.Mesh(a,n),
  24796. s.position.z = 0,
  24797. t.add(s),
  24798. e = !0);
  24799. var T = a.getAttribute("uv");
  24800. T.setDynamic(!0),
  24801. T.needsUpdate = !0;
  24802. var x = T.array
  24803. , S = p / u
  24804. , M = f / d
  24805. , R = g / u
  24806. , P = m / d;
  24807. x[0] = S,
  24808. x[1] = M + P,
  24809. x[2] = S + R,
  24810. x[3] = M + P,
  24811. x[4] = S,
  24812. x[5] = M,
  24813. x[6] = S + R,
  24814. x[7] = M;
  24815. var O = a.getAttribute("position");
  24816. O.setDynamic(!0),
  24817. O.needsUpdate = !0;
  24818. var L = O.array
  24819. , D = v / h.width - l / 2
  24820. , N = A / h.height - l / 2
  24821. , B = y / h.width
  24822. , F = C / h.height;
  24823. L[0] = D,
  24824. L[1] = N + F,
  24825. L[3] = D + B,
  24826. L[4] = N + F,
  24827. L[6] = D,
  24828. L[7] = N,
  24829. L[9] = D + B,
  24830. L[10] = N;
  24831. this.renderer.properties.get(c);
  24832. n.uniforms.tDiffuse.value = c,
  24833. n.blending = E || r.NoBlending,
  24834. n.transparent = !!b,
  24835. void 0 !== w && null !== w || (w = 1),
  24836. n.uniforms.alpha.value = w,
  24837. n.needUpdate = !0,
  24838. h.activeCubeFace = I,
  24839. h.viewport.set(0, 0, h.width, h.height);
  24840. var V = this.renderer.autoClear;
  24841. this.renderer.autoClear = !1,
  24842. this.renderer.render(t, i, h, !1),
  24843. this.renderer.autoClear = V
  24844. }
  24845. }(),
  24846. n.prototype.copyCubeMap = function() {
  24847. var e = !1
  24848. , t = null
  24849. , i = null
  24850. , a = null
  24851. , s = null
  24852. , l = null
  24853. , c = new r.Euler;
  24854. new r.Vector3;
  24855. return function(h, u, d, p, f, g, m, v, A) {
  24856. this.renderer;
  24857. if (!e) {
  24858. var y = 2;
  24859. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24860. i.position.set(0, 0, 0),
  24861. t = new r.Scene,
  24862. t.add(i),
  24863. a = new r.ShaderMaterial({
  24864. uniforms: {
  24865. tDiffuse: {
  24866. type: "t",
  24867. value: null
  24868. },
  24869. alpha: {
  24870. type: "f",
  24871. value: 1
  24872. }
  24873. },
  24874. vertexShader: o.copyCubeMap.vertexShader,
  24875. fragmentShader: o.copyCubeMap.fragmentShader,
  24876. depthWrite: !1,
  24877. depthTest: !1,
  24878. side: r.DoubleSide
  24879. }),
  24880. s = new r.BoxGeometry(y,y,y),
  24881. l = new r.Mesh(s,a),
  24882. t.add(l),
  24883. e = !0
  24884. }
  24885. for (var C = 0; C < 6; C++)
  24886. n.getCubeOrientationForCubeFace(C, c),
  24887. l.rotation.copy(c),
  24888. l.matrixWorldNeedsUpdate = !0,
  24889. l.updateMatrixWorld(),
  24890. a.uniforms.tDiffuse.value = h,
  24891. a.blending = m || r.NoBlending,
  24892. a.transparent = !!v,
  24893. void 0 !== A && null !== A || (A = 1),
  24894. a.uniforms.alpha.value = A,
  24895. a.needUpdate = !0,
  24896. u.activeCubeFace = C,
  24897. u.viewport.set(0, 0, f, g),
  24898. this.renderer.render(t, i, u, !1)
  24899. }
  24900. }(),
  24901. n.getLookAtForCubeFace = function(e, t) {
  24902. switch (e) {
  24903. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24904. t.set(1, 0, 0);
  24905. break;
  24906. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24907. t.set(-1, 0, 0);
  24908. break;
  24909. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24910. t.set(0, 1, 0);
  24911. break;
  24912. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24913. t.set(0, -1, 0);
  24914. break;
  24915. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24916. t.set(0, 0, 1);
  24917. break;
  24918. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24919. t.set(0, 0, -1)
  24920. }
  24921. }
  24922. ,
  24923. n.getCubeOrientationForCubeFace = function(e, t) {
  24924. switch (e) {
  24925. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24926. t.set(0, -Math.PI / 2, 0);
  24927. break;
  24928. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24929. t.set(0, Math.PI / 2, 0);
  24930. break;
  24931. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24932. t.set(Math.PI / 2, Math.PI, 0);
  24933. break;
  24934. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24935. t.set(-Math.PI / 2, Math.PI, 0);
  24936. break;
  24937. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24938. t.set(0, -Math.PI, 0);
  24939. break;
  24940. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24941. t.set(0, 0, 0)
  24942. }
  24943. }
  24944. ,
  24945. t.exports = n
  24946. }
  24947. , {
  24948. "../enum/GLCubeFaces": 25,
  24949. "../enum/GLTextureType": 26,
  24950. "../enum/SceneRendererEvents": 43,
  24951. "../exception/BasicException": 55,
  24952. "../exception/RendererCreationException": 57,
  24953. "../settings": 166,
  24954. "../shaders": 167,
  24955. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24956. "../util/browser": 182,
  24957. /************************************************************************************************************************************************/
  24958. events: 202,
  24959. three: 217
  24960. }],
  24961. 159: [function(e, t, i) {
  24962. "use strict";
  24963. function n(e) {
  24964. this.messenger = new a(e),
  24965. this.clientKey = null
  24966. }
  24967. var r = e("../util/ajax")
  24968. , o = e("./PostMessageType")
  24969. , a = e("./postmessage")
  24970. , s = e("./VersionInfo")
  24971. , l = e("events").EventEmitter
  24972. , c = window.location.origin + "/api/v1/user/";
  24973. n.prototype = Object.create(l.prototype),
  24974. n.prototype.bindEvents = function() {
  24975. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  24976. }
  24977. ,
  24978. n.prototype.waitForConnection = function() {
  24979. var e = new Promise(function(e, t) {
  24980. this.messenger.on(o.CONNECT, function(i) {
  24981. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  24982. }
  24983. .bind(this))
  24984. }
  24985. .bind(this));
  24986. return e
  24987. }
  24988. ,
  24989. n.prototype.onConnectionReceived = function(e) {
  24990. return this.messenger.setTarget(e.source, e.origin),
  24991. this.verifyConnection(e).then(function(t, i) {
  24992. this.messenger.send({
  24993. type: o.ACCEPT,
  24994. toId: e.fromId,
  24995. warning: i
  24996. }),
  24997. this.clientKey = t,
  24998. this.messenger.removeAllListeners(o.CONNECT),
  24999. this.bindEvents()
  25000. }
  25001. .bind(this), function(t) {
  25002. this.messenger.send({
  25003. type: o.REJECT,
  25004. toId: e.fromId,
  25005. reason: t
  25006. }),
  25007. this.messenger.setTarget()
  25008. }
  25009. .bind(this))
  25010. }
  25011. ,
  25012. n.prototype.verifyConnection = function(e) {
  25013. return new Promise(function(t, i) {
  25014. var n;
  25015. if (s.isDeprecated(e.sdkVersion))
  25016. n = "这个版本正在被弃用";
  25017. else if (!s.isSupported(e.sdkVersion))
  25018. return i("不支持此版本的SDK");
  25019. var o = {
  25020. cache: !1,
  25021. headers: {
  25022. "X-port-Application-Key": e.applicationKey,
  25023. "X-port-Referrer": e.origin
  25024. }
  25025. };
  25026. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25027. }
  25028. )
  25029. }
  25030. ,
  25031. n.prototype.onMessageReceived = function(e) {
  25032. if (this.validateClientApplicationKey(e.applicationKey)) {
  25033. var t = this;
  25034. e.onDone = function(i) {
  25035. i.toId = e.fromId,
  25036. i.uid = e.uid,
  25037. i.type = o.RESPONSE,
  25038. t.messenger.send(i)
  25039. }
  25040. ,
  25041. this.emit(o.ACTION, e)
  25042. }
  25043. }
  25044. ,
  25045. n.prototype.validateClientApplicationKey = function(e) {
  25046. return this.clientKey === e
  25047. }
  25048. ,
  25049. n.prototype.sendEvent = function(e, t) {
  25050. this.messenger.send({
  25051. type: o.EVENT,
  25052. eventType: e,
  25053. eventData: t
  25054. })
  25055. }
  25056. ,
  25057. t.exports = n
  25058. }
  25059. , {
  25060. "../util/ajax": 181,
  25061. "./PostMessageType": 160,
  25062. "./VersionInfo": 163,
  25063. "./postmessage": 165,
  25064. events: 202
  25065. }],
  25066. 160: [function(e, t, i) {
  25067. "use strict";
  25068. t.exports = Object.freeze({
  25069. CONNECT: "postmessage.connect",
  25070. ACCEPT: "postmessage.accept",
  25071. REJECT: "postmessage.reject",
  25072. ACTION: "postmessage.action",
  25073. RESPONSE: "postmessage.response",
  25074. EVENT: "postmessage.event"
  25075. })
  25076. }
  25077. , {}],
  25078. 161: [function(e, t, i) {
  25079. "use strict";
  25080. t.exports = Object.freeze({
  25081. MOVE: "sdk.move",
  25082. ENTER_PANO: "sdk.enterpano",
  25083. MODEL_LOADED: "sdk.modelloaded"
  25084. })
  25085. }
  25086. , {}],
  25087. 162: [function(e, t, i) {
  25088. "use strict";
  25089. t.exports = Object.freeze({
  25090. FLY: "transition.fly",
  25091. FADEOUT: "transition.fade",
  25092. INSTANT: "transition.instant"
  25093. })
  25094. }
  25095. , {}],
  25096. 163: [function(e, t, i) {
  25097. "use strict";
  25098. t.exports = {
  25099. current: "1.0",
  25100. supported: ["1.0"],
  25101. deprecated: [],
  25102. isSupported: function(e) {
  25103. return this.supported.indexOf(e) !== -1
  25104. },
  25105. isDeprecated: function(e) {
  25106. return this.deprecated.indexOf(e) !== -1
  25107. },
  25108. isValid: function(e) {
  25109. return this.isSupported(e) || this.isDeprecated(e)
  25110. }
  25111. }
  25112. }
  25113. , {}],
  25114. 164: [function(e, t, i) {
  25115. (function(i) {
  25116. "use strict";
  25117. function n(e, t, i) {
  25118. e && (e = e.toLowerCase().trim());
  25119. var n = new I.UP.clone
  25120. , r = Math.PI / 3
  25121. , o = Math.PI / 2;
  25122. switch (e) {
  25123. case "left":
  25124. i.copy(t),
  25125. i.applyAxisAngle(n, o);
  25126. break;
  25127. case "right":
  25128. i.copy(t),
  25129. i.applyAxisAngle(n, -o);
  25130. break;
  25131. case "forwardleft":
  25132. i.copy(t),
  25133. i.applyAxisAngle(n, r);
  25134. break;
  25135. case "forwardright":
  25136. i.copy(t),
  25137. i.applyAxisAngle(n, -r);
  25138. break;
  25139. case "forward":
  25140. default:
  25141. i.copy(t)
  25142. }
  25143. return i
  25144. }
  25145. function r(e, t) {
  25146. if (e) {
  25147. var i = {
  25148. pano: e,
  25149. lookAtPoint: null,
  25150. duration: null,
  25151. maxDistanceOverride: null,
  25152. skipWarpingCheck: !1
  25153. };
  25154. this.player.flyToPano(i, function() {
  25155. t && t({
  25156. success: !0,
  25157. message: "Transition complete."
  25158. })
  25159. })
  25160. } else
  25161. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25162. t && t({
  25163. success: !1,
  25164. error: "Unable to find pano."
  25165. })
  25166. }
  25167. function o(e, t) {
  25168. var i = this.findRankedPano(e, t);
  25169. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25170. null)
  25171. }
  25172. function a(e, t) {
  25173. var i = this.findRankedtag(e, t);
  25174. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25175. null)
  25176. }
  25177. function s(e, t) {
  25178. t.copy(I.FORWARD),
  25179. e.getDirection(t)
  25180. }
  25181. function l(e) {
  25182. function t(e) {
  25183. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25184. return {
  25185. x: c.Math.radToDeg(t._x),
  25186. y: c.Math.radToDeg(t._y),
  25187. z: c.Math.radToDeg(t._z)
  25188. }
  25189. }
  25190. var i = function(e) {
  25191. return e.alignmentType !== m.ALIGNED ? null : {
  25192. x: e.position.x,
  25193. y: e.position.y,
  25194. z: e.position.z
  25195. }
  25196. };
  25197. return {
  25198. panos: e.panos.list.map(function(n) {
  25199. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25200. return {
  25201. uuid: n.id,
  25202. aligned: n.alignmentType === m.ALIGNED,
  25203. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25204. position: i(n),
  25205. rotation: t(n),
  25206. thumbnail: r
  25207. }
  25208. })
  25209. }
  25210. }
  25211. var c = e("three")
  25212. , h = e("./ApiHost")
  25213. , u = e("../util/logger")
  25214. , d = e("../util/common")
  25215. , p = e("../util/math")
  25216. , f = e("../enum/ModelManagerEvents")
  25217. , g = e("./PostMessageType")
  25218. , m = e("../enum/AlignmentType")
  25219. , v = e("../enum/Direction")
  25220. , A = e("./TransitionStyles")
  25221. , y = e("../util/panorama")
  25222. , C = e("../enum/GLCubeFaces")
  25223. , I = e("../enum/Vectors")
  25224. , E = e("../enum/Viewmode")
  25225. , b = e("../enum/WarpStyle")
  25226. , w = (e("../enum/Keys"),
  25227. e("../enum/PlayerEvents"))
  25228. , _ = e("../sdk/SdkEvents")
  25229. , I = e("../enum/Vectors")
  25230. , T = e("../enum/ControlEvents")
  25231. , x = e("../enum/RenderLayers")
  25232. , S = (e("../constants"),
  25233. e("../settings"))
  25234. , M = e("../lib/jpeg_encoder")
  25235. , R = new u(i)
  25236. , P = function() {
  25237. var e = function e() {
  25238. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25239. e.player.getDirection(e.playerDirection),
  25240. e.projectVectors();
  25241. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25242. if (e.angleTravelled += Math.abs(t),
  25243. e.angleTravelled >= Math.abs(e.angle)) {
  25244. if (e.active = !1,
  25245. e.onDone) {
  25246. var i = e.onDone;
  25247. i()
  25248. }
  25249. } else
  25250. e.lastFacingDirection.copy(e.playerDirection),
  25251. window.setTimeout(e, 4)
  25252. };
  25253. return e.active = !1,
  25254. e.angle = 0,
  25255. e.angleTravelled = 0,
  25256. e.playerDirection = new c.Vector3,
  25257. e.lastFacingDirection = new c.Vector3,
  25258. e.onDone = null,
  25259. e.player = null,
  25260. e.start = function(t, i, n, r) {
  25261. e.active = !0,
  25262. t && i && (i = 0),
  25263. e.angle = t || i,
  25264. e.xAngle = t,
  25265. e.yAngle = i,
  25266. e.angleTravelled = 0,
  25267. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25268. n.getDirection(e.playerDirection),
  25269. e.lastFacingDirection.copy(e.playerDirection),
  25270. e.projectVectors(),
  25271. e.onDone = r,
  25272. e.player = n,
  25273. e()
  25274. }
  25275. ,
  25276. e.projectVectors = function() {
  25277. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25278. e.lastFacingDirection.projectOnPlane(I.UP))
  25279. }
  25280. ,
  25281. e
  25282. }()
  25283. , O = function() {
  25284. var e = new c.Vector3;
  25285. return function(t) {
  25286. t ? (e.copy(t.position),
  25287. e.add(t.discPosition),
  25288. p.projectPositionToCanvas(e, this.player.camera, e),
  25289. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25290. }
  25291. }()
  25292. , L = function() {
  25293. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25294. }
  25295. , D = function() {
  25296. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25297. }
  25298. , N = function(e) {
  25299. var t = new c.Vector3;
  25300. return function(e) {
  25301. var i = this.player.getDirection();
  25302. t.copy(i);
  25303. var n = t.y;
  25304. t.y = 0,
  25305. t.normalize();
  25306. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25307. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25308. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25309. 0;
  25310. this.player.mode === E.DOLLHOUSE && (r = -r);
  25311. var o = L.call(this) - .1
  25312. , a = D.call(this) + .1
  25313. , s = r + e;
  25314. s > o ? s = o : s < a && (s = a);
  25315. var l = s - r;
  25316. return e > 0 && l < .01 && (l = 0),
  25317. e < 0 && l > -.01 && (l = 0),
  25318. l
  25319. }
  25320. }()
  25321. , B = function() {
  25322. var e = new c.Euler;
  25323. return function(t) {
  25324. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25325. {
  25326. position: {
  25327. x: t.position.x,
  25328. y: t.position.y,
  25329. z: t.position.z
  25330. },
  25331. rotation: {
  25332. x: c.Math.radToDeg(e.x),
  25333. y: c.Math.radToDeg(e.y),
  25334. z: 0
  25335. },
  25336. pano: t.currentPano ? t.currentPano.id : null,
  25337. mode: t.mode
  25338. }
  25339. }
  25340. }()
  25341. , F = null;
  25342. t.exports = {
  25343. init: function(e, t, i, n, r) {
  25344. V.init(e, t, i, r),
  25345. F = new Promise(function(e, t) {
  25346. i.on(w.Ready, function() {
  25347. e()
  25348. })
  25349. }
  25350. .bind(this));
  25351. var o = new h(window)
  25352. , a = o.waitForConnection();
  25353. a.then(function(e) {
  25354. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25355. });
  25356. var s = function() {
  25357. var e = Date.now();
  25358. return function() {
  25359. if (!(Date.now() - e < 100)) {
  25360. var t = B(i);
  25361. o.sendEvent(_.MOVE, {
  25362. state: t
  25363. }),
  25364. e = Date.now()
  25365. }
  25366. }
  25367. }();
  25368. i.on(w.Move, s),
  25369. i.on(w.ViewChanged, s),
  25370. n.on(f.ActiveModelChanged, function(e) {
  25371. function t(e) {
  25372. var t, i = e.newPano.id;
  25373. e.oldPano && (t = e.oldPano.id),
  25374. i !== t && o.sendEvent(_.ENTER_PANO, {
  25375. oldPano: t,
  25376. newPano: i
  25377. })
  25378. }
  25379. var i = e.model
  25380. , n = e.oldModel;
  25381. V.model = i,
  25382. a.then(function() {
  25383. o.sendEvent(_.MODEL_LOADED, {
  25384. metadata: l(i)
  25385. })
  25386. }),
  25387. n && n.panos.forEach(function(e) {
  25388. e.removeEventListener("enter", t)
  25389. }),
  25390. i.panos.forEach(function(e) {
  25391. e.on("enter", t)
  25392. })
  25393. })
  25394. }
  25395. };
  25396. var V = {
  25397. director: null,
  25398. player: null,
  25399. controls: null,
  25400. sceneRenderer: null,
  25401. model: null,
  25402. init: function(e, t, i, n) {
  25403. this.director = e,
  25404. this.player = i,
  25405. this.controls = t,
  25406. this.sceneRenderer = n
  25407. },
  25408. handleToObject: {},
  25409. objectToHandle: {},
  25410. handleCount: 0,
  25411. onMessageReceive: function(e) {
  25412. if (e) {
  25413. var t = e.targetFunction
  25414. , i = e.params
  25415. , n = e.onDone;
  25416. t && this[t] && this[t](i, n)
  25417. }
  25418. },
  25419. waitForInit: function(e, t) {
  25420. F.then(t.bind({
  25421. success: !0,
  25422. message: "Init complete."
  25423. }))
  25424. },
  25425. moveToPano: function(e, t) {
  25426. var i = new c.Euler(0,0,0,"YXZ")
  25427. , n = new c.Quaternion;
  25428. return function(e, t) {
  25429. var r = e.pano
  25430. , o = e.rotation
  25431. , a = e.transition;
  25432. if (!this.model)
  25433. return t({
  25434. success: !1,
  25435. error: "The model has not been loaded yet"
  25436. });
  25437. var s = this.model.panos.get(r);
  25438. if (!s)
  25439. return t({
  25440. success: !1,
  25441. error: r + " does not exist in this model"
  25442. });
  25443. if (!o)
  25444. return t({
  25445. sucess: !1,
  25446. erorr: o + " is not a valid rotation"
  25447. });
  25448. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25449. console.log(o.z);
  25450. var l = {
  25451. success: !0,
  25452. message: r
  25453. };
  25454. if (a === A.FADEOUT)
  25455. n.setFromEuler(i),
  25456. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25457. else {
  25458. var h, u;
  25459. a === A.INSTANT && (h = 0,
  25460. u = 0);
  25461. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25462. this.player.flyToPano({
  25463. pano: s,
  25464. lookAtPoint: d,
  25465. duration: h,
  25466. aimDuration: u
  25467. }, t.bind(this, l))
  25468. }
  25469. }
  25470. }(),
  25471. moveInDirection: function(e, t) {
  25472. var i = e.direction;
  25473. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25474. void (t && t({
  25475. success: !1,
  25476. error: "Invalid direction."
  25477. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25478. t(e ? {
  25479. success: !0,
  25480. message: "moved " + i
  25481. } : {
  25482. success: !1,
  25483. error: "Cannot move in direction: " + i
  25484. })
  25485. })
  25486. },
  25487. getPose: function(e, t) {
  25488. this.player.camera.position,
  25489. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25490. return t({
  25491. success: !0,
  25492. message: B(this.player)
  25493. })
  25494. },
  25495. takeScreenShot: function() {
  25496. var e = new c.PerspectiveCamera
  25497. , t = new c.WebGLRenderTarget;
  25498. return function(i, n) {
  25499. if (!i.resolution)
  25500. return n({
  25501. success: !1,
  25502. error: "An invalid resolution was specified"
  25503. });
  25504. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25505. var r = this.sceneRenderer.renderer.getSize();
  25506. i.resolution.width = r.width,
  25507. i.resolution.height = r.height
  25508. }
  25509. e.layers.set(x.DEFAULT),
  25510. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25511. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25512. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25513. var o = i.resolution.width
  25514. , a = i.resolution.height
  25515. , s = o / a;
  25516. e.position.copy(this.sceneRenderer.camera.position),
  25517. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25518. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25519. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25520. t.setSize(o, a),
  25521. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25522. var l = new Uint8Array(o * a * 4);
  25523. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25524. var c = M.encode({
  25525. data: l,
  25526. width: o,
  25527. height: a,
  25528. heading: 180,
  25529. pitch: 0
  25530. }, {
  25531. quality: 75,
  25532. flipY: !0
  25533. })
  25534. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25535. n({
  25536. success: !0,
  25537. message: h
  25538. })
  25539. }
  25540. }(),
  25541. findRankedPano: function(e, t) {
  25542. var i = new c.Vector3
  25543. , r = new c.Vector3;
  25544. return function(e, t) {
  25545. s(this.player, r),
  25546. n(t, r, i);
  25547. var o = this.player.rankedPanoInDirection(e, i);
  25548. if (o) {
  25549. var a = this.objectToHandle[o.id];
  25550. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25551. this.handleToObject[a] = o),
  25552. a
  25553. }
  25554. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25555. -1
  25556. }
  25557. }(),
  25558. findRankedtag: function(e, t) {
  25559. var i = new c.Vector3
  25560. , r = new c.Vector3;
  25561. return function(e, t) {
  25562. s(this.player, r),
  25563. n(t, r, i);
  25564. var o = this.player.rankedtagInDirection(e, i);
  25565. if (o) {
  25566. var a = this.objectToHandle[o.sid];
  25567. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25568. this.handleToObject[a] = o),
  25569. a
  25570. }
  25571. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25572. -1
  25573. }
  25574. }(),
  25575. clickNearesttag: function(e) {
  25576. this.clickRankedtag(0, e)
  25577. },
  25578. clickRankedtag: function(e, t) {
  25579. var i = a.call(this, e, t);
  25580. i && O.call(this, i)
  25581. },
  25582. clickNearestPano: function(e, t) {
  25583. this.clickRankedPano(0, e, t)
  25584. },
  25585. clickRankedPano: function(e, t, i) {
  25586. var n = o.call(this, e, t);
  25587. n ? r.call(this, n, i) : i(null)
  25588. },
  25589. clickPano: function(e, t) {
  25590. var i = this.handleTable[e];
  25591. i ? r.call(this, i, t) : t(null)
  25592. },
  25593. rotateDirection: function() {
  25594. return function(e, t) {
  25595. var i = e.direction
  25596. , n = e.angle;
  25597. if (!P.active) {
  25598. var r = 0
  25599. , o = 0
  25600. , a = 0
  25601. , s = 0;
  25602. if (!n || isNaN(n))
  25603. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25604. void (t && t({
  25605. success: !1,
  25606. error: "Invalid rotation angle."
  25607. }));
  25608. if (this.player.mode === E.TRANSITIONING)
  25609. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25610. void (t && t({
  25611. success: !1,
  25612. error: "Cannot rotate while transitioning"
  25613. }));
  25614. if (i === v.RIGHT || i === v.LEFT)
  25615. i === v.RIGHT && (n = -n),
  25616. r = n > 0 ? -1 : 1,
  25617. a = n;
  25618. else {
  25619. if (i !== v.UP && i !== v.DOWN)
  25620. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25621. void (t && t({
  25622. success: !1,
  25623. error: "Invalid direction for rotation."
  25624. }));
  25625. if (this.player.mode === E.FLOORPLAN)
  25626. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25627. void (t && t({
  25628. success: !1,
  25629. error: "Cannot rotate " + i + " in floorplan mode"
  25630. }));
  25631. if (i === v.DOWN && (n = -n),
  25632. n = N.call(this, n),
  25633. 0 === n)
  25634. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25635. void (t && t({
  25636. success: !1,
  25637. error: "Already at maximum rotation in direction: " + i
  25638. }));
  25639. o = n > 0 ? 1 : -1,
  25640. s = n
  25641. }
  25642. var l = n;
  25643. n = c.Math.degToRad(n),
  25644. a = c.Math.degToRad(a),
  25645. s = c.Math.degToRad(s);
  25646. var h = this.controls.activeControl
  25647. , u = function() {
  25648. h.stopRotating(!0),
  25649. t && t({
  25650. success: !0,
  25651. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25652. })
  25653. };
  25654. h.startRotating(r, o),
  25655. P.start(a, s, this.player, u)
  25656. }
  25657. }
  25658. }(),
  25659. rotate: function() {
  25660. var e = new c.Vector3
  25661. , t = new c.Vector3;
  25662. return function(i, n) {
  25663. var r = i.xAngle
  25664. , o = i.yAngle;
  25665. if (!P.active) {
  25666. if (r = r || 0,
  25667. o = o || 0,
  25668. isNaN(r) || isNaN(o))
  25669. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25670. void (n && n({
  25671. success: !1,
  25672. error: "Invalid rotation angle."
  25673. }));
  25674. if (this.player.mode === E.TRANSITIONING)
  25675. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25676. void (n && n({
  25677. success: !1,
  25678. error: "Cannot rotate while transitioning"
  25679. }));
  25680. Math.abs(r) < .01 && (r = 0),
  25681. Math.abs(o) < .01 && (o = 0);
  25682. var a = o;
  25683. o = N.call(this, o),
  25684. r = -r;
  25685. var s = a > 0 ? "UP" : "DOWN";
  25686. if (!r && a && !o)
  25687. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25688. void (n && n({
  25689. success: !1,
  25690. error: "Already at maximum rotation in direction: " + s
  25691. }));
  25692. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25693. var l = o;
  25694. o = c.Math.degToRad(o),
  25695. r = c.Math.degToRad(r),
  25696. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25697. this.player.getDirection(e),
  25698. t.copy(e).applyAxisAngle(I.UP, r),
  25699. t.applyAxisAngle(I.RIGHT, o);
  25700. var h = (e.angleTo(t),
  25701. r > 0 ? -1 : r < 0 ? 1 : 0)
  25702. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25703. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25704. var d = this.controls.activeControl
  25705. , p = function() {
  25706. d.stopRotating(!0),
  25707. n && n({
  25708. success: !0,
  25709. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25710. })
  25711. };
  25712. d.startRotating(h, u),
  25713. P.start(r, o, this.player, p)
  25714. }
  25715. }
  25716. }(),
  25717. panCamera: function(e, t) {
  25718. function i(e) {
  25719. switch (r.removeAllListeners(T.AutoPanComplete),
  25720. r.removeAllListeners(T.AutoPanInterrupt),
  25721. r.removeAllListeners(T.AutoPanClamped),
  25722. e) {
  25723. case T.AutoPanInterrupt:
  25724. t({
  25725. success: !0,
  25726. message: "Camera panning interrupted."
  25727. });
  25728. break;
  25729. case T.AutoPanClamped:
  25730. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25731. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25732. return void t({
  25733. success: !1,
  25734. error: "Already at edge of current model bounds."
  25735. });
  25736. var i = "The view point is outside the bounds for the current model. ";
  25737. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25738. console.warn(i)
  25739. }
  25740. case T.AutoPanComplete:
  25741. t({
  25742. success: !0,
  25743. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25744. })
  25745. }
  25746. }
  25747. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25748. return t({
  25749. success: !1,
  25750. error: "Camera panning is not available in the current mode: " + this.player.mode
  25751. });
  25752. var n = e.position
  25753. , r = this.player.control;
  25754. r.setAutoPanPosition(n.x, n.z),
  25755. r.autoPan = !0;
  25756. var o = function(e, t) {
  25757. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25758. };
  25759. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25760. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25761. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25762. },
  25763. click: function(e, t) {
  25764. var i = e.x
  25765. , n = e.y
  25766. , r = e.percentage;
  25767. r === !0 && (i = i / 100 * $("#player").width(),
  25768. n = n / 100 * $("#player").height()),
  25769. this.player.handleInputStart(i, n),
  25770. this.player.updateIntersect(),
  25771. this.player.handleInputEnd(i, n)
  25772. },
  25773. mouseOver: function(e, t) {
  25774. var i = e.x
  25775. , n = e.y
  25776. , r = e.percentage;
  25777. r === !0 && (i = i / 100 * $("#player").width(),
  25778. n = n / 100 * $("#player").height()),
  25779. this.player.handleInputMove(i, n),
  25780. this.player.updateIntersect()
  25781. },
  25782. moveToMode: function(e, t) {
  25783. function i(e) {
  25784. t(e ? {
  25785. success: !1,
  25786. error: "Failed to load new mode: " + e
  25787. } : {
  25788. success: !0,
  25789. message: "Moved to new mode: " + n
  25790. })
  25791. }
  25792. var n = e.mode;
  25793. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25794. i()
  25795. }, function(e) {
  25796. i(e)
  25797. }) : t({
  25798. success: !1,
  25799. error: "Invalid mode selection"
  25800. })
  25801. }
  25802. }
  25803. }
  25804. ).call(this, "/js/sdk/automation.js")
  25805. }
  25806. , {
  25807. "../constants": 8,
  25808. "../enum/AlignmentType": 17,
  25809. "../enum/ControlEvents": 21,
  25810. "../enum/Direction": 22,
  25811. "../enum/GLCubeFaces": 25,
  25812. "../enum/Keys": 30,
  25813. "../enum/ModelManagerEvents": 33,
  25814. "../enum/PlayerEvents": 40,
  25815. "../enum/RenderLayers": 41,
  25816. "../enum/Vectors": 50,
  25817. "../enum/Viewmode": 51,
  25818. "../enum/WarpStyle": 52,
  25819. "../lib/jpeg_encoder": 94,
  25820. "../sdk/SdkEvents": 161,
  25821. "../settings": 166,
  25822. "../util/common": 185,
  25823. "../util/logger": 189,
  25824. "../util/math": 190,
  25825. "../util/panorama": 191,
  25826. "./ApiHost": 159,
  25827. "./PostMessageType": 160,
  25828. "./TransitionStyles": 162,
  25829. three: 217
  25830. }],
  25831. 165: [function(e, t, i) {
  25832. "use strict";
  25833. function n(e) {
  25834. this.sourceWindow = e,
  25835. this.targetWindow = null,
  25836. this.targetOrigin = null,
  25837. this.id = Math.floor(1e5 * Math.random()),
  25838. this.bindEvents()
  25839. }
  25840. var r = e("./PostMessageType")
  25841. , o = e("events").EventEmitter;
  25842. n.prototype = Object.create(o.prototype),
  25843. n.prototype.bindEvents = function() {
  25844. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25845. }
  25846. ,
  25847. n.prototype.setTarget = function(e, t) {
  25848. this.targetWindow = e,
  25849. this.targetOrigin = t
  25850. }
  25851. ,
  25852. n.prototype.onPostmessageReceived = function(e) {
  25853. var t = e.origin || e.originalEvent.origin
  25854. , i = e.source;
  25855. switch (e.data.type) {
  25856. case r.CONNECT:
  25857. break;
  25858. case r.RESPONSE:
  25859. if (this.id !== e.data.toId)
  25860. return;
  25861. default:
  25862. if (!this.validateMessageOrigin(t))
  25863. return
  25864. }
  25865. var n = e.data;
  25866. n.source = i,
  25867. n.origin = t,
  25868. n.timestamp = Date.now(),
  25869. this.emit(e.data.type, n)
  25870. }
  25871. ,
  25872. n.prototype.validateMessageOrigin = function(e) {
  25873. return "*" === this.targetOrigin || e === this.targetOrigin
  25874. }
  25875. ,
  25876. n.prototype.send = function(e) {
  25877. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25878. this.targetWindow.postMessage(e, this.targetOrigin))
  25879. }
  25880. ,
  25881. t.exports = n
  25882. }
  25883. , {
  25884. "./PostMessageType": 160,
  25885. events: 202
  25886. }],
  25887. 166: [function(e, t, i) {
  25888. "use strict";
  25889. var n = e("three")
  25890. , r = e("./util/browser")
  25891. , o = e("./enum/Viewmode")
  25892. , a = e("./enum/VROption")
  25893. , s = e("./enum/Colors")
  25894. , l = e("./enum/WarpStyle")
  25895. , c = e("./util/easing")
  25896. , h = e("./util/common")
  25897. , u = e("./util/showcase")
  25898. , d = e("./constants")
  25899. , p = {
  25900. debug: !1,
  25901. version: "2.25.6-0-gd87e5b1",
  25902. languageTag: r.valueFromHash("lang", null),
  25903. pageTitle: "四维虚拟漫游",
  25904. authorizationHeader: u.getAuthorizationHeader(),
  25905. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25906. logLevel: r.valueFromHash("log", 2),
  25907. skyboxRadius: 2500,
  25908. modelBoundsPadding: 5,
  25909. showNeighbors: !1,
  25910. brand: r.valueFromHash("brand", !0),
  25911. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25912. startHighlights: r.valueFromHash("hl", -1),
  25913. specialEdition: r.valueFromHash("bn", 0),
  25914. useWheel: r.valueFromHash("wh", !0),
  25915. crossOrigin: "anonymous",
  25916. fancierTransition: !1,
  25917. wireframe: !1,
  25918. skyboxWireframe: !1,
  25919. modelAlpha: 1,
  25920. highlightPanoSelection: !1,
  25921. showSweeps: !0,
  25922. showSkyboxes: !1,
  25923. showMesh: !0,
  25924. showFloors: !1,
  25925. showFloorDuration: 300,
  25926. showFloorDelay: 300,
  25927. hideFloorDuration: 300,
  25928. hideFloorDelay: 0,
  25929. reticuleOpacityTransitionTime: 250,
  25930. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25931. markerOpacityTransitionTime: 500,
  25932. guiAnimationSpeed: 250,
  25933. highlightAnimationDuration: 500,
  25934. modelComponentLoadSpinnerDelay: 150,
  25935. captureErrors: !1,
  25936. maxMobileTextures: 6,
  25937. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25938. startupFlyinDelay: 3e3,
  25939. dollhouseDefault: {
  25940. minDistance: 15,
  25941. maxDistance: 50,
  25942. minPolarAngle: n.Math.degToRad(10),
  25943. maxPolarAngle: n.Math.degToRad(90)
  25944. },
  25945. hideReticuleTimeout: 1e3,
  25946. analytics: {
  25947. inactivityThreshold: 30,
  25948. sessionTrackingRate: .15,
  25949. maxTrackedErrors: 20,
  25950. sessionDurationPingFrequency: 10,
  25951. sessionDurationTimeout: 15
  25952. },
  25953. flydown: {
  25954. movementEasing: "easeInOutQuad",
  25955. movementDelay: .001,
  25956. rotationEasing: "easeInOutQuad",
  25957. rotationDelay: .5,
  25958. modelTextureDelay: .75,
  25959. skyboxDelay: .75
  25960. },
  25961. transition: {
  25962. flySpeed: .001,
  25963. flyTime: 750,
  25964. flytimeMaxDistanceThreshold: 5,
  25965. flytimeDistanceMultiplier: 150,
  25966. aimTime: 1500,
  25967. aimSlowFactor: 1.5,
  25968. blur: 0.8,
  25969. movementEasing: "easeInOutQuad",
  25970. blendEasing: "easeInOutQuad",
  25971. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  25972. },
  25973. show360Views: {
  25974. enabled: !0,
  25975. transitionTime: 1e3
  25976. },
  25977. quickstart: {
  25978. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25979. animation: 1400,
  25980. showTextDelay: 500,
  25981. fadeOutDelay: 3e3,
  25982. fovChange: 10
  25983. },
  25984. appConfig: {
  25985. webvr_version: null,
  25986. segment_key: null,
  25987. embedly_key: null,
  25988. branch_key: null,
  25989. keen_write_key: null,
  25990. keen_project_id: null
  25991. },
  25992. vr: {
  25993. enabled: !0,
  25994. allowWebVR: !1,
  25995. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25996. },
  25997. share: {
  25998. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25999. },
  26000. input: {
  26001. longTapThreshold: 200,
  26002. moveToleranceNDC: .08,
  26003. touchMoveThreshold: 25
  26004. },
  26005. help: {
  26006. modalStayDuration: 600
  26007. },
  26008. immersive: {
  26009. timeToShowAgain: 1250,
  26010. uiStayDuration: 600
  26011. },
  26012. tourInteraction: {
  26013. disabled: "0" === r.valueFromHash("tourcta", null),
  26014. showPauseButton: 1e3,
  26015. showModal: 1500,
  26016. allowNextClick: 200,
  26017. largeModal: "1" === r.valueFromHash("tourcta", null),
  26018. smallModal: "2" === r.valueFromHash("tourcta", null)
  26019. },
  26020. labels: {
  26021. enabled: !1,
  26022. hideUntilStart: !0,
  26023. fadeInDuration: 250,
  26024. fadeInDelay: 250,
  26025. fadeOutDuration: 250,
  26026. fadeOutDelay: 0,
  26027. zoomHideThreshhold: {
  26028. mobile: r.isSmallScreen() ? .45 : .6,
  26029. desktop: 2
  26030. },
  26031. zoomTruncateThreshhold: {
  26032. mobile: r.isSmallScreen() ? .35 : .45,
  26033. desktop: .85
  26034. },
  26035. minLengthForTruncate: 16,
  26036. truncateLength: 12,
  26037. truncateSuffix: "..."
  26038. },
  26039. tags: {
  26040. enabled: r.valueFromHash("mt", 1),
  26041. startup: {
  26042. hideUntilStart: !0,
  26043. fadeInDuration: 500,
  26044. fadeInDelay: 100
  26045. },
  26046. visibility: {
  26047. anyDistance: !0,
  26048. visibleDistance: 8,
  26049. cameraClearance: .1,
  26050. alphaTestLevel: .05,
  26051. hideViaFloor: !0,
  26052. hideOffScreenDisc: !1,
  26053. hideOffScreenObject: !1
  26054. },
  26055. disc: {
  26056. opacity: 1,
  26057. disabledOpacity: .5,
  26058. scale: {
  26059. nearBound: 1.5,
  26060. farBound: 4.8,
  26061. linkFarBound: !1,
  26062. linkPercent: 40,
  26063. maxSize: 80,
  26064. minSize: 40,
  26065. baseViewportSize: 800,
  26066. responsiveness: 100
  26067. }
  26068. },
  26069. pole: {
  26070. enabled: !0,
  26071. height: .5,
  26072. width: 2,
  26073. opacity: .5,
  26074. color: "white"
  26075. },
  26076. navigate: {
  26077. nearestPano: !0,
  26078. lineOfSight: !0,
  26079. reactivate: !0,
  26080. aimAt: "disc",
  26081. tiltTolerance: 25,
  26082. rotateSpeedFactor: .6
  26083. }
  26084. },
  26085. path: {
  26086. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26087. colorUp: s._desat(s.newBlue, .5),
  26088. colorDown: s._darken(s.newBlue, .35),
  26089. opacity: .5,
  26090. style: "ribbon",
  26091. height: .025,
  26092. ribbonWidth: .24,
  26093. outsideHeight: .5,
  26094. waypointRadius: .5,
  26095. waypointIndoorRadius: .24,
  26096. waypointPulse: 1e3,
  26097. typ: l.BLACK,
  26098. meshFree: r.valueFromHash("mf", 1),
  26099. mapGuides: r.valueFromHash("guides", !0),
  26100. fadeInTime: 400,
  26101. fadeOutTime: 300
  26102. },
  26103. warp: {
  26104. nearPanoDist: .1,
  26105. matchCam: !1,
  26106. blur: .33,
  26107. fastTime: 1500,
  26108. teleportTime: 1500,
  26109. outsideTime: 2e3,
  26110. lookAheadMax: .3,
  26111. lookAheadDist: 2.5,
  26112. softPushDist: .37,
  26113. softPushEnd: .3,
  26114. softBendAngle: 8,
  26115. softBendTilt: 4,
  26116. softBendEnd: .3,
  26117. doBurns: true, //r.valueFromHash("kb", !0),
  26118. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26119. minBurnsAngle: 35,
  26120. minDownAngle: -35,
  26121. maxTurnPerSec: 280,
  26122. maxAimPerSec: 35,
  26123. minRotation: 12,
  26124. maxAimRotation: 33.2,
  26125. turnFriction: .2,
  26126. flySpeed: .01,
  26127. minWarpTime: 1200,
  26128. warpInterruptionRedirectTime: 500,
  26129. tourStepDelay: r.valueFromHash("st", 0),
  26130. walkDelay: 0,
  26131. walkMaxDist: 50,
  26132. walkMinDist: .8,
  26133. walkSlideShowThreshhold: 3000,
  26134. walkExtraPanosDistance: .4,
  26135. timePerMeter: 1200,
  26136. motionLeadTime: 5000,
  26137. movementEasing: "easeInOutQuad",
  26138. blendEasing: "easeInOutQuad",
  26139. showBunny: !1,
  26140. loop: r.valueFromHash("lp", !1),
  26141. auto: r.valueFromHash("ts", -1),
  26142. eOrder: 'YXZ', //"YXZ",
  26143. stepFactor: .25,
  26144. brakeStrength: 2,
  26145. minBrakeAngle: .1,
  26146. maxBrakeAngle: 1.8,
  26147. climbEffort: 4
  26148. },
  26149. rotationFriction: .05,
  26150. rotationAccelerationInside: 4.5,
  26151. rotationAccelerationOutside: .15,
  26152. rotationAfterMoveMultiplier: 40,
  26153. rotationAfterMoveHistoryCount: 5,
  26154. panFriction: .09,
  26155. panAccelerationOutside: 60,
  26156. onload: r.valueFromHash("onload", o.PANORAMA),
  26157. zoomNearLimit: .1,
  26158. zoomFarLimit: 30,
  26159. navigation: {
  26160. panoScores: !1,
  26161. mouseDirection: !0,
  26162. filterStrictness: .75,
  26163. angleFactor: -30,
  26164. directionFactor: 10,
  26165. distanceFactor: -1,
  26166. optionalityFactor: 3
  26167. },
  26168. sdkInit: !1,
  26169. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26170. console: r.valueFromHash("console", !1),
  26171. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26172. panoramaNeighbourMaxDistance: 5,
  26173. panoFloorClickRadius: .35,
  26174. showScreenshotLocations: !1,
  26175. showAxis: !1,
  26176. showNeighbourRaycasts: !1,
  26177. colorMarkerOnLoad: !1,
  26178. colorMarkerByFloor: !1,
  26179. tiling: {
  26180. panoPreRenderRepeatDelay: 2500,
  26181. panoPreRenderDelay: 500,
  26182. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26183. tilingFlagNames: ["usetiles", "tiles"],
  26184. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26185. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26186. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26187. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26188. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26189. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  26190. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26191. customCompression: r.valueFromHash("tilecustcomp", 0),
  26192. // mobileHighQualityOverride: !1,
  26193. mobileHighQualityOverride: 1,
  26194. allowUltraHighResolution: true
  26195. },
  26196. zoom: {
  26197. enabled: true,
  26198. forceOff: r.valueFromHash("nozoom", 0),
  26199. overridemax: r.valueFromHash("maxzoom", null),
  26200. overridemin: r.valueFromHash("minzoom", null),
  26201. max: d.highQualityMaxZoom,
  26202. min: 1,
  26203. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26204. activationThreshold: 1.1,
  26205. restoreTime: 500
  26206. },
  26207. profiling: {
  26208. enabled: r.valueFromHash("mem", !1)
  26209. }
  26210. };
  26211. p = h.deepExtend(p, d, {
  26212. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26213. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26214. panorama: {
  26215. transitionTime: 1e3,
  26216. modelAlpha: 0,
  26217. modelAlphaDelay: p.flydown.modelTextureDelay,
  26218. modelAlphaLength: 1,
  26219. skyboxOpacity: 1,
  26220. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26221. skyboxOpacityLength: .9,
  26222. fovLength: 1,
  26223. fovDelay: 0,
  26224. cameraMatrixDuration: .8,
  26225. cameraMatrixDelay: 0,
  26226. cameraMatrixEase: c.easeInCubic,
  26227. reticuleOpacity: 1,
  26228. markerOpacity: .3,
  26229. markerOpacityOnHover: 1
  26230. },
  26231. dollhouse: {
  26232. transitionTime: 1e3,
  26233. modelAlpha: 1,
  26234. modelAlphaDelay: 0,
  26235. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26236. skyboxOpacity: 0,
  26237. skyboxOpacityDelay: 0,
  26238. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26239. fovLength: 1,
  26240. fovDelay: 0,
  26241. cameraMatrixDuration: .8,
  26242. cameraMatrixDelay: .3,
  26243. cameraMatrixEase: c.easeInCubic,
  26244. reticuleOpacity: 1,
  26245. markerOpacity: 0,
  26246. markerOpacityOnHover: 0
  26247. },
  26248. floorplan: {
  26249. transitionTime: 1e3,
  26250. modelAlpha: 1,
  26251. modelAlphaDelay: 0,
  26252. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26253. skyboxOpacity: 0,
  26254. skyboxOpacityDelay: 0,
  26255. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26256. fovLength: 1,
  26257. fovDelay: 0,
  26258. cameraMatrixDuration: .5,
  26259. cameraMatrixDelay: 0,
  26260. cameraMatrixEase: c.easeOutCubic,
  26261. reticuleOpacity: 1,
  26262. markerOpacity: 0,
  26263. markerOpacityOnHover: 0,
  26264. cameraHeight: 50
  26265. },
  26266. transitioning: {
  26267. reticuleOpacity: 0,
  26268. markerOpacity: .3,
  26269. markerOpacityOnHover: 1
  26270. },
  26271. "floorplan-dollhouse": {
  26272. rotationDelay: 0,
  26273. rotationDuration: 1
  26274. },
  26275. "floorplan-panorama": {
  26276. rotationDelay: .5,
  26277. rotationDuration: 1
  26278. },
  26279. "dollhouse-panorama": {
  26280. rotationDelay: .5,
  26281. rotationDuration: 1
  26282. },
  26283. "dollhouse-floorplan": {
  26284. rotationDelay: 0,
  26285. rotationDuration: 1,
  26286. cameraMatrixDuration: 1.05,
  26287. cameraMatrixDelay: .5
  26288. },
  26289. "panorama-dollhouse": {
  26290. rotationDelay: 0,
  26291. rotationDuration: .5
  26292. },
  26293. "panorama-floorplan": {
  26294. transitionTime: 1500,
  26295. rotationDelay: 0,
  26296. rotationDuration: .5
  26297. }
  26298. }),
  26299. p.path.meshFree && (p.path.typ = l.WALK),
  26300. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26301. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26302. t.exports = p
  26303. }
  26304. , {
  26305. "./constants": 8,
  26306. "./enum/Colors": 19,
  26307. "./enum/VROption": 47,
  26308. "./enum/Viewmode": 51,
  26309. "./enum/WarpStyle": 52,
  26310. "./util/browser": 182,
  26311. "./util/common": 185,
  26312. "./util/easing": 186,
  26313. "./util/showcase": 193,
  26314. three: 217
  26315. }],
  26316. 167: [function(e, t, i) {
  26317. "use strict";
  26318. var n = e("three")
  26319. , r = e("./settings")
  26320. , 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"
  26321. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26322. t.exports = {
  26323. basicTextured: {
  26324. uniforms: {
  26325. tDiffuse: {
  26326. type: "t",
  26327. value: null
  26328. },
  26329. alpha: {
  26330. type: "f",
  26331. value: 1
  26332. }
  26333. },
  26334. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26335. 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}"
  26336. },
  26337. copyCubeMap: {
  26338. uniforms: {
  26339. tDiffuse: {
  26340. type: "t",
  26341. value: null
  26342. },
  26343. alpha: {
  26344. type: "f",
  26345. value: 1
  26346. }
  26347. },
  26348. 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}",
  26349. 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}"
  26350. },
  26351. cube: {
  26352. uniforms: {
  26353. map: {
  26354. type: "t",
  26355. value: null
  26356. },
  26357. opacity: {
  26358. type: "f",
  26359. value: 1
  26360. }
  26361. },
  26362. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26363. 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"
  26364. },
  26365. model: {
  26366. uniforms: {
  26367. map: {
  26368. type: "t",
  26369. value: null
  26370. },
  26371. modelAlpha: {
  26372. type: "f",
  26373. value: r.modelAlpha
  26374. },
  26375. opacity: {
  26376. type: "f",
  26377. value: 1
  26378. },
  26379. progress: {
  26380. type: "f",
  26381. value: 0
  26382. },
  26383. blackout: {
  26384. type: "i",
  26385. value: 0
  26386. },
  26387. pano0Map: {
  26388. type: "t",
  26389. value: null
  26390. },
  26391. pano0Position: {
  26392. type: "v3",
  26393. value: new n.Vector3
  26394. },
  26395. pano0Matrix: {
  26396. type: "m4",
  26397. value: new n.Matrix4
  26398. },
  26399. pano1Map: {
  26400. type: "t",
  26401. value: null
  26402. },
  26403. pano1Position: {
  26404. type: "v3",
  26405. value: new n.Vector3
  26406. },
  26407. pano1Matrix: {
  26408. type: "m4",
  26409. value: new n.Matrix4
  26410. }
  26411. },
  26412. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26413. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  26414. },
  26415. hot:{
  26416. uniforms:{
  26417. color:{
  26418. type: "c",
  26419. value: new n.Color( 0xff2200 )
  26420. },
  26421. opac:{
  26422. type: "f",
  26423. value: 0
  26424. },
  26425. texture1:{
  26426. type: "t",
  26427. value: null
  26428. },
  26429. texture2:{
  26430. type: "t",
  26431. value: null
  26432. }
  26433. },
  26434. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26435. 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"
  26436. },
  26437. modelOutside: {
  26438. uniforms: {
  26439. map: {
  26440. type: "t",
  26441. value: null
  26442. },
  26443. opacity: {
  26444. type: "f",
  26445. value: 1
  26446. }
  26447. },
  26448. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26449. 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"
  26450. },
  26451. ribbon: {
  26452. uniforms: {
  26453. map: {
  26454. type: "t",
  26455. value: null
  26456. },
  26457. opacity: {
  26458. type: "f",
  26459. value: 1
  26460. },
  26461. color: {
  26462. type: "c",
  26463. value: new n.Color(r.path.color)
  26464. }
  26465. },
  26466. 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",
  26467. 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"
  26468. },
  26469. waypoint: {
  26470. uniforms: {
  26471. map: {
  26472. type: "t",
  26473. value: null
  26474. },
  26475. opacity: {
  26476. type: "f",
  26477. value: 1
  26478. },
  26479. pulse: {
  26480. type: "f",
  26481. value: 1
  26482. },
  26483. nearFade: {
  26484. type: "v2",
  26485. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26486. },
  26487. color: {
  26488. type: "c",
  26489. value: new n.Color(r.reticuleColor)
  26490. }
  26491. },
  26492. 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",
  26493. 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"
  26494. },
  26495. modelDebug: {
  26496. uniforms: {
  26497. map: {
  26498. type: "t",
  26499. value: null
  26500. },
  26501. modelAlpha: {
  26502. type: "f",
  26503. value: r.modelAlpha
  26504. },
  26505. depthmapRatio: {
  26506. type: "f",
  26507. value: 0
  26508. },
  26509. opacity: {
  26510. type: "f",
  26511. value: 1
  26512. },
  26513. progress: {
  26514. type: "f",
  26515. value: 0
  26516. },
  26517. considerOcclusion: {
  26518. type: "i",
  26519. value: r.fancierTransition
  26520. },
  26521. highlightPanoSelection: {
  26522. type: "i",
  26523. value: 0
  26524. },
  26525. useThirdPano: {
  26526. type: "i",
  26527. value: r.useThirdPano
  26528. },
  26529. pano0Map: {
  26530. type: "t",
  26531. value: null
  26532. },
  26533. pano0Depth: {
  26534. type: "t",
  26535. value: null
  26536. },
  26537. pano0Position: {
  26538. type: "v3",
  26539. value: new n.Vector3
  26540. },
  26541. pano0Matrix: {
  26542. type: "m4",
  26543. value: new n.Matrix4
  26544. },
  26545. pano0Weight: {
  26546. type: "f",
  26547. value: r.transition.pano0Weight
  26548. },
  26549. pano1Map: {
  26550. type: "t",
  26551. value: null
  26552. },
  26553. pano1Depth: {
  26554. type: "t",
  26555. value: null
  26556. },
  26557. pano1Position: {
  26558. type: "v3",
  26559. value: new n.Vector3
  26560. },
  26561. pano1Matrix: {
  26562. type: "m4",
  26563. value: new n.Matrix4
  26564. },
  26565. pano1Weight: {
  26566. type: "f",
  26567. value: r.transition.pano1Weight
  26568. },
  26569. pano2Map: {
  26570. type: "t",
  26571. value: null
  26572. },
  26573. pano2Depth: {
  26574. type: "t",
  26575. value: null
  26576. },
  26577. pano2Position: {
  26578. type: "v3",
  26579. value: new n.Vector3
  26580. },
  26581. pano2Matrix: {
  26582. type: "m4",
  26583. value: new n.Matrix4
  26584. },
  26585. pano2Weight: {
  26586. type: "f",
  26587. value: r.transition.pano2Weight
  26588. }
  26589. },
  26590. 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",
  26591. 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"
  26592. },
  26593. customDepth: {
  26594. uniforms: {
  26595. panoPosition: {
  26596. type: "v3",
  26597. value: new n.Vector3
  26598. }
  26599. },
  26600. 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",
  26601. 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"
  26602. },
  26603. skysphere: {
  26604. uniforms: {
  26605. radius: {
  26606. type: "f",
  26607. value: 0
  26608. }
  26609. },
  26610. 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",
  26611. 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"
  26612. },
  26613. tagDisc: {
  26614. uniforms: {
  26615. opacity: {
  26616. type: "f",
  26617. value: 0
  26618. },
  26619. color: {
  26620. type: "c",
  26621. value: new n.Color
  26622. },
  26623. bg: {
  26624. type: "t",
  26625. value: null
  26626. },
  26627. mask: {
  26628. type: "t",
  26629. value: null
  26630. }
  26631. },
  26632. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26633. 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"
  26634. }
  26635. }
  26636. }
  26637. , {
  26638. "./settings": 166,
  26639. three: 217
  26640. }],
  26641. 168: [function(e, t, i) {
  26642. (function(i) {
  26643. "use strict";
  26644. var n = e("three")
  26645. , r = (e("url"),
  26646. e("./util/ajax"))
  26647. , o = e("./settings")
  26648. , a = e("./util/logger")
  26649. , s = e("./util/math")
  26650. , l = e("./util/showcase")
  26651. , c = e("./objects/Panorama")
  26652. , h = new a(i)
  26653. , u = e("./model/Model")
  26654. , d = e("./shaders")
  26655. , p = e("./util/transitions")
  26656. , f = e("./objects/Chunk")
  26657. , g = e("./objects/Reticule")
  26658. , m = e("./objects/Skybox")
  26659. , v = e("./objects/Floor")
  26660. , A = e("./cameras/DollhouseCamera")
  26661. , y = e("./cameras/FloorplanCamera")
  26662. , C = e("./cameras/PanoramaCamera")
  26663. , I = e("./controls/DollhouseControls")
  26664. , E = e("./controls/FloorplanControls")
  26665. , b = e("./controls/PanoramaControls");
  26666. n.ImageUtils.crossOrigin = o.crossOrigin,
  26667. t.exports = {
  26668. shaders: d,
  26669. transitions: p,
  26670. Model: u,
  26671. Chunk: f,
  26672. Floor: v,
  26673. Skybox: m,
  26674. Reticule: g,
  26675. Panorama: c,
  26676. DollhouseCamera: A,
  26677. FloorplanCamera: y,
  26678. PanoramaCamera: C,
  26679. DollhouseControls: I,
  26680. FloorplanControls: E,
  26681. PanoramaControls: b,
  26682. getModel: function(e) {
  26683. if (!e.url)
  26684. throw 'getModel(): missing parameter "url"';
  26685. e.autoload = void 0 === e.autoload || e.autoload;
  26686. var t = l.parseSidUrl(e.url);
  26687. e.urlBase = t.urlBase,
  26688. e.urlModel = t.urlModel,
  26689. e.urlFiles = t.urlFiles;
  26690. var i = this._getPlatformError();
  26691. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26692. this._loadModel().then(this._buildModel.bind(this)))
  26693. },
  26694. _getPlatformError: function() {
  26695. 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"
  26696. },
  26697. _loadModel: function() {
  26698. return r.get(this.options.urlModel, {
  26699. responseType: "json",
  26700. prefetchFrom: "model",
  26701. auth: l.getAuthorizationHeader()
  26702. }).then(null, function() {
  26703. return h.warn("Model loading failed at initial metadata load"),
  26704. "loading-failed"
  26705. })
  26706. },
  26707. _buildModel: function(e) {
  26708. e = l.normalizeModeldata(e, s);
  26709. var t = new u(this.options,e);
  26710. return this.options.autoload ? t.load(!0) : $.when(t)
  26711. }
  26712. }
  26713. }
  26714. ).call(this, "/js/showcase.js")
  26715. }
  26716. , {
  26717. "./cameras/DollhouseCamera": 5,
  26718. "./cameras/FloorplanCamera": 6,
  26719. "./cameras/PanoramaCamera": 7,
  26720. "./controls/DollhouseControls": 10,
  26721. "./controls/FloorplanControls": 11,
  26722. "./controls/PanoramaControls": 13,
  26723. "./model/Model": 139,
  26724. "./objects/Chunk": 144,
  26725. "./objects/Floor": 146,
  26726. "./objects/Panorama": 148,
  26727. "./objects/Reticule": 149,
  26728. "./objects/Skybox": 152,
  26729. "./settings": 166,
  26730. "./shaders": 167,
  26731. "./util/ajax": 181,
  26732. "./util/logger": 189,
  26733. "./util/math": 190,
  26734. "./util/showcase": 193,
  26735. "./util/transitions": 195,
  26736. three: 217,
  26737. url: 208
  26738. }],
  26739. 169: [function(e, t, i) {
  26740. "use strict";
  26741. function n() {
  26742. var e = {
  26743. renderTarget: null,
  26744. inUse: !1,
  26745. size: -1,
  26746. pano: null
  26747. };
  26748. return e
  26749. }
  26750. function r(e) {
  26751. M.push(e)
  26752. }
  26753. function o(e) {
  26754. var t = n();
  26755. return t.inUse = !0,
  26756. t.size = e,
  26757. r(t),
  26758. t
  26759. }
  26760. function a(e) {
  26761. for (var t = 0; t < M.length; t++) {
  26762. var i = M[t];
  26763. if (!i.inUse && i.size === e)
  26764. return i.inUse = !0,
  26765. i
  26766. }
  26767. return null
  26768. }
  26769. function s(e) {
  26770. for (var t = 0; t < M.length; t++) {
  26771. var i = M[t];
  26772. if (i.renderTarget === e)
  26773. return i.inUse = !1,
  26774. !0
  26775. }
  26776. return !1
  26777. }
  26778. function l() {
  26779. this.tileDirectory = {},
  26780. this.activeRenderTargetDescriptors = {},
  26781. this.activePanos = [],
  26782. this.panoLODDescriptors = {},
  26783. this.panoDescriptors = {},
  26784. this.tileTrees = {},
  26785. this.sceneRenderer = null,
  26786. this.tileDownloader = null,
  26787. this.forceQueue = [],
  26788. this.uploadQueues = {},
  26789. this.uploadInterval = null,
  26790. this.uploadIntervalCancelled = !1,
  26791. this.usingTileOverlay = !1,
  26792. this.overlayTilesLoaded = !1,
  26793. this.overlayTileBase = null,
  26794. this.overlayTilesBasic = {},
  26795. this.overlayTilesEnhanced = {},
  26796. this.zoomRenderTarget = null,
  26797. this.zoomPano = null,
  26798. this.zoomingActive = !1,
  26799. this.zoomPanoId = null,
  26800. this.zoomPanoRenderingDisabled = !1,
  26801. this.direction = new h.Vector3,
  26802. this.initTime = -1,
  26803. this.maxBaseUploadsPerFrame = x,
  26804. this.maxNonBaseUploadsPerFrame = T
  26805. }
  26806. function c() {
  26807. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26808. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26809. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26810. }
  26811. var h = e("three")
  26812. , u = e("../exception/BasicException")
  26813. , d = e("../settings")
  26814. , p = e("../enum/PanoSizeClass")
  26815. , f = (e("../objects/Panorama"),
  26816. e("../enum/PanoRendererEvents"))
  26817. , g = e("../enum/SceneRendererEvents")
  26818. , m = e("../enum/TileDownloaderEvents")
  26819. , v = e("../enum/Vectors")
  26820. , A = (e("../enum/GLCubeFaces"),
  26821. e("../objects/Panorama"),
  26822. e("./TileTree"))
  26823. , y = (e("./TileDownloader"),
  26824. e("./TilePrioritizer"))
  26825. , C = e("./TileUtils")
  26826. , p = e("../enum/PanoSizeClass")
  26827. , I = (e("../util/browser"),
  26828. e("../util/panorama"))
  26829. , E = e("events").EventEmitter
  26830. , b = !1
  26831. , w = d.tiling.uploadIntervalDelay
  26832. , _ = d.tiling.initialIntervalDelay
  26833. , T = d.tiling.maxNonBaseUploadsPerFrame
  26834. , x = d.tiling.maxBaseUploadsPerFrame
  26835. , S = {
  26836. Base: 0,
  26837. Remaining: 1
  26838. }
  26839. , M = [];
  26840. l.prototype = Object.create(E.prototype),
  26841. l.prototype.init = function(e, t, i) {
  26842. this.sceneRenderer = e,
  26843. this.tileDownloader = t,
  26844. this.qualityManager = i,
  26845. this.bindEvents(),
  26846. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26847. this.initTime = performance.now()
  26848. }
  26849. ,
  26850. l.prototype.getActivePanoTextures = function(e) {
  26851. e = e || [];
  26852. for (var t = 0; t < M.length; t++) {
  26853. var i = M[t];
  26854. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26855. }
  26856. }
  26857. ,
  26858. l.prototype.hasQueuedTiles = function() {
  26859. var e = this.peekNextFromUploadQueue();
  26860. return null !== e && void 0 !== e
  26861. }
  26862. ,
  26863. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26864. return this.activeRenderTargetDescriptors[e]
  26865. }
  26866. ,
  26867. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26868. this.activeRenderTargetDescriptors[e] = t
  26869. }
  26870. ,
  26871. l.prototype.loadOverlayTiles = function() {
  26872. if (0 !== d.tiling.overlayStyle) {
  26873. var e = 0
  26874. , t = function(t, n, r) {
  26875. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26876. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26877. e++,
  26878. e === i.length && (this.overlayTilesLoaded = !0)
  26879. }
  26880. .bind(this)
  26881. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  26882. i.forEach(function(e) {
  26883. this.tileDownloader.loadImage(e[0], 0, e[1])
  26884. }
  26885. .bind(this)),
  26886. this.usingTileOverlay = !0
  26887. } else
  26888. this.usingTileOverlay = !1
  26889. }
  26890. ,
  26891. l.prototype.bindEvents = function() {
  26892. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26893. }
  26894. ,
  26895. l.prototype.setupZoomRenderTarget = function() {
  26896. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26897. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26898. return;
  26899. var e = this.zoomRenderTarget;
  26900. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  26901. e) {
  26902. var t = e.width
  26903. , i = this.zoomRenderTarget.width;
  26904. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26905. e.texture.dispose(),
  26906. e.texture.loaded = !1,
  26907. e.texture.version = 0,
  26908. this.sceneRenderer.deallocateCubeTexture(e.texture),
  26909. e.texture = null
  26910. }
  26911. this.zoomPanoRenderingDisabled = !1
  26912. } else
  26913. this.zoomPanoRenderingDisabled = !0
  26914. }
  26915. ,
  26916. l.prototype.enableUltraHighQualityMode = function(e) {
  26917. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  26918. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  26919. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  26920. t && (this.qualityManager.enableUltraHighQualityMode(),
  26921. this.setupZoomRenderTarget(),
  26922. e())
  26923. }
  26924. .bind(this))
  26925. }
  26926. }
  26927. ,
  26928. l.prototype.activateTiledPano = function(e, t, i) {
  26929. i && this.clearAllQueuedUploads();
  26930. for (var n = 0; n < C.FACES_PER_PANO; n++)
  26931. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  26932. this.linkAllTilesAndNodes(e);
  26933. var r = this.getActiveRenderTargetDescriptor(e.id)
  26934. , l = t;
  26935. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  26936. !r || l !== r.size) {
  26937. if (r && s(r.renderTarget),
  26938. r = a(l),
  26939. !r) {
  26940. var c = this.initTiledPano(l, !1);
  26941. r = o(c.width),
  26942. r.renderTarget = c
  26943. }
  26944. r.pano = e,
  26945. this.resetPanoDescriptor(e.id),
  26946. this.resetPanoLODDescriptors(e.id),
  26947. this.resetRenderStatus(e.id, !0, !0)
  26948. }
  26949. this.setActiveRenderTargetDescriptor(e.id, r);
  26950. var h = i ? 0 : 1;
  26951. return this.updateActivePanos(e, h),
  26952. r.renderTarget
  26953. }
  26954. ,
  26955. l.prototype.deactivateTiledPano = function(e) {
  26956. var t = this.getActiveRenderTargetDescriptor(e.id);
  26957. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  26958. this.setActiveRenderTargetDescriptor(e.id, null);
  26959. var i = this.getUploadQueueForPano(e.id);
  26960. this.clearUploadQueue(i),
  26961. this.updateActivePanos()
  26962. }
  26963. ,
  26964. l.prototype.updateActivePanos = function() {
  26965. var e = [];
  26966. return function(t, i) {
  26967. e.length = 0;
  26968. for (var n = 0; n < this.activePanos.length; n++) {
  26969. t && e.length === i && e.push(t);
  26970. var r = this.activePanos[n]
  26971. , o = this.getActiveRenderTargetDescriptor(r.id);
  26972. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  26973. }
  26974. t && i >= e.length && e.push(t),
  26975. this.activePanos.length = 0,
  26976. this.activePanos.push.apply(this.activePanos, e)
  26977. }
  26978. }(),
  26979. l.prototype.getActivePanoCount = function() {
  26980. return this.activePanos.length
  26981. }
  26982. ,
  26983. l.prototype.resetRenderStatus = function(e, t, i, n) {
  26984. var r = null;
  26985. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26986. for (var o = function(e, n, r, o) {
  26987. i && (n.tile.zoomUploaded = !1),
  26988. t && (n.tile.uploaded = !1)
  26989. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26990. var s = this.getTileTree(e, a);
  26991. s.breadthFirst({
  26992. callback: o.bind(this, a),
  26993. minLevel: r
  26994. })
  26995. }
  26996. }
  26997. ,
  26998. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26999. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27000. t.tile.zoomUploaded = t.tile.uploaded,
  27001. t.zoomCovered = t.covered
  27002. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27003. var r = this.getTileTree(e, n);
  27004. r.breadthFirst({
  27005. callback: i.bind(this, n),
  27006. maxLevel: t
  27007. })
  27008. }
  27009. }
  27010. ,
  27011. l.prototype.renderPanoTiles = function() {
  27012. var e = [];
  27013. return function(t, i, n, r) {
  27014. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27015. i = i || this.direction || v.FORWARD;
  27016. var o = this.getActiveRenderTargetDescriptor(t);
  27017. if (!this.isRenderTargetDescriptorValid(o))
  27018. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27019. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27020. var s = this.getTileTree(t, a);
  27021. e.length = 0,
  27022. s.breadthFirst({
  27023. saveVisited: e
  27024. });
  27025. for (var l = 0; l < e.length; l++) {
  27026. var c = e[l];
  27027. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27028. }
  27029. }
  27030. this.updateDirection(i)
  27031. }
  27032. }(),
  27033. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27034. return e && e.renderTarget
  27035. }
  27036. ,
  27037. l.prototype.isPanoActive = function(e) {
  27038. var t = this.getActiveRenderTargetDescriptor(e);
  27039. return this.isRenderTargetDescriptorValid(t)
  27040. }
  27041. ,
  27042. l.prototype.isPanoZoomed = function(e) {
  27043. return this.zoomingActive && this.zoomPanoId === e
  27044. }
  27045. ,
  27046. l.prototype.initTileTree = function(e, t, i) {
  27047. var n = this.tileTrees[e];
  27048. n || (n = [],
  27049. this.tileTrees[e] = n);
  27050. var r = n[t];
  27051. if (!r) {
  27052. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27053. r = new A(C.TILE_SIZE,o),
  27054. n[t] = r
  27055. }
  27056. }
  27057. ,
  27058. l.prototype.getTileTree = function(e, t) {
  27059. var i = this.tileTrees[e];
  27060. if (!i)
  27061. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27062. var n = i[t];
  27063. if (!n)
  27064. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27065. return n
  27066. }
  27067. ,
  27068. l.prototype.initTiledPano = function(e, t) {
  27069. var i = this.sceneRenderer.renderer
  27070. , n = (i.context,
  27071. new h.WebGLRenderTargetCube(e,e,{
  27072. stencilBuffer: !1
  27073. }))
  27074. , r = new h.CubeTexture([]);
  27075. n.texture = r,
  27076. r.image = [null, null, null, null, null, null],
  27077. r.flipY = !0,
  27078. t ? (r.generateMipmaps = !0,
  27079. r.magFilter = h.LinearFilter,
  27080. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27081. r.magFilter = h.LinearFilter,
  27082. r.minFilter = h.LinearFilter),
  27083. r.format = h.RGBAFormat,
  27084. i.setRenderTarget(n),
  27085. i.setRenderTarget(null);
  27086. var o = i.properties.get(r);
  27087. return o.__image__webglTextureCube = o.__webglTexture,
  27088. n
  27089. }
  27090. ,
  27091. l.prototype.getUploadQueueForPano = function(e) {
  27092. var t = this.uploadQueues[e];
  27093. return t || (t = [],
  27094. this.uploadQueues[e] = t),
  27095. t
  27096. }
  27097. ,
  27098. l.prototype.isTileUploaded = function(e) {
  27099. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27100. }
  27101. ,
  27102. l.prototype.setUploaded = function(e, t) {
  27103. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27104. }
  27105. ,
  27106. l.prototype.queueTileUpload = function(e, t, i) {
  27107. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27108. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27109. var r = this.getUploadQueueForPano(e.panoId);
  27110. 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),
  27111. e.uploadQueued = !0,
  27112. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27113. }
  27114. }
  27115. ,
  27116. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27117. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27118. }
  27119. ,
  27120. l.prototype.getTopUploadQueue = function() {
  27121. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27122. for (var n = 0; n < this.activePanos.length; n++)
  27123. if (e = this.activePanos[n],
  27124. t = this.getUploadQueueForPano(e.id),
  27125. t.length > 0)
  27126. switch (i) {
  27127. case S.Base:
  27128. if (0 === t[0].level)
  27129. return t;
  27130. break;
  27131. case S.Remaining:
  27132. return t
  27133. }
  27134. return null
  27135. }
  27136. ,
  27137. l.prototype.getNextFromUploadQueue = function() {
  27138. var e = function(e) {
  27139. var t = e.shift();
  27140. return t.uploadQueued = !1,
  27141. t
  27142. };
  27143. return function() {
  27144. if (this.forceQueue.length > 0)
  27145. return e(this.forceQueue);
  27146. var t = this.getTopUploadQueue();
  27147. return t && t.length > 0 ? e(t) : null
  27148. }
  27149. }(),
  27150. l.prototype.peekNextFromUploadQueue = function() {
  27151. if (this.forceQueue.length > 0)
  27152. return this.forceQueue[0];
  27153. var e = this.getTopUploadQueue();
  27154. return e && e.length > 0 ? e[0] : null
  27155. }
  27156. ,
  27157. l.prototype.clearAllQueuedUploads = function() {
  27158. this.clearAllUploadQueues(null, 0)
  27159. }
  27160. ,
  27161. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27162. this.clearAllUploadQueues(e, 0)
  27163. }
  27164. ,
  27165. l.prototype.clearAllUploadQueues = function(e, t) {
  27166. if (e)
  27167. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27168. this.clearUploadQueue(this.forceQueue, t, e);
  27169. else {
  27170. for (var i = 0; i < this.activePanos.length; i++) {
  27171. var n = this.activePanos[i];
  27172. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27173. }
  27174. this.clearUploadQueue(this.forceQueue, t)
  27175. }
  27176. }
  27177. ,
  27178. l.prototype.clearUploadQueue = function(e, t, i) {
  27179. void 0 !== t && null !== t || (t = 0);
  27180. for (var n = 0; n < e.length; ) {
  27181. var r = e[n];
  27182. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27183. e.splice(n, 1)) : n++
  27184. }
  27185. }
  27186. ,
  27187. l.prototype.refreshUploadInterval = function() {
  27188. var e = null;
  27189. return function(t) {
  27190. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27191. null !== t && void 0 !== t || (t = w),
  27192. b || (t = _),
  27193. this.uploadInterval = window.setTimeout(e, t),
  27194. this.uploadIntervalDelay = t)
  27195. }
  27196. }(),
  27197. l.prototype.update = function() {
  27198. var e = performance.now()
  27199. , t = 0;
  27200. return function() {
  27201. this.uploadIntervalCancelled = !0,
  27202. window.clearTimeout(this.uploadInterval),
  27203. this.uploadInterval = null;
  27204. var i = performance.now() - e;
  27205. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27206. e = performance.now()),
  27207. t++
  27208. }
  27209. }(),
  27210. l.prototype.updateUploadQueue = function(e, t) {
  27211. e || (e = 1);
  27212. for (var i = 0, n = 0; ; ) {
  27213. if (n >= t || i >= e)
  27214. break;
  27215. var r = this.getNextFromUploadQueue();
  27216. if (!r)
  27217. break;
  27218. if (0 !== r.level ? i++ : n++,
  27219. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27220. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27221. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27222. }
  27223. }
  27224. }
  27225. ,
  27226. l.prototype.updateDirection = function(e) {
  27227. if (e = e || this.direction) {
  27228. this.direction = e;
  27229. for (var t = 0; t < this.activePanos.length; t++) {
  27230. var i = this.activePanos[t]
  27231. , n = this.getUploadQueueForPano(i.id);
  27232. y.sortPanoTiles(n, i, this.direction)
  27233. }
  27234. }
  27235. }
  27236. ,
  27237. l.prototype.uploadTile = function() {
  27238. var e = {}
  27239. , t = (new h.Vector4,
  27240. d.tiling.overlayStyle);
  27241. return function(i, n) {
  27242. var r = i.panoId
  27243. , o = i.image
  27244. , a = i.tileSize
  27245. , s = i.panoSize
  27246. , l = i.tileIndex
  27247. , c = (i.faceTileIndex,
  27248. i.totalTiles)
  27249. , u = (i.face,
  27250. i.tileX)
  27251. , d = i.tileY
  27252. , p = !0
  27253. , g = !1
  27254. , m = (this.getPanoDescriptor(r),
  27255. this.getPanoLODDescriptor(r, s))
  27256. , v = this.getActiveRenderTargetDescriptor(r)
  27257. , A = v.renderTarget
  27258. , y = v.size;
  27259. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27260. y = this.qualityManager.getMaxZoomPanoSize()),
  27261. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27262. g = !1),
  27263. n || (this.anyUploaded(i.node) && (p = !1,
  27264. g = !0),
  27265. this.isTileUploaded(i) && (p = !1,
  27266. g = !1)),
  27267. p) {
  27268. var C = u * a
  27269. , I = d * a
  27270. , E = a / s * y
  27271. , b = C / s * y
  27272. , w = I / s * y;
  27273. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27274. var _ = e[a];
  27275. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  27276. 1 === t || 2 === t) {
  27277. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27278. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27279. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27280. } else
  27281. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27282. m.uploadCount++,
  27283. this.emit(f.TileRenderSuccess, r, s, l, c),
  27284. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27285. this.setUploaded(i, !0),
  27286. this.addCoverageForNode(i.node)
  27287. } else
  27288. this.setUploaded(i, !1);
  27289. return i.uploadAttempted || (m.uploadAttempts++,
  27290. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27291. i.uploadAttempted = !0,
  27292. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27293. g
  27294. }
  27295. }(),
  27296. l.prototype.linkTileAndNode = function(e, t) {
  27297. t.tile = e,
  27298. e.node = t
  27299. }
  27300. ,
  27301. l.prototype.linkAllTilesAndNodes = function(e) {
  27302. for (var t = function(t, i, n, r, o) {
  27303. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27304. this.linkTileAndNode(a, n)
  27305. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27306. var n = this.getTileTree(e.id, i);
  27307. n.breadthFirst({
  27308. callback: t.bind(this, n, i)
  27309. })
  27310. }
  27311. }
  27312. ,
  27313. l.prototype.anyUploaded = function(e) {
  27314. if (!e)
  27315. return !1;
  27316. if (e.tile && this.isTileUploaded(e.tile))
  27317. return !0;
  27318. if (e.children)
  27319. for (var t = 0; t < e.children.length; t++) {
  27320. var i = e.children[t];
  27321. if (this.anyUploaded(i))
  27322. return !0
  27323. }
  27324. return !1
  27325. }
  27326. ,
  27327. l.prototype.setNodeCovered = function(e, t) {
  27328. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27329. }
  27330. ,
  27331. l.prototype.isNodeCovered = function(e) {
  27332. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27333. }
  27334. ,
  27335. l.prototype.addCoverageForNode = function(e) {
  27336. if (this.setNodeCovered(e, !0),
  27337. e.parent && e.covered) {
  27338. var t = e.parent;
  27339. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27340. }
  27341. }
  27342. ,
  27343. l.prototype.calcFullCoverage = function(e) {
  27344. var t = !1;
  27345. if (e.children)
  27346. for (var i = 0; i < e.children.length; i++) {
  27347. var n = e.children[i];
  27348. t = t || this.calcFullCoverage(n)
  27349. }
  27350. e.covered = e.tile.uploaded || t
  27351. }
  27352. ,
  27353. l.prototype.nodeSubcovered = function(e) {
  27354. if (!e.children)
  27355. return !1;
  27356. for (var t = 0; t < e.children.length; t++)
  27357. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27358. return !1;
  27359. return !0
  27360. }
  27361. ,
  27362. l.prototype.resetPanoDescriptor = function(e) {
  27363. this.getPanoDescriptor(e)
  27364. }
  27365. ,
  27366. l.prototype.getPanoDescriptor = function(e) {
  27367. var t = this.panoDescriptors[e];
  27368. return t || (t = {},
  27369. this.panoDescriptors[e] = t),
  27370. t
  27371. }
  27372. ,
  27373. l.prototype.resetPanoLODDescriptors = function(e) {
  27374. var t = this.getPanoLODDescriptors(e);
  27375. for (var i in t)
  27376. if (t.hasOwnProperty(i)) {
  27377. var n = t[i];
  27378. n.uploadCount = 0,
  27379. n.uploadAttempts = 0
  27380. }
  27381. }
  27382. ,
  27383. l.prototype.getPanoLODDescriptor = function(e, t) {
  27384. var i = this.getPanoLODDescriptors(e)
  27385. , n = i[t];
  27386. return n || (n = {
  27387. uploadCount: 0,
  27388. uploadAttempts: 0
  27389. },
  27390. i[t] = n),
  27391. n
  27392. }
  27393. ,
  27394. l.prototype.getPanoLODDescriptors = function(e) {
  27395. var t = this.panoLODDescriptors[e];
  27396. return t || (t = {},
  27397. this.panoLODDescriptors[e] = t),
  27398. t
  27399. }
  27400. ,
  27401. l.prototype.onTileDownloaded = function(e) {
  27402. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27403. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27404. if (i.downloaded = !0,
  27405. i.image = e.image,
  27406. i.panoSize = e.panoSize,
  27407. i.tileX = e.tileX,
  27408. i.tileY = e.tileY,
  27409. i.totalTiles = e.totalTiles,
  27410. i.tileIndex = e.tileIndex,
  27411. i.faceTileIndex = e.faceTileIndex,
  27412. i.face = e.face,
  27413. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27414. i.panoId = e.panoId,
  27415. i.tileSize = e.tileSize,
  27416. i.direction = (new h.Vector3).copy(e.direction),
  27417. i.node = null,
  27418. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27419. this.isPanoActive(i.panoId)) {
  27420. var n = this.getTileTree(i.panoId, i.face)
  27421. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27422. this.linkTileAndNode(i, r),
  27423. this.queueTileUpload(i, !0)
  27424. }
  27425. }
  27426. ,
  27427. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27428. var r = this.tileDirectory[e];
  27429. r || (r = {},
  27430. this.tileDirectory[e] = r);
  27431. var o = 16384 * t + 1024 * i + n
  27432. , a = r[o];
  27433. return a || (a = {
  27434. downloaded: !1,
  27435. uploaded: !1,
  27436. zoomUploaded: !1
  27437. },
  27438. r[o] = a),
  27439. a._key = e + ":" + t + ":" + i + ":" + n,
  27440. a._tileKey = o,
  27441. a
  27442. }
  27443. ,
  27444. l.prototype.setZoomingActive = function(e, t, i) {
  27445. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27446. this.zoomPanoId = t.id,
  27447. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27448. }
  27449. ,
  27450. l.prototype.updateZoomedPanoFromBase = function(e) {
  27451. if (!this.zoomPanoRenderingDisabled) {
  27452. var t = this.getActiveRenderTargetDescriptor(e.id);
  27453. if (t && t.renderTarget) {
  27454. var i = this.qualityManager.getMaxZoomPanoSize()
  27455. , n = t.renderTarget
  27456. , r = t.size;
  27457. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27458. this.copyBaseRenderStatusToZoomed(e.id)
  27459. }
  27460. }
  27461. }
  27462. ,
  27463. t.exports = l
  27464. }
  27465. , {
  27466. "../enum/GLCubeFaces": 25,
  27467. "../enum/PanoRendererEvents": 35,
  27468. "../enum/PanoSizeClass": 36,
  27469. "../enum/SceneRendererEvents": 43,
  27470. "../enum/TileDownloaderEvents": 45,
  27471. "../enum/Vectors": 50,
  27472. "../exception/BasicException": 55,
  27473. "../objects/Panorama": 148,
  27474. "../settings": 166,
  27475. "../util/browser": 182,
  27476. "../util/panorama": 191,
  27477. "./TileDownloader": 171,
  27478. "./TilePrioritizer": 172,
  27479. "./TileTree": 173,
  27480. "./TileUtils": 174,
  27481. events: 202,
  27482. three: 217
  27483. }],
  27484. 170: [function(e, t, i) {
  27485. "use strict";
  27486. function n(e, t, i) {
  27487. this.maxNavPanoSize = -1,
  27488. this.maxZoomPanoSize = -1,
  27489. this.devicePixelDensity = e,
  27490. this.deviceScreenSize = t,
  27491. this.clientBandwidth = i,
  27492. this.panoSizeClassMap = {},
  27493. this.useHighResolutionPanos = !0,
  27494. this.useUltraHighResolutionPanos = !1,
  27495. this.modelHasUltraHighPanos = !1
  27496. }
  27497. var r = e("../enum/PanoSizeClass")
  27498. , o = e("../settings")
  27499. , a = e("../util/browser")
  27500. , s = e("../constants")
  27501. , l = e("../util/showcase")
  27502. , c = e("../enum/ModelManagerEvents");
  27503. n.prototype.init = function(e) {
  27504. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27505. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27506. this.highSize = this.getPanoSize(r.HIGH),
  27507. this.standardSize = this.getPanoSize(r.STANDARD),
  27508. this.baseSize = this.getPanoSize(r.BASE),
  27509. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27510. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27511. this.updateMaximums(),
  27512. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27513. }
  27514. ,
  27515. n.prototype.updateFromModel = function(e) {
  27516. this.updateHighResolutionSettings(e),
  27517. this.updateUltraHighResolutionSettings(e)
  27518. }
  27519. ,
  27520. n.prototype.updateHighResolutionSettings = function(e) {
  27521. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27522. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27523. //this.useHighResolutionPanos = !0;
  27524. //----------------------e n d -----------------------------------------------------------------
  27525. this.updateMaximums()
  27526. }
  27527. ,
  27528. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27529. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27530. this.updateMaximums()
  27531. }
  27532. ,
  27533. n.prototype.enableUltraHighQualityMode = function() {
  27534. this.modelHasUltraHighPanos = !0,
  27535. this.updateUltraHighResolutionSettings(null)
  27536. }
  27537. ,
  27538. n.prototype.ultraHighQualityModeEnabled = function() {
  27539. return this.modelHasUltraHighPanos
  27540. }
  27541. ,
  27542. n.prototype.onModelChanged = function(e) {
  27543. this.updateFromModel(e.model),
  27544. this.updateMaximums()
  27545. }
  27546. ,
  27547. n.prototype.updateMaximums = function() {
  27548. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27549. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27550. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27551. }
  27552. ,
  27553. n.prototype.buildPanoSizeClassMap = function() {
  27554. this.panoSizeClassMap[r.BASE] = 512,
  27555. this.panoSizeClassMap[r.STANDARD] = 1024,
  27556. this.panoSizeClassMap[r.HIGH] = 2048,
  27557. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27558. }
  27559. ,
  27560. n.prototype.getPanoSize = function(e) {
  27561. return this.panoSizeClassMap[e]
  27562. }
  27563. ,
  27564. n.prototype.getMaxPossiblePanoSize = function() {
  27565. return this.getPanoSize(r.ULTRAHIGH)
  27566. }
  27567. ,
  27568. n.prototype.getMaxPanoSize = function() {
  27569. return this.maxZoomPanoSize
  27570. }
  27571. ,
  27572. n.prototype.getMaxNavPanoSize = function() {
  27573. return this.maxNavPanoSize
  27574. }
  27575. ,
  27576. n.prototype.getMaxZoomPanoSize = function() {
  27577. return this.maxZoomPanoSize
  27578. }
  27579. ,
  27580. n.prototype.detectMaxNavPanoSizeClass = function() {
  27581. if(settings.mobileNavHigh)return r.HIGH //改
  27582. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27583. }
  27584. ,
  27585. n.prototype.detectMaxNavPanoSize = function() {
  27586. var e = this.detectMaxNavPanoSizeClass();
  27587. return this.getPanoSize(e)
  27588. }
  27589. ,
  27590. n.prototype.detectMaxZoomPanoSize = function() {
  27591. 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)
  27592. }
  27593. ,
  27594. t.exports = n
  27595. }
  27596. , {
  27597. "../constants": 8,
  27598. "../enum/ModelManagerEvents": 33,
  27599. "../enum/PanoSizeClass": 36,
  27600. "../settings": 166,
  27601. "../util/browser": 182,
  27602. "../util/showcase": 193
  27603. }],
  27604. 171: [function(e, t, i) {
  27605. (function(i) {
  27606. "use strict";
  27607. function n(e) {
  27608. this.panos = null,
  27609. this.retryMinimumTime = 1e4,
  27610. this.urls = null,
  27611. this.panoLoadCallbacks = {},
  27612. this.downloadDescriptors = {},
  27613. this.priorityQueue = [],
  27614. this.forceQueue = [],
  27615. this.activeDownloads = [],
  27616. this.qualityManager = null,
  27617. this.tilePrioritizer = null,
  27618. this.refreshInterval = null,
  27619. this.processPriorityQueue = !1,
  27620. this.concurrentDownloads = e.concurrentDownloads || 1,
  27621. this.downloadTestResults = {}
  27622. }
  27623. var r = e("three")
  27624. , o = (e("../enum/Viewmode"),
  27625. e("../settings"))
  27626. , a = (e("../objects/Panorama"),
  27627. e("../util/logger"))
  27628. , s = (e("../enum/Vectors"),
  27629. e("../enum/PanoSizeClass"),
  27630. e("../enum/TileDownloaderEvents"))
  27631. , l = e("./TilePrioritizer")
  27632. , c = e("./TileUtils")
  27633. , h = (e("../enum/GLCubeFaces"),
  27634. e("../enum/DownloadStatus"))
  27635. , u = e("../util/panorama")
  27636. , d = e("../util/ajax")
  27637. , p = e("../ab")
  27638. , f = e("events").EventEmitter
  27639. , g = (new a(i),
  27640. Object.freeze({
  27641. Testing: 1,
  27642. Success: 2,
  27643. Fail: 3
  27644. }));
  27645. n.prototype = Object.create(f.prototype),
  27646. n.IDLE_REFRESH_DELAY = 500,
  27647. n.ACTIVE_REFRESH_DELAY = 16,
  27648. n.DOWNLOAD_RETRIES = 4,
  27649. n.prototype.init = function(e) {
  27650. this.qualityManager = e
  27651. }
  27652. ,
  27653. n.prototype.setUrls = function(e) {
  27654. this.urls = e
  27655. }
  27656. ,
  27657. n.prototype.setPanoData = function(e, t, i) {
  27658. this.panos = e,
  27659. this.imagePanos = t,
  27660. this.panoGroupId = i
  27661. }
  27662. ,
  27663. n.prototype.start = function() {
  27664. this.refreshUpdateInterval(0)
  27665. }
  27666. ,
  27667. n.prototype.stop = function() {
  27668. window.cancel(this.refreshInterval)
  27669. }
  27670. ,
  27671. n.prototype.refreshUpdateInterval = function(e) {
  27672. e || (e = 0),
  27673. this.refreshInterval = window.setTimeout(function() {
  27674. var e = this.update();
  27675. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27676. }
  27677. .bind(this), e)
  27678. }
  27679. ,
  27680. n.prototype.update = function() {
  27681. var e = this.forceQueue.length > 0;
  27682. return this.processQueueForDownloading(this.forceQueue),
  27683. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27684. this.priorityQueue.length > 0 && (e = !0),
  27685. this.processQueueForDownloading(this.priorityQueue)),
  27686. e
  27687. }
  27688. ,
  27689. n.prototype.forceQueueTilesForPano = function() {
  27690. var e = []
  27691. , t = [];
  27692. return function(i, n, r, o, a, s) {
  27693. e.length = 0;
  27694. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27695. var p = u[d];
  27696. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27697. }
  27698. if (r && e.length > 0) {
  27699. l.sortPanoTiles(e, i, r),
  27700. t.length = 0,
  27701. c.matchingTilesInDirection(i, n, r, o, a, t);
  27702. for (var f = 0, g = function(e) {
  27703. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27704. }; f < e.length; ) {
  27705. var m = e[f]
  27706. , v = t.findIndex(g);
  27707. v < 0 ? e.splice(f, 1) : f++
  27708. }
  27709. }
  27710. for (var A = 0; A < e.length; A++)
  27711. this.forceQueue.push(e[A]);
  27712. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27713. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27714. s && this.processQueueForDownloading(this.forceQueue, !0)
  27715. }
  27716. }(),
  27717. n.prototype.clearForceQueue = function() {
  27718. this.clearQueue(this.forceQueue)
  27719. }
  27720. ,
  27721. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27722. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27723. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27724. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27725. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27726. }
  27727. ,
  27728. n.prototype.clearQueue = function(e) {
  27729. this.setStatusForAllDescriptors(e, h.None),
  27730. e.length = 0
  27731. }
  27732. ,
  27733. n.prototype.clearFromQueue = function(e, t, i) {
  27734. for (var n = 0; n < e.length; n++) {
  27735. var r = e[n];
  27736. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27737. }
  27738. }
  27739. ,
  27740. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27741. for (var i = 0; i < e.length; i++) {
  27742. var n = e[i];
  27743. n && (n.status = t)
  27744. }
  27745. }
  27746. ,
  27747. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27748. for (var i = 0; i < e.length; i++) {
  27749. var n = e[i];
  27750. n && (n.status !== t ? n.status = t : e[i] = null)
  27751. }
  27752. }
  27753. ,
  27754. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27755. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27756. , n = i[t];
  27757. return n || (n = this.buildDownloadDescriptorArray(t),
  27758. i[t] = n,
  27759. this.initTileDownloadDescriptors(n, e, t)),
  27760. n
  27761. }
  27762. ,
  27763. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27764. var t = this.downloadDescriptors[e.id];
  27765. return t || (t = {},
  27766. this.downloadDescriptors[e.id] = t),
  27767. t
  27768. }
  27769. ,
  27770. n.prototype.processQueueForDownloading = function(e, t) {
  27771. if (this.cleanupActiveDownloads(),
  27772. this.activeDownloads.length < this.concurrentDownloads || t)
  27773. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27774. var o = e.shift();
  27775. o && (this.startDownload(o),
  27776. n++)
  27777. }
  27778. }
  27779. ,
  27780. n.prototype.testDownload = function(e, t, i) {
  27781. var n = this.downloadTestResults[e];
  27782. if (n)
  27783. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27784. this.downloadTestResults[e] = g.Testing;
  27785. var r = this.panos.list[0]
  27786. , o = this.getTileUrl(r.id, e, t, 0)
  27787. , a = function(t) {
  27788. this.downloadTestResults[e] = g.Success,
  27789. i(!0)
  27790. }
  27791. .bind(this)
  27792. , s = function() {
  27793. this.downloadTestResults[e] = g.Fail,
  27794. i(!1)
  27795. }
  27796. .bind(this);
  27797. this.loadImage(o, 0, a, s)
  27798. }
  27799. ,
  27800. n.prototype.startDownload = function(e) {
  27801. e.status = h.Downloading;
  27802. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27803. this.activeDownloads.push(e),
  27804. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27805. }
  27806. ,
  27807. n.prototype.downloadFailed = function(e, t) {}
  27808. ,
  27809. n.prototype.downloadComplete = function(e, t) {
  27810. if (e.panoGroupId === this.panoGroupId) {
  27811. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27812. e.status = h.Downloaded,
  27813. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27814. var n = {
  27815. panoId: e.pano.id,
  27816. image: t,
  27817. tileSize: e.tileSize,
  27818. panoSize: e.panoSize,
  27819. tileIndex: e.tileIndex,
  27820. faceTileIndex: e.faceTileIndex,
  27821. totalTiles: e.totalTiles,
  27822. face: e.face,
  27823. tileX: e.tileX,
  27824. tileY: e.tileY,
  27825. direction: e.direction
  27826. };
  27827. e.image = t,
  27828. this.emit(s.TileDownloadSuccess, n),
  27829. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  27830. panoId: e.pano.id,
  27831. tileSize: e.tileSize,
  27832. panoSize: e.panoSize
  27833. },
  27834. this.emit(s.PanoDownloadComplete, n),
  27835. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  27836. }
  27837. }
  27838. ,
  27839. n.prototype.cleanupActiveDownloads = function() {
  27840. var e = [];
  27841. return function() {
  27842. e.length = 0;
  27843. for (var t = 0; t < this.activeDownloads.length; t++) {
  27844. var i = this.activeDownloads[t];
  27845. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  27846. }
  27847. this.activeDownloads.length = 0,
  27848. this.activeDownloads.push.apply(this.activeDownloads, e)
  27849. }
  27850. }(),
  27851. n.prototype.isPanoDownloaded = function(e, t) {
  27852. var i = this.getTileDownloadDescriptors(e, t);
  27853. if (i.length <= 0)
  27854. return !1;
  27855. for (var n = 0; n < i.length; n++) {
  27856. var r = i[n];
  27857. if (r.status !== h.Downloaded)
  27858. return !1
  27859. }
  27860. return !0
  27861. }
  27862. ,
  27863. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  27864. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  27865. this.panoLoadCallbacks[o] = {
  27866. onLoad: i,
  27867. onFail: n,
  27868. onProgress: r
  27869. }
  27870. }
  27871. ,
  27872. n.prototype.getPanoLoadCallbacks = function(e, t) {
  27873. var i = e.id + ":" + t;
  27874. return this.panoLoadCallbacks[i]
  27875. }
  27876. ,
  27877. n.prototype.buildDownloadDescriptorArray = function(e) {
  27878. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  27879. var r = this.buildDownloadDescriptor();
  27880. i.push(r)
  27881. }
  27882. return i
  27883. }
  27884. ,
  27885. n.prototype.buildDownloadDescriptor = function() {
  27886. var e = {
  27887. panoGroupId: null,
  27888. pano: null,
  27889. panoSize: -1,
  27890. tileSize: -1,
  27891. tileIndex: -1,
  27892. totalTiles: -1,
  27893. faceTileIndex: -1,
  27894. status: h.None,
  27895. url: null,
  27896. image: null,
  27897. direction: new r.Vector3,
  27898. face: -1,
  27899. cubeFace: -1,
  27900. tileX: -1,
  27901. tileY: -1
  27902. };
  27903. return e
  27904. }
  27905. ,
  27906. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  27907. for (var n = 0; n < e.length; n++) {
  27908. var r = e[n];
  27909. this.initTileDownloadDescriptor(r, t, i, n)
  27910. }
  27911. }
  27912. ,
  27913. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  27914. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  27915. e.face = c.getFaceForTile(i, n),
  27916. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  27917. e.panoGroupId = this.panoGroupId,
  27918. e.pano = t,
  27919. e.panoSize = i,
  27920. e.tileSize = r,
  27921. e.tileIndex = n,
  27922. e.totalTiles = c.getTileCountForSize(i),
  27923. e.status = h.None,
  27924. e.image = null,
  27925. c.getTileLocation(e.panoSize, e.tileIndex, e),
  27926. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  27927. }
  27928. ,
  27929. n.prototype.getTileUrl = function() {
  27930. var e = {
  27931. 256: "256",
  27932. 512: "512",
  27933. 1024: "1k",
  27934. 2048: "2k",
  27935. 4096: "4k"
  27936. }
  27937. , t = {
  27938. face: -1,
  27939. faceTileIndex: -1,
  27940. tileX: -1,
  27941. tileY: -1
  27942. };
  27943. return function(i, n, r, a) {
  27944. c.getTileLocation(n, a, t);
  27945. var s = Math.floor(n / r)
  27946. , l = s * s
  27947. , h = Math.floor(a / l)
  27948. , u = "";
  27949. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  27950. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  27951. return d = p.changeIfTileGenerating(d)
  27952. }
  27953. }(),
  27954. n.prototype.loadImage = function(e, t, i, n) {
  27955. d.getImage(e, t).then(function(e) {
  27956. i(e)
  27957. }).fail(n)
  27958. }
  27959. ,
  27960. t.exports = n
  27961. }
  27962. ).call(this, "/js/tile/TileDownloader.js")
  27963. }
  27964. , {
  27965. "../ab": 3,
  27966. "../enum/DownloadStatus": 24,
  27967. "../enum/GLCubeFaces": 25,
  27968. "../enum/PanoSizeClass": 36,
  27969. "../enum/TileDownloaderEvents": 45,
  27970. "../enum/Vectors": 50,
  27971. "../enum/Viewmode": 51,
  27972. "../objects/Panorama": 148,
  27973. "../settings": 166,
  27974. "../util/ajax": 181,
  27975. "../util/logger": 189,
  27976. "../util/panorama": 191,
  27977. "./TilePrioritizer": 172,
  27978. "./TileUtils": 174,
  27979. events: 202,
  27980. three: 217
  27981. }],
  27982. 172: [function(e, t, i) {
  27983. (function(i) {
  27984. "use strict";
  27985. function n(e, t, i, o, a) {
  27986. this.qualityManager = e,
  27987. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27988. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27989. this.baseSize = t,
  27990. this.standardSize = i,
  27991. this.highSize = o,
  27992. this.ultraHighSize = a,
  27993. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27994. }
  27995. var r = e("three")
  27996. , o = (e("../enum/Viewmode"),
  27997. e("../settings"),
  27998. e("../settings"),
  27999. e("../objects/Panorama"))
  28000. , a = e("../util/logger")
  28001. , s = (e("../enum/Vectors"),
  28002. e("../enum/PanoSizeClass"),
  28003. e("../enum/ModelManagerEvents"),
  28004. e("../enum/GLCubeFaces"),
  28005. e("../enum/DownloadStatus"))
  28006. , l = (e("../util/browser"),
  28007. e("./TileUtils"))
  28008. , c = e("../util/math")
  28009. , h = (e("events").EventEmitter,
  28010. new a(i),
  28011. Object.freeze({
  28012. None: 0,
  28013. DirectionalFOV: 1
  28014. }));
  28015. n.PriorityCriteria = function(e, t, i, n, o) {
  28016. this.pano = e,
  28017. this.cameraPosition = (new r.Vector3).copy(t),
  28018. this.cameraDir = (new r.Vector3).copy(i),
  28019. this.panoSpaceDir = (new r.Vector3).copy(n),
  28020. this.upcomingPanos = o,
  28021. this.copy = function(e) {
  28022. this.pano = e.pano,
  28023. this.cameraPosition.copy(e.cameraPosition),
  28024. this.cameraDir.copy(e.cameraDir),
  28025. this.panoSpaceDir.copy(e.panoSpaceDir),
  28026. this.upcomingPanos = o
  28027. }
  28028. ,
  28029. this.zoomingActive = !1
  28030. }
  28031. ,
  28032. n.DIRECTIONAL_FOV = 180,
  28033. n.DIRECTIONAL_FOV_NARROW = 120,
  28034. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28035. n.MAX_SCORED_PANOS_TOADD = 2,
  28036. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28037. n.DIRECTION_SCORE_STRICTNESS = .75,
  28038. n.appendQueue = function(e, t) {
  28039. if (e && t)
  28040. for (var i = 0; i < t.length; i++)
  28041. e.push(t[i])
  28042. }
  28043. ,
  28044. n.prototype.updateCriteria = function(e, t, i, n) {
  28045. this.priorityCriteria.pano = e,
  28046. this.priorityCriteria.cameraPosition.copy(t),
  28047. this.priorityCriteria.cameraDir.copy(i),
  28048. this.priorityCriteria.upcomingPanos = n,
  28049. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28050. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28051. }
  28052. ,
  28053. n.prototype.filterAndPrioritize = function() {
  28054. var e = []
  28055. , t = []
  28056. , i = [];
  28057. return function(r, o, a) {
  28058. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28059. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28060. var s = this.baseSize
  28061. , l = this.standardSize
  28062. , c = this.highSize
  28063. , h = this.ultraHighSize;
  28064. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28065. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28066. i.length = 0,
  28067. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28068. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28069. n.appendQueue(r, i),
  28070. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28071. i.length = 0,
  28072. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28073. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28074. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28075. n.appendQueue(r, i),
  28076. i.length = 0,
  28077. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28078. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28079. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28080. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28081. n.appendQueue(r, i),
  28082. this.queueTilesForPanos(r, e, a, s)
  28083. }
  28084. }(),
  28085. n.prototype.canDownloadSize = function(e) {
  28086. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28087. }
  28088. ,
  28089. n.prototype.populateNeighborPanos = function(e, t, i) {
  28090. i = i || [],
  28091. i.length = 0;
  28092. var n = t.getNeighbours(e);
  28093. for (var r in n)
  28094. if (n.hasOwnProperty(r)) {
  28095. var o = t.get(r);
  28096. i.push(o)
  28097. }
  28098. return i
  28099. }
  28100. ,
  28101. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28102. i = i || [],
  28103. i.length = 0;
  28104. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28105. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28106. , c = t.sortByScore(s, l);
  28107. if (c)
  28108. for (var h = 0; h < c.length && h < a; h++) {
  28109. var u = c[h].pano;
  28110. i.push(u)
  28111. }
  28112. return i
  28113. }
  28114. ,
  28115. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28116. for (var o = 0, a = 0; a < t.length; a++) {
  28117. var s = t[a]
  28118. , l = this.queueTilesForPano(e, i, s, n);
  28119. if (o += l > 0 ? 1 : 0,
  28120. r && o >= r)
  28121. break
  28122. }
  28123. return o
  28124. }
  28125. ,
  28126. n.prototype.queueTilesForPano = function() {
  28127. var e = {
  28128. filter: h.None
  28129. };
  28130. return function(t, i, n, r) {
  28131. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28132. }
  28133. }(),
  28134. n.prototype.queueTilesForPanosInDirection = function() {
  28135. var e = new r.Vector3;
  28136. return function(t, i, n, r, o, a, s, l) {
  28137. for (var h = 0, u = 0; u < n.length; u++) {
  28138. var d = n[u];
  28139. e.copy(d.position),
  28140. e.sub(o),
  28141. e.normalize();
  28142. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28143. , f = c.getFOVDotThreshold(s);
  28144. if (p >= f) {
  28145. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28146. if (h += g > 0 ? 1 : 0,
  28147. l && h >= l)
  28148. break
  28149. }
  28150. }
  28151. return h
  28152. }
  28153. }(),
  28154. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28155. for (var l = 0, c = 0; c < i.length; c++) {
  28156. var h = i[c]
  28157. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28158. if (l += u > 0 ? 1 : 0,
  28159. s && l >= s)
  28160. break
  28161. }
  28162. return l
  28163. }
  28164. ,
  28165. n.prototype.queueTilesInDirectionForPano = function() {
  28166. var e = {
  28167. filter: h.DirectionalFOV,
  28168. direction: new r.Vector3,
  28169. fov: 60
  28170. }
  28171. , t = new r.Vector3;
  28172. return function(i, n, r, o, a, s, c) {
  28173. return t.copy(s),
  28174. l.getRelativeDirection(r.quaternion, t),
  28175. e.direction.copy(t),
  28176. e.fov = c,
  28177. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28178. }
  28179. }(),
  28180. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28181. var e = [];
  28182. return function(t, i, n, r, o) {
  28183. var a = i.getTileDownloadDescriptors(n, r);
  28184. e.length = 0,
  28185. this.filterTileDownloadDescriptors(n, a, e, o);
  28186. for (var s = 0, l = 0; l < e.length; l++) {
  28187. var c = e[l];
  28188. c && (t.push(c),
  28189. s++)
  28190. }
  28191. return s
  28192. }
  28193. }(),
  28194. n.prototype.filterTileDownloadDescriptors = function() {
  28195. new r.Vector3;
  28196. return function(e, t, i, n) {
  28197. var r, o;
  28198. switch (n.filter) {
  28199. case h.DirectionalFOV:
  28200. for (r = 0; r < t.length; r++)
  28201. o = t[r],
  28202. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28203. break;
  28204. default:
  28205. for (r = 0; r < t.length; r++)
  28206. o = t[r],
  28207. i.push(o)
  28208. }
  28209. for (r = 0; r < i.length; r++)
  28210. o = i[r],
  28211. this.canIncludeDescriptor(o) || (i[r] = null)
  28212. }
  28213. }(),
  28214. n.prototype.canIncludeDescriptor = function(e) {
  28215. return e.status !== s.Downloading && e.status !== s.Downloaded
  28216. }
  28217. ,
  28218. n.prototype.canIncludePano = function(e, t) {
  28219. return !e.isLoaded(t)
  28220. }
  28221. ,
  28222. n.getFOVDotThreshold = function(e) {
  28223. return Math.cos(r.Math.degToRad(e / 2))
  28224. }
  28225. ;
  28226. var u = function() {
  28227. var e = function e(t, i) {
  28228. var n = e._panoSpaceDir
  28229. , r = e._fovThreshold
  28230. , o = e._fovThresholdNarrow
  28231. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28232. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28233. return t._dot = a,
  28234. i._dot = s,
  28235. 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)
  28236. };
  28237. return e._panoSpaceDir = new r.Vector3,
  28238. e._fovThreshold = -1,
  28239. e._fovThresholdNarrow = -1,
  28240. e
  28241. }();
  28242. n.sortPanoTiles = function(e, t, i) {
  28243. u._panoSpaceDir.copy(i),
  28244. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28245. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28246. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28247. e.sort(u)
  28248. }
  28249. ,
  28250. n.insertSortedPanoTile = function(e, t, i, r) {
  28251. u._panoSpaceDir.copy(r),
  28252. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28253. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28254. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28255. for (var o = -1, a = 0; a < e.length; a++) {
  28256. var s = u(t, e[a]);
  28257. if (s <= 0) {
  28258. o = a;
  28259. break
  28260. }
  28261. }
  28262. if (o === -1)
  28263. e[e.length] = t;
  28264. else {
  28265. for (var h = e.length; h > o; h--)
  28266. e[h] = e[h - 1];
  28267. e[o] = t
  28268. }
  28269. }
  28270. ,
  28271. n.prototype.setZoomingActive = function(e) {
  28272. e !== this.zoomingActive && (this.zoomingActive = e)
  28273. }
  28274. ,
  28275. t.exports = n
  28276. }
  28277. ).call(this, "/js/tile/TilePrioritizer.js")
  28278. }
  28279. , {
  28280. "../enum/DownloadStatus": 24,
  28281. "../enum/GLCubeFaces": 25,
  28282. "../enum/ModelManagerEvents": 33,
  28283. "../enum/PanoSizeClass": 36,
  28284. "../enum/Vectors": 50,
  28285. "../enum/Viewmode": 51,
  28286. "../objects/Panorama": 148,
  28287. "../settings": 166,
  28288. "../util/browser": 182,
  28289. "../util/logger": 189,
  28290. "../util/math": 190,
  28291. "./TileUtils": 174,
  28292. events: 202,
  28293. three: 217
  28294. }],
  28295. 173: [function(e, t, i) {
  28296. "use strict";
  28297. function n(e, t) {
  28298. this.levels = t,
  28299. this.tileSize = e,
  28300. this.root = null,
  28301. this.allNodes = [],
  28302. a(this)
  28303. }
  28304. function r(e, t) {
  28305. this.tree = e,
  28306. this.parent = t,
  28307. this.children = [],
  28308. this.id = ++u
  28309. }
  28310. function o(e, t, i, r, a, s, l, h) {
  28311. if (e) {
  28312. l = l || n.TraversalType.PreOrder;
  28313. var u = r * c + i;
  28314. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28315. s && s.push(e)),
  28316. e.children && 0 !== e.children.length) {
  28317. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28318. for (var g = 0; g < c; g++)
  28319. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28320. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28321. s && s.push(e))
  28322. }
  28323. }
  28324. }
  28325. function a(e) {
  28326. e.root = s(e, null, 0)
  28327. }
  28328. function s(e, t, i) {
  28329. if (i > e.levels)
  28330. return null;
  28331. var n = new r(e,t);
  28332. e.allNodes.push(n);
  28333. for (var o = 0; o < h; o++)
  28334. n.children[o] = s(e, n, i + 1);
  28335. return n
  28336. }
  28337. function l(e, t, i, n, r) {
  28338. if (!e)
  28339. return null;
  28340. if (0 === i)
  28341. return e;
  28342. if (!e.children || 0 === e.children.length)
  28343. return null;
  28344. var o = Math.pow(c, i)
  28345. , a = o / c
  28346. , s = n % a
  28347. , h = r % a
  28348. , u = Math.floor(r / a)
  28349. , d = Math.floor(n / a)
  28350. , p = u * c + d
  28351. , f = e.children[p];
  28352. return l(f, t + 1, i - 1, s, h)
  28353. }
  28354. var c = (e("three"),
  28355. e("./TileUtils"),
  28356. e("../objects/Panorama"),
  28357. e("../util/panorama"),
  28358. e("events").EventEmitter,
  28359. 2)
  28360. , h = c * c;
  28361. n.TraversalType = Object.freeze({
  28362. PreOrder: 0,
  28363. PostOrder: 1
  28364. });
  28365. var u = 0;
  28366. n.getLevelCountForSize = function(e, t) {
  28367. var i = 0;
  28368. for (t < e && (t = e); ; ) {
  28369. if (t /= c,
  28370. t < e)
  28371. break;
  28372. i++
  28373. }
  28374. return i
  28375. }
  28376. ,
  28377. n.getSizeForLevel = function(e, t) {
  28378. return Math.pow(c, t) * e
  28379. }
  28380. ,
  28381. n.prototype.getSubNode = function(e, t, i) {
  28382. (!t || e < this.tileSize) && (t = 0),
  28383. (!i || e < this.tileSize) && (i = 0),
  28384. e < this.tileSize && (e = this.tileSize);
  28385. var r = n.getLevelCountForSize(this.tileSize, e)
  28386. , o = l(this.root, 0, r, t, i);
  28387. return o
  28388. }
  28389. ,
  28390. n.prototype.breadthFirst = function(e) {
  28391. e = e || {};
  28392. var t = !!e.nullLevelEnd
  28393. , i = e.maxLevel
  28394. , n = e.minLevel
  28395. , r = e.callback
  28396. , o = e.saveVisited
  28397. , a = []
  28398. , s = {}
  28399. , l = 0
  28400. , c = 0;
  28401. for (a.push(this.root),
  28402. a.push(s); a.length > 0 && !(i && l > i); ) {
  28403. var h = a.shift();
  28404. if (h === s)
  28405. (!n || l >= n) && (r && t && r(null),
  28406. o && t && o.push(null)),
  28407. a.length > 0 && a.push(s),
  28408. l++,
  28409. c = 0;
  28410. else {
  28411. if (h.children)
  28412. for (var u = 0; u < h.children.length; u++) {
  28413. var d = h.children[u];
  28414. d && a.push(h.children[u])
  28415. }
  28416. var p = this.getFaceIndexFromNode(h);
  28417. (!n || l >= n) && (r && r(h, l, p),
  28418. o && o.push(h)),
  28419. c++
  28420. }
  28421. }
  28422. }
  28423. ,
  28424. n.prototype.getFaceIndexFromNode = function(e) {
  28425. if (!e)
  28426. return -1;
  28427. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28428. var o = i.parent;
  28429. if (!o)
  28430. break;
  28431. for (var a = -1, s = 0; s < o.children.length; s++)
  28432. o.children[s] === i && (a = s);
  28433. var l = a % c
  28434. , h = Math.floor(a / c);
  28435. n = l * t + n,
  28436. r = h * t + r,
  28437. t *= c,
  28438. i = o
  28439. }
  28440. return r * t + n
  28441. }
  28442. ,
  28443. n.prototype.depthFirst = function(e, t, i) {
  28444. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28445. }
  28446. ,
  28447. t.exports = n
  28448. }
  28449. , {
  28450. "../objects/Panorama": 148,
  28451. "../util/panorama": 191,
  28452. "./TileUtils": 174,
  28453. events: 202,
  28454. three: 217
  28455. }],
  28456. 174: [function(e, t, i) {
  28457. "use strict";
  28458. var n = e("../enum/GLCubeFaces")
  28459. , r = e("../util/MathLight")
  28460. , o = {};
  28461. o.TILE_SIZE = 512,
  28462. o.FACES_PER_PANO = 6,
  28463. o.LocationOnTile = {
  28464. Center: 0,
  28465. UpperLeft: 1,
  28466. UpperRight: 2,
  28467. LowerRight: 3,
  28468. LowerLeft: 4
  28469. },
  28470. o.getTileVector = function() {
  28471. return function(e, t, i, a, s, l, c, h) {
  28472. l = l || o.LocationOnTile.Center;
  28473. var u = e / t
  28474. , d = a / u;
  28475. s = -s + (u - 1);
  28476. var p = s / u
  28477. , f = t / e
  28478. , g = 2 * f
  28479. , m = g / 2
  28480. , v = 2 * d - 1 + m
  28481. , A = 2 * p - 1 + m;
  28482. switch (l) {
  28483. case o.LocationOnTile.UpperLeft:
  28484. v -= m,
  28485. A += m,
  28486. v += c * g;
  28487. break;
  28488. case o.LocationOnTile.UpperRight:
  28489. v += m,
  28490. A += m,
  28491. A -= c * g;
  28492. break;
  28493. case o.LocationOnTile.LowerRight:
  28494. v += m,
  28495. A -= m,
  28496. v -= c * g;
  28497. break;
  28498. case o.LocationOnTile.LowerLeft:
  28499. v -= m,
  28500. A -= m,
  28501. A += c * g;
  28502. break;
  28503. case o.LocationOnTile.Center:
  28504. }
  28505. switch (i) {
  28506. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28507. r.setVector(h, -1, A, -v);
  28508. break;
  28509. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28510. r.setVector(h, 1, A, v);
  28511. break;
  28512. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28513. r.setVector(h, -v, 1, -A);
  28514. break;
  28515. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28516. r.setVector(h, -v, -1, A);
  28517. break;
  28518. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28519. r.setVector(h, -v, A, 1);
  28520. break;
  28521. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28522. r.setVector(h, v, A, -1)
  28523. }
  28524. r.normalize(h)
  28525. }
  28526. }(),
  28527. o.getFaceForTile = function(e, t) {
  28528. var i = o.TILE_SIZE;
  28529. e < o.TILE_SIZE && (i = e);
  28530. var n = Math.floor(e / i)
  28531. , r = n * n;
  28532. return Math.floor(t / r)
  28533. }
  28534. ,
  28535. o.getTileLocation = function(e, t, i) {
  28536. var n = o.TILE_SIZE;
  28537. e < o.TILE_SIZE && (n = e);
  28538. var r = o.getFaceForTile(e, t)
  28539. , a = Math.floor(e / n)
  28540. , s = a * a
  28541. , l = t - r * s;
  28542. i.tileX = l % a,
  28543. i.tileY = Math.floor(l / a),
  28544. i.face = r,
  28545. i.faceTileIndex = l
  28546. }
  28547. ,
  28548. o.getTileCountForSize = function(e) {
  28549. if (e <= o.TILE_SIZE)
  28550. return o.FACES_PER_PANO;
  28551. var t = Math.floor(e / o.TILE_SIZE)
  28552. , i = t * t
  28553. , n = i * o.FACES_PER_PANO;
  28554. return n
  28555. }
  28556. ,
  28557. o.getRelativeDirection = function() {
  28558. var e = new r.Matrix4
  28559. , t = new r.Quaternion;
  28560. return function(i, n) {
  28561. t.copy(i),
  28562. t.inverse(),
  28563. e.makeRotationFromQuaternion(t),
  28564. e.applyToVector3(n),
  28565. r.normalize(n)
  28566. }
  28567. }(),
  28568. o.matchingTilesInDirection = function() {
  28569. var e = new r.Vector3
  28570. , t = new r.Vector3(0,0,-1)
  28571. , i = new r.Quaternion
  28572. , n = function(e, t) {
  28573. e.push({
  28574. face: t.face,
  28575. faceTileIndex: t.faceTileIndex,
  28576. tileX: t.tileX,
  28577. tileY: t.tileY
  28578. })
  28579. }
  28580. , a = function() {
  28581. var e = {
  28582. face: -1,
  28583. faceTileIndex: -1,
  28584. tileX: -1,
  28585. tileY: -1
  28586. };
  28587. return function(t, i, r) {
  28588. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28589. o.getTileLocation(t, l, e),
  28590. i && !i(e) || (s++,
  28591. r && n(r, e));
  28592. return s
  28593. }
  28594. }();
  28595. return function(n, s, l, c, h, u) {
  28596. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28597. o.getTileCountForSize(s);
  28598. if (!c && !h)
  28599. return a(s, null, u);
  28600. var p = !!h;
  28601. if (h = h || c,
  28602. h = Math.max(0, Math.min(h, 360)),
  28603. c = Math.max(0, Math.min(c, 360)),
  28604. r.copyVector(l, e),
  28605. o.getRelativeDirection(n.quaternion, e),
  28606. p) {
  28607. i.setFromUnitVectors(e, t);
  28608. var f = function(e) {
  28609. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28610. };
  28611. return a(s, f, u)
  28612. }
  28613. var g = function(t) {
  28614. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28615. };
  28616. return a(s, g, u)
  28617. }
  28618. }(),
  28619. o.isTileWithinFrustum = function() {
  28620. var e = new r.Vector3
  28621. , t = 1e-5;
  28622. return function(i, n, a, s, l, c, h, u) {
  28623. 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++)
  28624. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28625. r.applyQuaternionToVector(c, e),
  28626. e.z >= -t)
  28627. I++;
  28628. else {
  28629. var w = -1 / e.z
  28630. , _ = e.x * w
  28631. , T = e.y * w;
  28632. T > d ? v++ : T < p && A++,
  28633. _ > f ? y++ : _ < g && C++,
  28634. E++
  28635. }
  28636. return A !== E && v !== E && y !== E && C !== E
  28637. }
  28638. }(),
  28639. o.isTileWithinFOV = function() {
  28640. var e = new r.Vector3
  28641. , t = new r.Vector3(0,1,0)
  28642. , i = new r.Vector3(1,0,0);
  28643. return function(n, a, s, l, c, h, u) {
  28644. var d = o.mapFaceToCubemapFace(s);
  28645. if (r.cross(h, t, i),
  28646. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28647. o.isWithinFOV(e, h, u, null))
  28648. return !0;
  28649. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28650. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28651. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28652. o.isWithinFOV(e, h, u, null))
  28653. return !0;
  28654. g += p
  28655. }
  28656. return !1
  28657. }
  28658. }(),
  28659. o.isWithinFOV = function() {
  28660. var e = new r.Vector3
  28661. , t = new r.Vector3;
  28662. return function(i, n, o, a) {
  28663. if (r.copyVector(i, t),
  28664. a) {
  28665. r.copyVector(a, e),
  28666. r.normalize(e);
  28667. var s = r.dot(e, i);
  28668. e.x *= s,
  28669. e.y *= s,
  28670. e.z *= s,
  28671. r.subVector(t, e)
  28672. }
  28673. var l = o / 2 * r.RADIANS_PER_DEGREE
  28674. , c = Math.cos(l)
  28675. , h = r.dot(t, n);
  28676. return h >= c
  28677. }
  28678. }(),
  28679. o.mapFaceToCubemapFace = function() {
  28680. var e = {
  28681. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28682. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28683. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28684. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28685. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28686. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28687. };
  28688. return function(t) {
  28689. return e[t]
  28690. }
  28691. }(),
  28692. t.exports = o
  28693. }
  28694. , {
  28695. "../enum/GLCubeFaces": 25,
  28696. "../util/MathLight": 176
  28697. }],
  28698. 175: [function(e, t, i) {
  28699. (function(i) {
  28700. "use strict";
  28701. function n() {
  28702. this.list = [],
  28703. this.index = {},
  28704. Object.defineProperty(this, "length", {
  28705. get: function() {
  28706. return this.list.length
  28707. }
  28708. })
  28709. }
  28710. var r = (e("./common"),
  28711. e("./logger"));
  28712. new r(i);
  28713. n.prototype.forEach = function(e) {
  28714. this.list.forEach(e)
  28715. }
  28716. ,
  28717. n.prototype.add = function(e) {
  28718. this.list.push(e),
  28719. this.index[this.getIndex(e)] = e
  28720. }
  28721. ,
  28722. n.prototype.getIndex = function(e) {
  28723. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28724. }
  28725. ,
  28726. n.prototype.extend = function(e) {
  28727. for (var t = 0; t < e.length; t++)
  28728. this.add(e[t])
  28729. }
  28730. ,
  28731. n.prototype.get = function(e) {
  28732. return this.index[e]
  28733. }
  28734. ,
  28735. n.prototype.first = function() {
  28736. return this.list[0]
  28737. }
  28738. ,
  28739. n.prototype.last = function() {
  28740. return this.list[this.list.length - 1]
  28741. }
  28742. ,
  28743. n.prototype.reIndex = function() {
  28744. this.index = {};
  28745. var e = this;
  28746. this.forEach(function(t) {
  28747. e.index[e.getIndex(t)] = t
  28748. })
  28749. }
  28750. ,
  28751. n.prototype.filter = function(e) {
  28752. var t = this.list.filter(e);
  28753. return this.reIndex(),
  28754. t
  28755. }
  28756. ,
  28757. n.prototype.reduce = function(e, t) {
  28758. return this.list.reduce(e, t)
  28759. }
  28760. ,
  28761. n.prototype.sort = function(e) {
  28762. return this.list.sort(e)
  28763. }
  28764. ,
  28765. n.prototype.indexOf = function(e) {
  28766. for (var t = 0; t < this.list.length; ++t)
  28767. if (this.list[t] === e)
  28768. return t;
  28769. return -1
  28770. }
  28771. ,
  28772. t.exports = n
  28773. }
  28774. ).call(this, "/js/util/IndexedCollection.js")
  28775. }
  28776. , {
  28777. "./common": 185,
  28778. "./logger": 189
  28779. }],
  28780. 176: [function(e, t, i) {
  28781. "use strict";
  28782. var n = e("../constants")
  28783. , r = {};
  28784. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28785. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28786. r.Vector3 = function(e, t, i) {
  28787. this.x = e || 0,
  28788. this.y = t || 0,
  28789. this.z = i || 0
  28790. }
  28791. ,
  28792. r.Matrix4 = function() {
  28793. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28794. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28795. }
  28796. ,
  28797. r.Matrix4.prototype = {
  28798. identity: function() {
  28799. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28800. this
  28801. },
  28802. copy: function(e) {
  28803. return this.elements.set(e.elements),
  28804. this
  28805. },
  28806. applyToVector3: function(e) {
  28807. var t = e.x
  28808. , i = e.y
  28809. , n = e.z
  28810. , r = this.elements;
  28811. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28812. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28813. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28814. this
  28815. },
  28816. getInverse: function(e, t) {
  28817. var i = this.elements
  28818. , n = e.elements
  28819. , r = n[0]
  28820. , o = n[1]
  28821. , a = n[2]
  28822. , s = n[3]
  28823. , l = n[4]
  28824. , c = n[5]
  28825. , h = n[6]
  28826. , u = n[7]
  28827. , d = n[8]
  28828. , p = n[9]
  28829. , f = n[10]
  28830. , g = n[11]
  28831. , m = n[12]
  28832. , v = n[13]
  28833. , A = n[14]
  28834. , y = n[15]
  28835. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  28836. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  28837. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  28838. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  28839. , w = r * C + o * I + a * E + s * b;
  28840. if (0 === w) {
  28841. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  28842. if (t)
  28843. throw new Error(_);
  28844. return console.warn(_),
  28845. this.identity()
  28846. }
  28847. var T = 1 / w;
  28848. return i[0] = C * T,
  28849. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  28850. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  28851. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  28852. i[4] = I * T,
  28853. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  28854. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  28855. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  28856. i[8] = E * T,
  28857. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  28858. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  28859. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  28860. i[12] = b * T,
  28861. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  28862. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  28863. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  28864. this
  28865. },
  28866. makeRotationFromQuaternion: function(e) {
  28867. var t = this.elements
  28868. , i = e.x
  28869. , n = e.y
  28870. , r = e.z
  28871. , o = e.w
  28872. , a = i + i
  28873. , s = n + n
  28874. , l = r + r
  28875. , c = i * a
  28876. , h = i * s
  28877. , u = i * l
  28878. , d = n * s
  28879. , p = n * l
  28880. , f = r * l
  28881. , g = o * a
  28882. , m = o * s
  28883. , v = o * l;
  28884. return t[0] = 1 - (d + f),
  28885. t[4] = h - v,
  28886. t[8] = u + m,
  28887. t[1] = h + v,
  28888. t[5] = 1 - (c + f),
  28889. t[9] = p - g,
  28890. t[2] = u - m,
  28891. t[6] = p + g,
  28892. t[10] = 1 - (c + d),
  28893. t[3] = 0,
  28894. t[7] = 0,
  28895. t[11] = 0,
  28896. t[12] = 0,
  28897. t[13] = 0,
  28898. t[14] = 0,
  28899. t[15] = 1,
  28900. this
  28901. }
  28902. },
  28903. r.Quaternion = function(e, t, i, n) {
  28904. this._x = e || 0,
  28905. this._y = t || 0,
  28906. this._z = i || 0,
  28907. this._w = void 0 !== n ? n : 1
  28908. }
  28909. ,
  28910. r.Quaternion.prototype = {
  28911. get x() {
  28912. return this._x
  28913. },
  28914. set x(e) {
  28915. this._x = e
  28916. },
  28917. get y() {
  28918. return this._y
  28919. },
  28920. set y(e) {
  28921. this._y = e
  28922. },
  28923. get z() {
  28924. return this._z
  28925. },
  28926. set z(e) {
  28927. this._z = e
  28928. },
  28929. get w() {
  28930. return this._w
  28931. },
  28932. set w(e) {
  28933. this._w = e
  28934. },
  28935. copy: function(e) {
  28936. this._x = e.x,
  28937. this._y = e.y,
  28938. this._z = e.z,
  28939. this._w = e.w
  28940. },
  28941. inverse: function() {
  28942. return this.conjugate().normalize()
  28943. },
  28944. conjugate: function() {
  28945. return this._x *= -1,
  28946. this._y *= -1,
  28947. this._z *= -1,
  28948. this
  28949. },
  28950. length: function() {
  28951. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  28952. },
  28953. normalize: function() {
  28954. var e = this.length();
  28955. return 0 === e ? (this._x = 0,
  28956. this._y = 0,
  28957. this._z = 0,
  28958. this._w = 1) : (e = 1 / e,
  28959. this._x = this._x * e,
  28960. this._y = this._y * e,
  28961. this._z = this._z * e,
  28962. this._w = this._w * e),
  28963. this
  28964. },
  28965. setFromAxisAngle: function(e, t) {
  28966. var i = t / 2
  28967. , n = Math.sin(i);
  28968. return this._x = e.x * n,
  28969. this._y = e.y * n,
  28970. this._z = e.z * n,
  28971. this._w = Math.cos(i),
  28972. this
  28973. },
  28974. setFromUnitVectors: function() {
  28975. var e, t, i = 1e-6;
  28976. return function(n, o) {
  28977. return void 0 === e && (e = new r.Vector3),
  28978. t = r.dot(n, o) + 1,
  28979. t < i ? (t = 0,
  28980. 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),
  28981. this._x = e.x,
  28982. this._y = e.y,
  28983. this._z = e.z,
  28984. this._w = t,
  28985. this.normalize()
  28986. }
  28987. }(),
  28988. multiply: function(e) {
  28989. return this.multiplyQuaternions(this, e)
  28990. },
  28991. premultiply: function(e) {
  28992. return this.multiplyQuaternions(e, this)
  28993. },
  28994. multiplyQuaternions: function(e, t) {
  28995. var i = e._x
  28996. , n = e._y
  28997. , r = e._z
  28998. , o = e._w
  28999. , a = t._x
  29000. , s = t._y
  29001. , l = t._z
  29002. , c = t._w;
  29003. return this._x = i * c + o * a + n * l - r * s,
  29004. this._y = n * c + o * s + r * a - i * l,
  29005. this._z = r * c + o * l + i * s - n * a,
  29006. this._w = o * c - i * a - n * s - r * l,
  29007. this
  29008. }
  29009. },
  29010. r.convertWorkshopVector = function(e) {
  29011. return new r.Vector3(-e.x,e.y,e.z)
  29012. }
  29013. ,
  29014. r.convertWorkshopQuaternion = function(e) {
  29015. 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))
  29016. }
  29017. ;
  29018. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29019. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29020. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29021. }
  29022. ,
  29023. r.convertWorkshopPanoramaQuaternion = function(e) {
  29024. 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))
  29025. }
  29026. ,
  29027. r.normalize = function(e) {
  29028. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29029. , i = Math.sqrt(t);
  29030. e.x /= i,
  29031. e.y /= i,
  29032. e.z /= i
  29033. }
  29034. ,
  29035. r.dot = function(e, t) {
  29036. return e.x * t.x + e.y * t.y + e.z * t.z
  29037. }
  29038. ,
  29039. r.cross = function(e, t, i) {
  29040. var n = e.x
  29041. , r = e.y
  29042. , o = e.z;
  29043. i.x = r * t.z - o * t.y,
  29044. i.y = o * t.x - n * t.z,
  29045. i.z = n * t.y - r * t.x
  29046. }
  29047. ,
  29048. r.setVector = function(e, t, i, n) {
  29049. e.x = t,
  29050. e.y = i,
  29051. e.z = n
  29052. }
  29053. ,
  29054. r.copyVector = function(e, t) {
  29055. t.x = e.x,
  29056. t.y = e.y,
  29057. t.z = e.z
  29058. }
  29059. ,
  29060. r.addVector = function(e, t) {
  29061. e.x += t.x,
  29062. e.y += t.y,
  29063. e.z += t.z
  29064. }
  29065. ,
  29066. r.subVector = function(e, t) {
  29067. e.x -= t.x,
  29068. e.y -= t.y,
  29069. e.z -= t.z
  29070. }
  29071. ,
  29072. r.applyQuaternionToVector = function(e, t) {
  29073. var i = t.x
  29074. , n = t.y
  29075. , r = t.z
  29076. , o = e.x
  29077. , a = e.y
  29078. , s = e.z
  29079. , l = e.w
  29080. , c = l * i + a * r - s * n
  29081. , h = l * n + s * i - o * r
  29082. , u = l * r + o * n - a * i
  29083. , d = -o * i - a * n - s * r;
  29084. t.x = c * l + d * -o + h * -s - u * -a,
  29085. t.y = h * l + d * -a + u * -o - c * -s,
  29086. t.z = u * l + d * -s + c * -a - h * -o
  29087. }
  29088. ,
  29089. r.angleBetweenVectors = function(e, t) {
  29090. return Math.acos(r.dot(e, t))
  29091. }
  29092. ,
  29093. t.exports = r
  29094. }
  29095. , {
  29096. "../constants": 8
  29097. }],
  29098. 177: [function(e, t, i) {
  29099. (function(i) {
  29100. "use strict";
  29101. function n(e) {
  29102. this.cache = null,
  29103. this.expires = 0
  29104. }
  29105. function r() {
  29106. this.baseUrl = null,
  29107. this.cache = null,
  29108. this.expires = 0
  29109. }
  29110. function o() {
  29111. this.baseUrl = null,
  29112. this.expires = 0
  29113. }
  29114. function a(e) {
  29115. this.initialLoadingPromise = null,
  29116. this.endpoint = e + "?type=3",
  29117. this.urlContainer = null,
  29118. this.authorizationHeader = h.getAuthorizationHeader(),
  29119. this.containerClasses = [o, r, n]
  29120. }
  29121. var s = e("./ajax")
  29122. , l = e("./logger")
  29123. , c = e("../constants")
  29124. , h = e("./showcase")
  29125. , u = (e("../ab"),
  29126. new l(i));
  29127. n.prototype = {
  29128. version: 1,
  29129. validate: function(e) {
  29130. return "catalog.json"in e && Object.keys(e).length > 0
  29131. },
  29132. update: function(e) {
  29133. return this.cache = e,
  29134. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29135. $.when()
  29136. },
  29137. get: function(e) {
  29138. return this.cache[e]
  29139. }
  29140. },
  29141. r.prototype = {
  29142. version: 2,
  29143. validate: function(e) {
  29144. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29145. },
  29146. update: function(e) {
  29147. return this.baseUrl = e["base.url"],
  29148. this.cache = e,
  29149. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29150. $.when()
  29151. },
  29152. get: function(e) {
  29153. var t = this.cache[e];
  29154. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29155. }
  29156. },
  29157. o.prototype = {
  29158. version: 3,
  29159. validate: function(e) {
  29160. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29161. },
  29162. update: function(e) {
  29163. return this.baseUrl = e.templates[0],
  29164. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29165. $.when()
  29166. },
  29167. get: function(e) {
  29168. return this.baseUrl.replace("{{filename}}", e)
  29169. }
  29170. },
  29171. a.prototype = {
  29172. init: function() {
  29173. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29174. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29175. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29176. this.refresh().done(function() {
  29177. u.debug("Refreshed")
  29178. }).fail(function() {
  29179. u.error("Failed url refresh, urls might go stale soon")
  29180. }))
  29181. }
  29182. .bind(this), c.signedUrlCheckInterval),
  29183. this.initialLoadingPromise = this.refresh(),
  29184. this.initialLoadingPromise)
  29185. },
  29186. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29187. e = e || {};
  29188. /*var t = void 0 === e.cache || e.cache;
  29189. return s.get( this.endpoint , { //file
  29190. responseType: "json",
  29191. prefetchFrom: t ? "files" : null,
  29192. cache: t,
  29193. auth: this.authorizationHeader
  29194. }).then(function(e) {
  29195. if (this.urlContainer && this.urlContainer.validate(e))
  29196. return this.urlContainer.update(e);
  29197. for (var i = 0; i < this.containerClasses.length; i++) {
  29198. var n = this.containerClasses[i]
  29199. , r = new n;
  29200. if (r.validate(e))
  29201. return u.info("Using urls version " + r.version),
  29202. this.urlContainer = r,
  29203. this.urlContainer.update(e)
  29204. }
  29205. return t ? this.refresh({
  29206. cache: !1
  29207. }) : $.Deferred().reject("missing-urls")
  29208. }
  29209. .bind(this), function(e) {
  29210. return "loading-failed"
  29211. }) */
  29212. return $.Deferred().resolve();
  29213. },
  29214. get: function(e) {
  29215. //return this.urlContainer.get(e)
  29216. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  29217. }
  29218. },
  29219. t.exports = a
  29220. }
  29221. ).call(this, "/js/util/ModelUrls.js")
  29222. }
  29223. , {
  29224. "../ab": 3,
  29225. "../constants": 8,
  29226. "./ajax": 181,
  29227. "./logger": 189,
  29228. "./showcase": 193
  29229. }],
  29230. 178: [function(e, t, i) {
  29231. (function(i) {
  29232. "use strict";
  29233. function n() {
  29234. u.call(this),
  29235. this.neighbourMap = {},
  29236. this.map = null
  29237. }
  29238. var r = e("three")
  29239. , o = e("./common")
  29240. , a = e("../settings")
  29241. , s = e("../objects/Panorama")
  29242. , a = e("../settings")
  29243. , l = e("./aStar")
  29244. , c = e("./logger")
  29245. , h = new c(i)
  29246. , u = e("./IndexedCollection")
  29247. , d = e("./transitions");
  29248. o.inherit(n, u),
  29249. n.prototype.getIndex = function(e) {
  29250. return e.id
  29251. }
  29252. ,
  29253. n.prototype.find = function(e, t) {
  29254. var i = o.filterAll(this.list, e);
  29255. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29256. i = o.stableSort(i, e)
  29257. }),
  29258. i[0])
  29259. }
  29260. ,
  29261. n.prototype.sortByScore = function(e, t) {
  29262. var i = o.filterAll(this.list, e);
  29263. return 0 === i.length ? null : i = i.map(function(e) {
  29264. return {
  29265. pano: e,
  29266. score: t.reduce(function(t, i) {
  29267. return t + i(e)
  29268. }, 0)
  29269. }
  29270. }).sort(function(e, t) {
  29271. return t.score - e.score;
  29272. })
  29273. }
  29274. ,
  29275. n.prototype.lowestByScore = function(e, t, i) {
  29276. return this.findRankedByScore(0, e, t, i)
  29277. }
  29278. ,
  29279. n.prototype.findRankedByScore = function(e, t, i, n) {
  29280. n && (n.candidates = null,
  29281. n.pano = null),
  29282. e || (e = 0);
  29283. var r = this.sortByScore(t, i);
  29284. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29285. n.pano = r[e].pano),
  29286. r[e].pano)
  29287. }
  29288. ,
  29289. n.prototype.showPanoScores = function(e) {
  29290. this.list.forEach(function(e) {
  29291. e.removeTextSprite()
  29292. });
  29293. var t = 6344768;
  29294. e.forEach(function(e) {
  29295. e.pano.addTextSprite(e.score.toFixed(2), t),
  29296. t = 16428055
  29297. })
  29298. }
  29299. ,
  29300. n.prototype.isNeighbour = function(e, t) {
  29301. return this.neighbourMap[e.id][t.id]
  29302. }
  29303. ,
  29304. n.prototype.getNeighbours = function(e) {
  29305. return this.neighbourMap[e.id]
  29306. }
  29307. ,
  29308. n.prototype.setNeighbour = function(e, t, i) {
  29309. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29310. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29311. this.neighbourMap[e.id][e.id] = !0,
  29312. this.neighbourMap[t.id][t.id] = !0,
  29313. this.neighbourMap[e.id][t.id] = i,
  29314. this.neighbourMap[t.id][e.id] = i,
  29315. this.neighbourMap[e.id]
  29316. }
  29317. ,
  29318. n.prototype.findClosest = function(e, t) {
  29319. var i = [s.filters.isPanoAligned()];
  29320. return t && i.push(s.filters.inDirection(e, t, .75)),
  29321. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29322. }
  29323. ,
  29324. n.prototype.dualNeighbors = function(e, t) {
  29325. var i, n = [];
  29326. for (i in this.neighbourMap[e.id])
  29327. this.neighbourMap[t.id][i] && n.push(i);
  29328. return n
  29329. }
  29330. ,
  29331. n.prototype.populate_path_graph = function() {
  29332. 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;
  29333. for (e = 0; e < this.list.length; e += 1) {
  29334. o = this.list[e],
  29335. s = {},
  29336. l = !1,
  29337. i = o.neighbourPanos || o.findNeighourPanos();
  29338. for (t in i)
  29339. if (i[t]) {
  29340. a = this.index[t],
  29341. p.copy(o.floorPosition),
  29342. p.sub(a.floorPosition);
  29343. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29344. , v = (Math.abs(p.y) / Math.max(m, .01),
  29345. Math.max(0, Math.abs(p.y) - .2));
  29346. v > 0 ? (f += 1,
  29347. v = Math.pow(4 * v, 2),
  29348. m = Math.pow(m, 2),
  29349. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29350. n = p.length()),
  29351. s[a.id] = n,
  29352. l = !0
  29353. }
  29354. l ? u[o.id] = s : d += 1
  29355. }
  29356. this.map = u,
  29357. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29358. }
  29359. ,
  29360. n.prototype.aStarSearch = function(e, t) {
  29361. var i = Date.now()
  29362. , n = new l({
  29363. start: e,
  29364. isEnd: function(e) {
  29365. return e === t
  29366. },
  29367. neighbor: function(e) {
  29368. var t = e.neighbourPanos || e.findNeighourPanos()
  29369. , i = [];
  29370. for (var n in t)
  29371. t[n] && i.push(this.index[n]); //add: t[n] &&
  29372. return i
  29373. }
  29374. .bind(this),
  29375. distance: function(e, t) {
  29376. var i = this.map[e.id]
  29377. , n = i[t.id];
  29378. return n
  29379. }
  29380. .bind(this),
  29381. heuristic: function(e, t) {
  29382. return 1
  29383. }
  29384. .bind(this),
  29385. hash: function(e) {
  29386. return e.id
  29387. },
  29388. timeout: 5e3
  29389. });
  29390. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29391. "success" !== n.status)
  29392. return h.debug("Did not find A* path from " + e + " to " + t),
  29393. null;
  29394. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29395. var r = [];
  29396. return n.path.forEach(function(e) {
  29397. r.push(e.id)
  29398. }),
  29399. r
  29400. }
  29401. ,
  29402. n.prototype.includeNodesNearPath = function() {
  29403. var e = new r.Vector3
  29404. , t = new r.Vector3
  29405. , i = new r.Vector3
  29406. , n = new r.Vector3
  29407. , o = new r.Vector3
  29408. , a = new r.Vector3
  29409. , s = new r.Vector3
  29410. , l = new r.Vector3
  29411. , c = []
  29412. , h = new r.Vector3
  29413. , u = new r.Vector3;
  29414. return function(r, d) {
  29415. if (r)
  29416. for (var p = function(e, t, i) {
  29417. return o.copy(t).sub(e),
  29418. o.dot(i)
  29419. }, f = function(e, t) {
  29420. return p(h, e.position, i) - p(h, t.position, i)
  29421. }, g = 0; g < r.length - 1; ) {
  29422. var m = r[g]
  29423. , v = r[g + 1]
  29424. , A = this.index[m]
  29425. , y = this.index[v];
  29426. h.copy(A.position),
  29427. u.copy(y.position),
  29428. c.length = 0,
  29429. e.copy(u).sub(h),
  29430. i.copy(e).normalize();
  29431. for (var C = 0; C < this.list.length; C++) {
  29432. var I = this.list[C];
  29433. o.copy(I.position).sub(h);
  29434. var E = o.dot(i);
  29435. if (E > 0) {
  29436. s.copy(i),
  29437. s.multiplyScalar(E),
  29438. a.copy(o),
  29439. a.sub(s);
  29440. var b = a.length();
  29441. if (b < d) {
  29442. t.copy(e).negate(),
  29443. n.copy(t).normalize(),
  29444. l.copy(I.position).sub(u);
  29445. var w = l.dot(n);
  29446. w > 0 && c.push(I)
  29447. }
  29448. }
  29449. }
  29450. if (c.length > 0) {
  29451. c.sort(f);
  29452. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29453. r[_] = r[_ - c.length];
  29454. for (var T = 0; T < c.length; T++)
  29455. r[T + g + 1] = c[T].id
  29456. }
  29457. g += c.length + 1
  29458. }
  29459. }
  29460. }(),
  29461. n.prototype.fadeMarkerOpacity = function(e, t) {
  29462. var i = void 0 === e ? a.panorama.markerOpacity : e
  29463. , n = this.list.findIndex(function(e) {
  29464. return e.marker
  29465. });
  29466. if (!(n < 0)) {
  29467. var r = this.list[n].marker.material.opacity;
  29468. if (r !== e) {
  29469. var o = i - r;
  29470. d.trigger({
  29471. func: function(e, t) {
  29472. var i = r + e * o;
  29473. this.forEach(function(e) {
  29474. e.marker && (e.marker.material.opacity = i)
  29475. })
  29476. }
  29477. .bind(this),
  29478. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29479. name: "_fpm"
  29480. })
  29481. }
  29482. }
  29483. }
  29484. ,
  29485. t.exports = n
  29486. }
  29487. ).call(this, "/js/util/PanoramaCollection.js")
  29488. }
  29489. , {
  29490. "../objects/Panorama": 148,
  29491. "../settings": 166,
  29492. "./IndexedCollection": 175,
  29493. "./aStar": 180,
  29494. "./common": 185,
  29495. "./logger": 189,
  29496. "./transitions": 195,
  29497. three: 217
  29498. }],
  29499. 179: [function(e, t, i) {
  29500. "use strict";
  29501. function n() {
  29502. this.actionSequence = [],
  29503. this.actionSequenceInProgress = !1
  29504. }
  29505. function r(e, t, i, n) {
  29506. s.trackAlways("zoom_" + e, {
  29507. from: t,
  29508. to: i,
  29509. pano: n
  29510. })
  29511. }
  29512. function o(e, t) {
  29513. r("initial", 1, e, t)
  29514. }
  29515. function a(e, t, i) {
  29516. r("followup", e, t, i)
  29517. }
  29518. var s = e("../analytics");
  29519. n.prototype.reset = function(e) {
  29520. this.actionSequenceInProgress = !1,
  29521. this.actionSequence.length = 0
  29522. }
  29523. ,
  29524. n.prototype.addZoomAction = function() {
  29525. var e = null
  29526. , t = null
  29527. , i = !1
  29528. , n = function() {
  29529. if (e = null,
  29530. this.actionSequence.length > 0) {
  29531. var i = this.actionSequence[0].start
  29532. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29533. 1 === i ? o(n, t) : a(i, n, t)
  29534. }
  29535. this.reset()
  29536. };
  29537. return function(r, o, a) {
  29538. if (r !== o) {
  29539. i || (n = n.bind(this),
  29540. i = !0),
  29541. e && (window.clearTimeout(e),
  29542. e = null),
  29543. a === t && this.actionSequenceInProgress || (this.reset(),
  29544. t = a),
  29545. this.actionSequenceInProgress = !0;
  29546. var s = {
  29547. start: r,
  29548. end: o
  29549. };
  29550. this.actionSequence.push(s),
  29551. e = window.setTimeout(n, 150)
  29552. }
  29553. }
  29554. }(),
  29555. t.exports = n
  29556. }
  29557. , {
  29558. "../analytics": 4
  29559. }],
  29560. 180: [function(e, t, i) {
  29561. "use strict";
  29562. function n(e) {
  29563. void 0 === e.timeout && (e.timeout = 1 / 0);
  29564. var t = e.hash || o
  29565. , i = {
  29566. data: e.start,
  29567. g: 0,
  29568. h: e.heuristic(e.start)
  29569. }
  29570. , n = i;
  29571. i.f = i.h;
  29572. var h = new s
  29573. , u = new l(a)
  29574. , d = c();
  29575. u.push(i),
  29576. d.set(t(i.data), i);
  29577. for (var p = new Date; u.size(); ) {
  29578. if (new Date - p > e.timeout)
  29579. return {
  29580. status: "timeout",
  29581. cost: n.g,
  29582. path: r(n)
  29583. };
  29584. var f = u.pop();
  29585. if (d.delete(t(f.data)),
  29586. e.isEnd(f.data))
  29587. return {
  29588. status: "success",
  29589. cost: f.g,
  29590. path: r(f)
  29591. };
  29592. h.add(t(f.data));
  29593. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29594. var v = g[m];
  29595. if (!h.contains(t(v))) {
  29596. var A = f.g + e.distance(f.data, v)
  29597. , y = d.get(t(v))
  29598. , C = !1;
  29599. if (void 0 === y)
  29600. y = {
  29601. data: v
  29602. },
  29603. d.set(t(v), y);
  29604. else {
  29605. if (y.g < A)
  29606. continue;
  29607. C = !0
  29608. }
  29609. y.parent = f,
  29610. y.g = A,
  29611. y.h = e.heuristic(v),
  29612. y.f = A + y.h,
  29613. y.h < n.h && (n = y),
  29614. C ? u.heapify() : u.push(y)
  29615. }
  29616. }
  29617. }
  29618. return {
  29619. status: "noPath",
  29620. cost: n.g,
  29621. path: r(n)
  29622. }
  29623. }
  29624. function r(e) {
  29625. if (void 0 !== e.parent) {
  29626. var t = r(e.parent);
  29627. return t.push(e.data),
  29628. t
  29629. }
  29630. return [e.data]
  29631. }
  29632. function o(e) {
  29633. return e.toString()
  29634. }
  29635. function a(e, t) {
  29636. return e.f - t.f
  29637. }
  29638. var s = e("Set")
  29639. , l = e("heap")
  29640. , c = e("dict");
  29641. t.exports = n
  29642. }
  29643. , {
  29644. Set: 196,
  29645. dict: 210,
  29646. heap: 211
  29647. }],
  29648. 181: [function(e, t, i) {
  29649. (function(i) {
  29650. "use strict";
  29651. function n(e, t, i) {
  29652. var n = new XMLHttpRequest;
  29653. if (i && "withCredentials"in n)
  29654. n.open(e, t, i);
  29655. else if ("undefined" != typeof XDomainRequest)
  29656. n = new XDomainRequest,
  29657. n.open(e, t);
  29658. else {
  29659. if (i)
  29660. throw "Browser does not support CORS!";
  29661. n.open(e, t)
  29662. }
  29663. return n
  29664. }
  29665. function r(e, t, i) {
  29666. function o() {
  29667. u.warn("Retrying ", t),
  29668. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29669. }
  29670. function a(e, t) {
  29671. var i = e.response;
  29672. if ("json" === t && "object" != typeof i)
  29673. try {
  29674. i = JSON.parse(e.responseText)
  29675. } catch (e) {
  29676. return void c.reject({
  29677. error: "Failed parsing JSON"
  29678. })
  29679. }
  29680. else if ("image/jpeg" === t) {
  29681. var n = new Uint8Array(e.response)
  29682. , r = new Blob([n],{
  29683. type: "image/jpeg"
  29684. })
  29685. , o = URL.createObjectURL(r);
  29686. i = new Image,
  29687. i.src = o,
  29688. i.crossOrigin = "Anonymous",
  29689. i.onload = function() {
  29690. URL.revokeObjectURL(o)
  29691. }
  29692. }
  29693. return i
  29694. }
  29695. var s = n(e, t, !1);
  29696. if (i = i || {},
  29697. i.retries = void 0 !== i.retries ? i.retries : 0,
  29698. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29699. i.responseType)
  29700. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29701. s.responseType = i.responseType;
  29702. else {
  29703. if ("image/jpeg" !== i.responseType)
  29704. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29705. s.responseType = "arraybuffer"
  29706. }
  29707. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29708. i.auth && s.setRequestHeader("Authorization", i.auth),
  29709. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29710. s.setRequestHeader("Content-Type", "application/json")),
  29711. "object" == typeof i.headers)
  29712. for (var l in i.headers)
  29713. s.setRequestHeader(l, i.headers[l]);
  29714. var c = $.Deferred();
  29715. return s.onreadystatechange = function(e) {
  29716. if (4 === this.readyState)
  29717. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29718. i.retries++,
  29719. setTimeout(o, 1e3);
  29720. else if (200 === this.status) {
  29721. var t = a(this, i.responseType);
  29722. c.resolve(t)
  29723. } else
  29724. c.reject(this)
  29725. }
  29726. ,
  29727. s.onprogress = function(e) {
  29728. c.notify(e)
  29729. }
  29730. ,
  29731. s.send(i.data),
  29732. c.promise()
  29733. }
  29734. function o(e) {
  29735. return Object.keys(e).sort().map(function(t) {
  29736. return {
  29737. key: t,
  29738. value: e[t]
  29739. }
  29740. })
  29741. }
  29742. function a(e, t) {
  29743. var i = t.responseType || null
  29744. , n = t.auth || null
  29745. , r = t.prefetchFrom || null
  29746. , a = e + "__" + i + "__" + n + "__" + r;
  29747. return t.headers && o(t.headers).forEach(function(e) {
  29748. a += "__" + e.key + ":" + e.value
  29749. }),
  29750. a
  29751. }
  29752. function s(e, t) {
  29753. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29754. }
  29755. function l(e, t, i) {
  29756. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29757. }
  29758. var c = e("./logger")
  29759. , h = e("../ab")
  29760. , u = new c(i);
  29761. window.URL = window.URL || window.webkitURL,
  29762. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29763. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  29764. /* setTimeout(function() {//MP-- xzw delete
  29765. window.MP_REQUEST_CACHE = null,
  29766. window.MP_PREFETCHED_MODELDATA = {}
  29767. }, 6e4),
  29768. window.onpageshow = function(e) {
  29769. e.persisted && (window.MP_REQUEST_CACHE = null,
  29770. window.MP_PREFETCHED_MODELDATA = {})
  29771. } */
  29772. ,
  29773. t.exports = {
  29774. get: function(e, t) {
  29775. t = t || {};
  29776. var i = void 0 === t.cache || t.cache;
  29777. if (i) {
  29778. var n = s(e, t);
  29779. if (n)
  29780. return n
  29781. }
  29782. var o;
  29783. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  29784. i && l(e, t, o),
  29785. o
  29786. },
  29787. post: function(e, t) {
  29788. return r("POST", e, t)
  29789. },
  29790. patch: function(e, t) {
  29791. return r("PATCH", e, t)
  29792. },
  29793. getImage: function(e, t) {
  29794. function i() {
  29795. u.warn("Retrying ", e),
  29796. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  29797. }
  29798. var n = $.Deferred()
  29799. , r = new Image
  29800. , o = this;
  29801. return e = h.changeIfImageOptimzing(e),
  29802. null !== t && void 0 !== t || (t = 3),
  29803. r.onerror = function() {
  29804. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29805. }
  29806. ,
  29807. r.onload = function() {
  29808. n.resolve(r)
  29809. }
  29810. ,
  29811. r.crossOrigin = "anonymous",
  29812. r.src = e,
  29813. n
  29814. }
  29815. }
  29816. }
  29817. ).call(this, "/js/util/ajax.js")
  29818. }
  29819. , {
  29820. "../ab": 3,
  29821. "./logger": 189
  29822. }],
  29823. 182: [function(e, t, i) {
  29824. "use strict";
  29825. function n(e, t) {
  29826. var i = window.navigator.userAgent
  29827. , n = i.match(e);
  29828. return n = n ? n[1].split(t) : [],
  29829. {
  29830. major: parseInt(n[0]) || 0,
  29831. minor: parseInt(n[1]) || 0,
  29832. patch: parseInt(n[2]) || 0
  29833. }
  29834. }
  29835. var r = e("../exception/DeviceMismatchException");
  29836. window.browser = t.exports = {
  29837. isFullscreen: function() {
  29838. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  29839. },
  29840. supportsFullscreen: function() {
  29841. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29842. },
  29843. isPointerLocked: function() {
  29844. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29845. },
  29846. requestFullscreen: function(e, t) {
  29847. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  29848. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  29849. },
  29850. requestPointerLock: function() {
  29851. var e;
  29852. if (document.fullscreenElement)
  29853. e = document.fullscreenElement();
  29854. else if (document.mozFullscreenElement)
  29855. e = document.mozFullscreenElement();
  29856. else if (document.mozFullScreenElement)
  29857. e = document.mozFullScreenElement();
  29858. else {
  29859. if (!document.webkitFullscreenElement)
  29860. return;
  29861. e = document.webkitFullscreenElement()
  29862. }
  29863. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  29864. e.requestPointerLock(),
  29865. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  29866. },
  29867. exitPointerLock: function() {
  29868. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  29869. document.exitPointerLock()
  29870. },
  29871. exitFullscreen: function() {
  29872. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29873. },
  29874. details: function() {
  29875. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  29876. return e ? {
  29877. name: e[1],
  29878. version: parseInt(e[2]),
  29879. platform: navigator.platform
  29880. } : {}
  29881. },
  29882. is: function(e) {
  29883. return this.details() && this.details().name === e
  29884. },
  29885. inIframe: function() {
  29886. return window.parent !== window
  29887. },
  29888. aspectRatio: function() {
  29889. var e = $("#player").width() / $("#player").height();
  29890. return isFinite(e) ? e : 0
  29891. },
  29892. userAgent: function() {
  29893. return window.navigator.userAgent
  29894. },
  29895. isMobile: function() {
  29896. var e = navigator.userAgent || navigator.vendor || window.opera;
  29897. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  29898. },
  29899. isLandscape: function() {
  29900. return this.isMobile && this.aspectRatio() > 1
  29901. },
  29902. isSmallScreen: function() {
  29903. var e = screen.width / window.devicePixelRatio;
  29904. return e < 240
  29905. },
  29906. detectIE: function() {
  29907. var e = window.navigator.userAgent
  29908. , t = e.indexOf("MSIE ");
  29909. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29910. },
  29911. detectSafari: function() {
  29912. var e = window.navigator.userAgent
  29913. , t = e.indexOf("Safari");
  29914. return t !== -1 && !this.detectChrome()
  29915. },
  29916. detectFirefox: function() {
  29917. var e = window.navigator.userAgent;
  29918. return e.indexOf("Firefox") !== -1
  29919. },
  29920. detectChrome: function() {
  29921. var e = window.navigator.userAgent;
  29922. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  29923. },
  29924. detectOpera: function() {
  29925. var e = window.navigator.userAgent;
  29926. return e.indexOf("OPR") !== -1
  29927. },
  29928. detectIOS: function() {
  29929. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29930. },
  29931. detectIPad: function() {
  29932. var e = window.navigator.userAgent
  29933. , t = /iPad/;
  29934. return t.test(e)
  29935. },
  29936. detectIPod: function() {
  29937. var e = window.navigator.userAgent
  29938. , t = /iPod/;
  29939. return t.test(e)
  29940. },
  29941. detectIPhone: function() {
  29942. var e = window.navigator.userAgent
  29943. , t = /iPhone/;
  29944. return t.test(e)
  29945. },
  29946. detectAndroid: function() {
  29947. var e = window.navigator.userAgent;
  29948. return e.indexOf("Android") !== -1
  29949. },
  29950. detectAndroidMobile: function() {
  29951. var e = window.navigator.userAgent;
  29952. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  29953. },
  29954. detectSamsungNative: function() {
  29955. var e = window.navigator.userAgent;
  29956. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  29957. },
  29958. detectSamsungS6: function() {
  29959. var e = window.navigator.userAgent;
  29960. return e.indexOf("SM-G92") !== -1
  29961. },
  29962. /************************************************************fyz改from徐世廷*************************************************************/
  29963. detectHUAWEI5X: function() {
  29964. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  29965. },
  29966. /*******************************************************************************************************************************/
  29967. detectWebVR: function() {
  29968. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29969. },
  29970. getVRDisplay: function() {
  29971. var e = $.Deferred();
  29972. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  29973. t.length >= 1 && e.resolve(t[0]),
  29974. e.reject(null)
  29975. }),
  29976. e) : e.reject(null)
  29977. },
  29978. iosVersion: function() {
  29979. if (!this.detectIOS())
  29980. throw new r("Did not detect an iDevice");
  29981. var e = /((?:\d+\_?){1,3}) like Mac OS/
  29982. , t = "_";
  29983. return n(e, t)
  29984. },
  29985. androidVersion: function() {
  29986. if (!this.detectAndroid())
  29987. throw new r("Did not detect an Android based device");
  29988. var e = /Android ((?:\d+\.?){1,3})/
  29989. , t = ".";
  29990. return n(e, t)
  29991. },
  29992. valueFromCookie: function(e, t) {
  29993. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29994. if (!i)
  29995. return t;
  29996. var n = i[1];
  29997. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29998. },
  29999. valueFromHash: function(e, t) {
  30000. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  30001. , n = i.exec(window.location.href);
  30002. if (!n)
  30003. return t;
  30004. var r = n[1];
  30005. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  30006. }
  30007. }
  30008. }
  30009. , {
  30010. "../exception/DeviceMismatchException": 56
  30011. }],
  30012. 183: [function(e, t, i) {
  30013. (function(i) {
  30014. "use strict";
  30015. function n(e, t) {
  30016. var i = r(t);
  30017. var replaceAll = function (str, f, e) {
  30018. //f全部替换成e
  30019. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30020. return str.replace(reg, e);
  30021. };
  30022. var urlFirstView = c.valueFromHash('firstView');
  30023. if(urlFirstView){
  30024. try{
  30025. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30026. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30027. urlFirstView = "{"+urlFirstView+"]}"
  30028. let info = JSON.parse(urlFirstView);
  30029. i.pano = t.index[info.pano] //panos.get(info.pano)
  30030. if(!i.pano){
  30031. urlFirstView = false
  30032. console.error('检测到firstView但是 找不到该pano')
  30033. }else{
  30034. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30035. i.zoom = -1;
  30036. i.mode = "panorama"
  30037. i.setByUrl = true
  30038. }
  30039. }catch(e){
  30040. urlFirstView = false
  30041. console.error('检测到firstView但是解析出错'+e)
  30042. }
  30043. }
  30044. if (Object.keys(i).length > 0)
  30045. return i;
  30046. if (e.heroImage)
  30047. i = o(e, t);
  30048. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  30049. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  30050. try {
  30051. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30052. i.position = n.camera.position,
  30053. //i.quaternion = n.camera.quaternion,
  30054. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30055. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30056. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30057. d.debug("Using camera_start"),
  30058. d.debug("Modeldata pano: ", i.pano.quaternion),
  30059. d.debug("Camera start pano: ", n.pano.quaternion)),
  30060. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30061. } catch (e) {
  30062. d.warn(e.message)
  30063. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30064. }
  30065. }
  30066. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30067. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30068. i.pano = t.findClosest(i.position),
  30069. i.quaternion = i.pano.quaternion),
  30070. 0 === Object.keys(i).length) {
  30071. var a = t.list[0];
  30072. a && (i.mode = h.PANORAMA,
  30073. i.pano = a,
  30074. i.position = a.position,
  30075. i.quaternion = a.quaternion,
  30076. d.info("Starting at 1st pano " + a.id))
  30077. }
  30078. return i.mode = i.mode || h.DOLLHOUSE,
  30079. i
  30080. }
  30081. function r(e) {
  30082. var t = c.valueFromHash("start", "")
  30083. , i = {};
  30084. if ("" !== t) {
  30085. d.debug("Start override found in parameters, trying to parse..."),
  30086. i = a(t) || {};
  30087. var n = c.valueFromHash("tag", null);
  30088. n && (i.tag = n),
  30089. i.panoId && (i.pano = e.get(i.panoId))
  30090. }
  30091. return i
  30092. }
  30093. function o(e, t) {
  30094. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30095. return {};
  30096. var i = {}
  30097. , n = e.heroImage.metadata;
  30098. d.debug("Using start position from thumbnail image"),
  30099. i.position = n.camera_position,
  30100. i.quaternion = n.camera_quaternion;
  30101. try {
  30102. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30103. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30104. } catch (e) {
  30105. d.debug(e.message)
  30106. }
  30107. return i
  30108. }
  30109. function a(e) {
  30110. return s.deserialize(e)
  30111. }
  30112. var s = e("../controls/serializer")
  30113. , l = e("../util/math")
  30114. , c = e("./browser")
  30115. , h = e("../enum/Viewmode")
  30116. , u = e("../util/logger")
  30117. , th = e("three")//xzw
  30118. , d = new u(i);
  30119. t.exports = {
  30120. getStartCameraOptions: n
  30121. }
  30122. }
  30123. ).call(this, "/js/util/camera.js")
  30124. }
  30125. , {
  30126. "../controls/serializer": 14,
  30127. "../enum/Viewmode": 51,
  30128. "../util/logger": 189,
  30129. "../util/math": 190,
  30130. "./browser": 182,
  30131. "three": 217
  30132. }],
  30133. 184: [function(e, t, i) {
  30134. "use strict";
  30135. function n(e, t, i) {
  30136. return o(e.fov, t, i)
  30137. }
  30138. var r = e("./MathLight")
  30139. , o = function(e, t, i) {
  30140. var n = t
  30141. , o = i
  30142. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30143. return a
  30144. }
  30145. , a = function(e, t, i) {
  30146. var n = t
  30147. , o = i
  30148. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30149. return a
  30150. }
  30151. , s = function(e, t, i, n) {
  30152. var r = o(e, i, n);
  30153. return r > t ? a(t, i, n) : e
  30154. };
  30155. t.exports = {
  30156. clampVFOV: s,
  30157. getHFOVForCamera: n,
  30158. getHFOVFromVFOV: o,
  30159. getVFOVFromHFOV: a
  30160. }
  30161. window.MathLight = t.exports
  30162. }
  30163. , {
  30164. "./MathLight": 176
  30165. }],
  30166. 185: [function(e, t, i) {
  30167. "use strict";
  30168. var n = e("three");
  30169. t.exports = {
  30170. delayOneFrame: function(e) {
  30171. window.setTimeout(e, 1)
  30172. },
  30173. normalizeUrl: function(e) {
  30174. return e.replace("https://", "http://")
  30175. },
  30176. domainFromUrl: function(e) {
  30177. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30178. return t ? t[3] : e
  30179. },
  30180. average: function(e, t) {
  30181. if (0 === e.length)
  30182. return null;
  30183. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30184. var o = t ? e[r][t] : e[r];
  30185. i += o,
  30186. n++
  30187. }
  30188. return i / n
  30189. },
  30190. countUnique: function(e) {
  30191. for (var t = {}, i = 0; i < e.length; i++)
  30192. t[e[i]] = 1 + (t[e[i]] || 0);
  30193. return Object.keys(t).length
  30194. },
  30195. averageVectors: function(e, t) {
  30196. var i = new n.Vector3;
  30197. if (0 === e.length)
  30198. return i;
  30199. for (var r = 0, o = 0; o < e.length; o++) {
  30200. var a = t ? e[o][t] : e[o];
  30201. i.add(a),
  30202. r++
  30203. }
  30204. return i.divideScalar(r)
  30205. },
  30206. equalLists: function(e, t) {
  30207. if (e.length !== t.length)
  30208. return !1;
  30209. for (var i = 0; i < e.length; i++)
  30210. if (e[i] !== t[i])
  30211. return !1;
  30212. return !0
  30213. },
  30214. lowerMedian: function(e, t) {
  30215. if (0 === e.length)
  30216. return null;
  30217. t = t || 2,
  30218. e.sort(function(e, t) {
  30219. return e - t
  30220. });
  30221. var i = Math.floor(e.length / t);
  30222. return e[i]
  30223. },
  30224. stableSort: function(e, t) {
  30225. return e.map(function(e, t) {
  30226. return {
  30227. value: e,
  30228. index: t
  30229. }
  30230. }).sort(function(e, i) {
  30231. var n = t(e.value, i.value);
  30232. return 0 !== n ? n : e.index - i.index
  30233. }).map(function(e) {
  30234. return e.value
  30235. })
  30236. },
  30237. filterAll: function(e, t) {
  30238. return e.filter(function(e) {
  30239. return t.every(function(t) {
  30240. return t(e)
  30241. })
  30242. })
  30243. },
  30244. formatDate: function(e) {
  30245. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30246. },
  30247. formatDatetime: function(e) {
  30248. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30249. },
  30250. randomString: function(e) {
  30251. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30252. t += i.charAt(Math.floor(Math.random() * i.length));
  30253. return t
  30254. },
  30255. uint8ToBase64: function(e, t) {
  30256. t && "number" == typeof t || (t = 8192);
  30257. for (var i = [], n = 0; n < e.length; n += t)
  30258. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30259. return btoa(i.join(""))
  30260. },
  30261. uuid4: function e(t) {
  30262. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30263. },
  30264. nth: function(e) {
  30265. return e %= 10,
  30266. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30267. },
  30268. extendObject: function(e, t) {
  30269. return Object.keys(t).forEach(function(i) {
  30270. e[i] = t[i]
  30271. }),
  30272. e
  30273. },
  30274. deepExtend: function e(t) {
  30275. t = t || {};
  30276. for (var i = 1; i < arguments.length; i++) {
  30277. var n = arguments[i];
  30278. if (n)
  30279. for (var r in n)
  30280. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30281. }
  30282. return t
  30283. },
  30284. inherit: function(e, t) {
  30285. e.prototype = Object.create(t.prototype),
  30286. e.prototype.constructor = e
  30287. },
  30288. extend: function(e, t) {
  30289. for (var i in t.prototype)
  30290. e.prototype[i] = t.prototype[i]
  30291. }
  30292. ,
  30293. getVisiblePano : function(position, options={}){//add
  30294. var visiblePanos = [];
  30295. var B = position.clone();
  30296. var panos = options.panos || player.model.panos.list;
  30297. panos.forEach((pano)=>{
  30298. if(!pano.isAligned())return;
  30299. var A = pano.position.clone();
  30300. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  30301. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  30302. if (!o || !o.length)visiblePanos.push(pano );
  30303. })
  30304. return visiblePanos
  30305. }
  30306. ,
  30307. sortByScore : function(list, request, rank) {
  30308. var i = this.filterAll(list, request);
  30309. return 0 === i.length ? null : i = i.map(function(e) {
  30310. return {
  30311. item: e,
  30312. score: rank.reduce(function(t, i) {
  30313. return t + i(e);
  30314. }, 0)
  30315. };
  30316. }).sort(function(e, t) {
  30317. return t.score - e.score;
  30318. });
  30319. }
  30320. },
  30321. Math.sign = function(e) {
  30322. return e < 0 ? -1 : 1
  30323. }
  30324. window.common = t.exports
  30325. }
  30326. , {
  30327. three: 217
  30328. }],
  30329. 186: [function(e, t, i) {
  30330. "use strict";
  30331. var n = {};
  30332. n.linearTween = function(e, t, i, n) {
  30333. return i * e / n + t
  30334. }
  30335. ,
  30336. n.easeInQuad = function(e, t, i, n) {
  30337. return e /= n,
  30338. i * e * e + t
  30339. }
  30340. ,
  30341. n.easeOutQuad = function(e, t, i, n) {
  30342. return e /= n,
  30343. -i * e * (e - 2) + t
  30344. }
  30345. ,
  30346. n.easeInOutQuad = function(e, t, i, n) {
  30347. return e /= n / 2,
  30348. e < 1 ? i / 2 * e * e + t : (e--,
  30349. -i / 2 * (e * (e - 2) - 1) + t)
  30350. }
  30351. ,
  30352. n.easeInCubic = function(e, t, i, n) {
  30353. return e /= n,
  30354. i * e * e * e + t
  30355. }
  30356. ,
  30357. n.easeOutCubic = function(e, t, i, n) {
  30358. return e /= n,
  30359. e--,
  30360. i * (e * e * e + 1) + t
  30361. }
  30362. ,
  30363. n.easeInOutCubic = function(e, t, i, n) {
  30364. return e /= n / 2,
  30365. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30366. i / 2 * (e * e * e + 2) + t)
  30367. }
  30368. ,
  30369. n.easeInQuart = function(e, t, i, n) {
  30370. return e /= n,
  30371. i * e * e * e * e + t
  30372. }
  30373. ,
  30374. n.easeOutQuart = function(e, t, i, n) {
  30375. return e /= n,
  30376. e--,
  30377. -i * (e * e * e * e - 1) + t
  30378. }
  30379. ,
  30380. n.easeInOutQuart = function(e, t, i, n) {
  30381. return e /= n / 2,
  30382. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30383. -i / 2 * (e * e * e * e - 2) + t)
  30384. }
  30385. ,
  30386. n.easeInQuint = function(e, t, i, n) {
  30387. return e /= n,
  30388. i * e * e * e * e * e + t
  30389. }
  30390. ,
  30391. n.easeOutQuint = function(e, t, i, n) {
  30392. return e /= n,
  30393. e--,
  30394. i * (e * e * e * e * e + 1) + t
  30395. }
  30396. ,
  30397. n.easeInOutQuint = function(e, t, i, n) {
  30398. return e /= n / 2,
  30399. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30400. i / 2 * (e * e * e * e * e + 2) + t)
  30401. }
  30402. ,
  30403. n.easeInSine = function(e, t, i, n) {
  30404. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30405. }
  30406. ,
  30407. n.easeOutSine = function(e, t, i, n) {
  30408. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30409. }
  30410. ,
  30411. n.easeInOutSine = function(e, t, i, n) {
  30412. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30413. }
  30414. ,
  30415. n.easeInExpo = function(e, t, i, n) {
  30416. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30417. }
  30418. ,
  30419. n.easeOutExpo = function(e, t, i, n) {
  30420. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30421. }
  30422. ,
  30423. n.easeInOutExpo = function(e, t, i, n) {
  30424. return e /= n / 2,
  30425. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30426. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30427. }
  30428. ,
  30429. n.easeInCirc = function(e, t, i, n) {
  30430. return e /= n,
  30431. -i * (Math.sqrt(1 - e * e) - 1) + t
  30432. }
  30433. ,
  30434. n.easeOutCirc = function(e, t, i, n) {
  30435. return e /= n,
  30436. e--,
  30437. i * Math.sqrt(1 - e * e) + t
  30438. }
  30439. ,
  30440. n.easeInOutCirc = function(e, t, i, n) {
  30441. return e /= n / 2,
  30442. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30443. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30444. }
  30445. ,
  30446. n.easeInElastic = function(e, t, i, n) {
  30447. var r = 1.70158
  30448. , o = 0
  30449. , a = i;
  30450. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30451. a < Math.abs(i) ? (a = i,
  30452. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30453. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30454. }
  30455. ,
  30456. n.easeOutElastic = function(e, t, i, n) {
  30457. var r = 1.70158
  30458. , o = 0
  30459. , a = i;
  30460. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30461. a < Math.abs(i) ? (a = i,
  30462. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30463. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30464. }
  30465. ,
  30466. n.easeInOutElastic = function(e, t, i, n) {
  30467. var r = 1.70158
  30468. , o = 0
  30469. , a = i;
  30470. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30471. a < Math.abs(i) ? (a = i,
  30472. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30473. 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)
  30474. }
  30475. ,
  30476. n.easeInBack = function(e, t, i, n, r) {
  30477. return void 0 === r && (r = 1.70158),
  30478. i * (e /= n) * e * ((r + 1) * e - r) + t
  30479. }
  30480. ,
  30481. n.easeOutBack = function(e, t, i, n, r) {
  30482. return void 0 === r && (r = 1.70158),
  30483. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30484. }
  30485. ,
  30486. n.easeInOutBack = function(e, t, i, n, r) {
  30487. return void 0 === r && (r = 1.70158),
  30488. (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
  30489. }
  30490. ,
  30491. n.easeOutBounce = function(e, t, i, n) {
  30492. 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
  30493. }
  30494. ,
  30495. n.easeInBounce = function(e, t, i, r) {
  30496. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30497. }
  30498. ,
  30499. n.easeInOutBounce = function(e, t, i, r) {
  30500. 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
  30501. }
  30502. ,
  30503. t.exports = n
  30504. window.easing = n
  30505. }
  30506. , {}],
  30507. 187: [function(e, t, i) {
  30508. "use strict";
  30509. function n() {
  30510. this.events = [],
  30511. this.valid = !1
  30512. }
  30513. var r = e("../enum/Joystick");
  30514. n.prototype.push = function(e, t) {
  30515. this.events.push({
  30516. direction: e,
  30517. pano: t
  30518. }),
  30519. this.valid = !0
  30520. }
  30521. ,
  30522. n.prototype.pop = function(e) {
  30523. var t = this.events.pop();
  30524. return this.events.length < 1 && (this.valid = !1),
  30525. t
  30526. }
  30527. ,
  30528. n.prototype.peek = function() {
  30529. return this.events.length ? this.events[this.events.length - 1] : {
  30530. direction: null,
  30531. pano: null
  30532. }
  30533. }
  30534. ,
  30535. n.prototype.invalidate = function() {
  30536. this.events = [],
  30537. this.valid = !1
  30538. }
  30539. ,
  30540. n.prototype.reversePano = function(e) {
  30541. if (!this.valid)
  30542. return null;
  30543. var t = this.peek();
  30544. return r.opposite(e) === t.direction ? (this.pop(),
  30545. t.pano) : null
  30546. }
  30547. ,
  30548. t.exports = n
  30549. }
  30550. , {
  30551. "../enum/Joystick": 29
  30552. }],
  30553. 188: [function(e, t, i) {
  30554. "use strict";
  30555. window.lerp = t.exports = {
  30556. vector: function(e, t) {
  30557. var i = e.clone();
  30558. return t = t.clone(),
  30559. function(n) {
  30560. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30561. }
  30562. },
  30563. quaternion: function(e, t) {
  30564. var i = e.clone();
  30565. return function(n) {
  30566. e.copy(i).slerp(t, n)
  30567. }
  30568. },
  30569. property: function(e, t, i, n) {
  30570. var r = e[t];
  30571. return function(o) {
  30572. e[t] = r * (1 - o) + i * o,
  30573. n && n(e[t])
  30574. }
  30575. },
  30576. uniform: function(e, t, i) {
  30577. var n = e.material.uniforms[t].value;
  30578. return function(r) {
  30579. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30580. }
  30581. },
  30582. matrix4: function(e, t) {
  30583. var i = e.clone();
  30584. return function(n) {
  30585. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30586. r[s] = o[s] * (1 - n) + a[s] * n
  30587. }
  30588. },
  30589. allUniforms: function(e, t, i) {
  30590. var n = e.map(function(e) {
  30591. return this.uniform(e, t, i)
  30592. }
  30593. .bind(this));
  30594. return function(e) {
  30595. n.forEach(function(t) {
  30596. t(e)
  30597. })
  30598. }
  30599. }
  30600. }
  30601. }
  30602. , {}],
  30603. 189: [function(e, t, i) {
  30604. "use strict";
  30605. function n(e) {
  30606. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30607. if (n.consoleEnabled) {
  30608. var h = function(e) {
  30609. $("#debug-console").append("<p>" + e + "</p>"),
  30610. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30611. };
  30612. t = function(e) {
  30613. h(Array.prototype.slice.call(arguments).join(" "))
  30614. }
  30615. ,
  30616. i = function(e) {
  30617. h(Array.prototype.slice.call(arguments).join(" "))
  30618. }
  30619. ,
  30620. o = function(e) {
  30621. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30622. }
  30623. ,
  30624. a = function(e) {
  30625. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30626. }
  30627. } else
  30628. console.log ? (t = console.log,
  30629. i = console.info ? console.info : console.log,
  30630. o = console.warn ? console.warn : console.log,
  30631. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30632. ;
  30633. var u = function(e) {
  30634. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30635. }
  30636. , d = function(t, i) {
  30637. if (r) {
  30638. var o = Array.prototype.slice.call(t).join(" ");
  30639. r.captureMessage(o, {
  30640. level: i,
  30641. path: e,
  30642. timestamp: n.timestamp()
  30643. })
  30644. }
  30645. }
  30646. , p = function(t, i) {
  30647. if (r) {
  30648. var o = Array.prototype.slice.call(t).join(" ");
  30649. r.captureException(new Error(o), {
  30650. level: i,
  30651. path: e,
  30652. timestamp: n.timestamp()
  30653. })
  30654. }
  30655. };
  30656. return {
  30657. debug: function() {
  30658. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30659. },
  30660. info: function() {
  30661. n.level >= n.levels.info && i.apply(console, u(arguments))
  30662. },
  30663. warn: function() {
  30664. d(arguments, "warn"),
  30665. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30666. },
  30667. error: function() {
  30668. p(arguments, "error"),
  30669. n.level >= n.levels.error && a.apply(console, u(arguments))
  30670. },
  30671. v3str: function(e, t) {
  30672. var i = void 0 === t ? 2 : t;
  30673. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30674. },
  30675. eulstr: function(e, t) {
  30676. var i = void 0 === t ? 2 : t;
  30677. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30678. },
  30679. time: function(e) {
  30680. n.level >= n.levels.debug && (c[e] = Date.now())
  30681. },
  30682. timeEnd: function(e) {
  30683. if (n.level >= n.levels.debug) {
  30684. var t = c[e];
  30685. if (!t)
  30686. return;
  30687. var i = (Date.now() - t) / 1e3;
  30688. this.debug(e, i + "s")
  30689. }
  30690. }
  30691. }
  30692. }
  30693. var r = window.Raven;
  30694. n.timestamp = function() {
  30695. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30696. }
  30697. ,
  30698. n.levels = {
  30699. debug: 3,
  30700. info: 2,
  30701. warn: 1,
  30702. error: 0
  30703. },
  30704. n.level = n.levels.info,
  30705. t.exports = n
  30706. }
  30707. , {}],
  30708. 190: [function(e, t, i) {
  30709. "use strict";
  30710. var n = e("three")
  30711. , r = e("../enum/GLCubeFaces")
  30712. , o = e("../constants");
  30713. t.exports = {
  30714. convertVisionVector: function(e) {
  30715. return new n.Vector3(e.x,e.z,-e.y)
  30716. },
  30717. convertVisionQuaternion: function(e) {
  30718. 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)))
  30719. },
  30720. convertWorkshopVector: function(e) {
  30721. return new n.Vector3(-e.x,e.y,e.z)
  30722. },
  30723. convertWorkshopQuaternion: function(e) {
  30724. 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))
  30725. },
  30726. convertWorkshopPanoramaQuaternion: function(e) {
  30727. 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)))
  30728. },
  30729. convertWorkshopOrthoZoom: function(e) {// xzw
  30730. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30731. //return e;
  30732. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30733. },
  30734. toPrecision: function(e, t) {//xzw change
  30735. var f = function(e, t){
  30736. var i = Math.pow(10, t);
  30737. return Math.round(e * i) / i
  30738. }
  30739. if(e instanceof Array){
  30740. for(var s=0; s<e.length; s++){
  30741. e[s] = f(e[s],t);
  30742. }
  30743. return e;
  30744. }
  30745. else return f(e,t)
  30746. },
  30747. isEmptyQuaternion: function(e) {
  30748. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30749. },
  30750. projectPositionToCanvas: function(e, t, i) {
  30751. i = i || new n.Vector3,
  30752. i.copy(e);
  30753. var r = .5 * $("#player").width()
  30754. , o = .5 * $("#player").height();
  30755. return i.project(t),
  30756. i.x = i.x * r + r,
  30757. i.y = -(i.y * o) + o,
  30758. i
  30759. },
  30760. convertScreenPositionToNDC: function(e, t, i) {
  30761. return i = i || new n.Vector2,
  30762. i.x = e / $("#player").width() * 2 - 1,
  30763. i.y = 2 * -(t / $("#player").height()) + 1,
  30764. i
  30765. },
  30766. constrainedTurn: function(e) {
  30767. var t = e % (2 * Math.PI);
  30768. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30769. },
  30770. getFOVDotThreshold: function(e) {
  30771. return Math.cos(n.Math.degToRad(e / 2))
  30772. },
  30773. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30774. switch (e) {
  30775. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30776. i.set(1, t.y, t.x);
  30777. break;
  30778. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30779. i.set(-1, t.y, -t.x);
  30780. break;
  30781. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30782. i.set(-t.x, 1, -t.y);
  30783. break;
  30784. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30785. i.set(-t.x, -1, t.y);
  30786. break;
  30787. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30788. i.set(-t.x, t.y, 1);
  30789. break;
  30790. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30791. i.set(t.x, t.y, -1)
  30792. }
  30793. n && i.normalize()
  30794. },
  30795. //add:
  30796. getPos2d : function(point, camera, dom){
  30797. var camera = camera ;
  30798. var dom = dom;
  30799. 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);
  30800. var x,y;
  30801. x = (pos.x + 1) / 2 * dom.clientWidth;
  30802. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  30803. var inSight = x <= dom.clientWidth && x >= 0
  30804. && y <= dom.clientHeight && y >= 0
  30805. return {
  30806. pos: new THREE.Vector2(x,y),
  30807. vector: pos,
  30808. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30809. inSight : inSight //在屏幕范围内可见
  30810. };
  30811. }
  30812. }
  30813. window.math = t.exports
  30814. }
  30815. , {
  30816. "../constants": 8,
  30817. "../enum/GLCubeFaces": 25,
  30818. three: 217
  30819. }],
  30820. 191: [function(e, t, i) {
  30821. "use strict";
  30822. function n(e, t, i) {
  30823. return a.map(function(n, o) {
  30824. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  30825. }
  30826. .bind(this))
  30827. }
  30828. function r(e) {
  30829. return s[e]
  30830. }
  30831. var o = e("../enum/GLCubeFaces")
  30832. , a = [0, 1, 2, 3, 4, 5]
  30833. , s = {
  30834. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30835. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30836. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30837. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30838. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30839. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30840. };
  30841. t.exports = {
  30842. mapFaceToCubemapFace: r,
  30843. getCubemapUrls: n
  30844. }
  30845. }
  30846. , {
  30847. "../enum/GLCubeFaces": 25
  30848. }],
  30849. 192: [function(e, t, i) {
  30850. "use strict";
  30851. t.exports = {
  30852. captureErrors: function(e, t, i) {
  30853. if ("Raven"in window) {
  30854. Raven.config(e, t).install(),
  30855. i && Raven.setTagsContext(i);
  30856. var n = console.warn
  30857. , r = console.error;
  30858. console.warn = function() {
  30859. var e = Array.prototype.slice.call(arguments);
  30860. Raven.captureMessage(e.join(" "), {
  30861. level: "warning"
  30862. }),
  30863. n.apply(console, e)
  30864. }
  30865. ,
  30866. console.error = function() {
  30867. var e = Array.prototype.slice.call(arguments);
  30868. Raven.captureException(new Error(e.join(" ")), {
  30869. level: "error"
  30870. }),
  30871. r.apply(console, e)
  30872. }
  30873. } else
  30874. console.error("Raven not found, not capturing errors.")
  30875. }
  30876. }
  30877. }
  30878. , {}],
  30879. 193: [function(e, t, i) {
  30880. (function(i) {
  30881. "use strict";
  30882. var n = e("./browser")
  30883. , r = e("../constants")
  30884. , o = e("url")
  30885. , a = e("./logger")
  30886. , ss = e('three')
  30887. , s = new a(i)
  30888. , l = {
  30889. getAuthorizationHeader: function() {
  30890. var e = n.valueFromHash("auth");
  30891. if (e)
  30892. return e.replace(",", " ");
  30893. var t = n.valueFromCookie("token");
  30894. return t ? "Token " + t : null
  30895. },
  30896. parseSidUrl: function(e) {
  30897. var t, i;
  30898. t=g_Prefix;
  30899. if (e = e || "",
  30900. e.match(/^https?/)) {
  30901. var n = o.parse(e);
  30902. t = g_Prefix,
  30903. i = e
  30904. } else{
  30905. //xzw 原先的不能用
  30906. //t = window.location.protocol + "//" + window.location.host, //MP
  30907. t = g_Prefix
  30908. //i = t + "/api/player/models/" + e; //MP
  30909. i = t + "data/" + e;
  30910. }
  30911. return {
  30912. urlBase: t,
  30913. urlModel: i,
  30914. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  30915. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  30916. }
  30917. },
  30918. getModelIDFromQueryString: function() {
  30919. return n.valueFromHash("model") || n.valueFromHash("m")
  30920. },
  30921. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30922. e = JSON.parse(JSON.stringify(e));
  30923. var i = null;
  30924. if (e.images.forEach(function(n) {
  30925. if(!n.metadata) return;
  30926. if ("string" == typeof n.metadata)
  30927. try {
  30928. n.metadata = JSON.parse(n.metadata)
  30929. } catch (e) {
  30930. s.warn("Unable to parse image metadata"),
  30931. n.metadata = null
  30932. }
  30933. else{
  30934. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30935. }
  30936. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30937. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30938. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30939. }else{
  30940. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30941. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30942. n.metadata.zoom = n.metadata.zoom || 1;
  30943. }
  30944. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30945. }),
  30946. //icon初始视角的:
  30947. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30948. var n = {};
  30949. n.pano = {
  30950. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30951. position: t.convertWorkshopVector(i.scan_position),
  30952. uuid: i.scan_id
  30953. },
  30954. n.camera = {
  30955. quaternion: i.camera_quaternion,
  30956. position: i.camera_position
  30957. },
  30958. e.startPano = n
  30959. }
  30960. return e
  30961. },
  30962. */
  30963. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30964. e = JSON.parse(JSON.stringify(e));
  30965. var i = null;
  30966. var deal = function(n) {
  30967. if(!n.metadata) return;
  30968. if ("string" == typeof n.metadata)
  30969. try {
  30970. n.metadata = JSON.parse(n.metadata)
  30971. } catch (e) {
  30972. s.warn("Unable to parse image metadata"),
  30973. n.metadata = null
  30974. }
  30975. else{
  30976. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30977. }
  30978. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30979. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30980. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30981. }else{
  30982. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30983. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30984. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30985. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  30986. }
  30987. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30988. }
  30989. //改
  30990. e.images.forEach(info=>{
  30991. if(info.locations){
  30992. info.locations.forEach(a=>deal(a))
  30993. }else{
  30994. deal(info)
  30995. }
  30996. })
  30997. //icon初始视角的:
  30998. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30999. var n = {};
  31000. n.pano = {
  31001. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31002. position: t.convertWorkshopVector(i.scan_position),
  31003. uuid: i.scan_id
  31004. },
  31005. n.camera = {
  31006. quaternion: i.camera_quaternion,
  31007. position: i.camera_position
  31008. },
  31009. e.startPano = n
  31010. }
  31011. return e
  31012. },
  31013. visionVersionToInt: function() {
  31014. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31015. return function(t) {
  31016. if (!t)
  31017. throw new Error("Vision version is required");
  31018. var i = e.exec(t);
  31019. if (null === i)
  31020. throw new Error("String is not a vision version: " + t);
  31021. return parseInt(i[1])
  31022. }
  31023. }(),
  31024. modelDataPromisesTiles: function(e) {
  31025. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  31026. if (vision_version)
  31027. try {
  31028. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31029. } catch (t) {
  31030. s.warn("Invalid vision version: " + vision_version)
  31031. }
  31032. // var t = e.created ? new Date(e.created) : null;
  31033. // return t && t >= r.visionTilingStartDate
  31034. return false
  31035. }
  31036. };
  31037. t.exports = l
  31038. }
  31039. ).call(this, "/js/util/showcase.js")
  31040. }
  31041. , {
  31042. "../constants": 8,
  31043. "./browser": 182,
  31044. "./logger": 189,
  31045. three:217,
  31046. url: 208
  31047. }],
  31048. 194: [function(e, t, i) {
  31049. "use strict";
  31050. var n = e("../util/ajax")
  31051. , r = e("three")
  31052. , o = e("../settings")
  31053. , a = {};
  31054. t.exports = {
  31055. load: function(e, t, i) {
  31056. var s = a[e];
  31057. return s ? (t && setTimeout(function() {
  31058. t(s)
  31059. }, 1),
  31060. s) : (s = new r.Texture,
  31061. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31062. s.magFilter = r.LinearFilter,
  31063. s.generateMipmaps = !1),
  31064. s.sourceFile = e,
  31065. a[e] = s,
  31066. n.getImage(e).then(function(e) {
  31067. s.image = e,
  31068. s.needsUpdate = !0,
  31069. t && t(s)
  31070. }).fail(i),
  31071. s)
  31072. },
  31073. loadBase64: function(e, t) {
  31074. t = t || "png";
  31075. var i = new r.Texture;
  31076. return i.image = document.createElement("img"),
  31077. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31078. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31079. i.magFilter = r.LinearFilter,
  31080. i.generateMipmaps = !1),
  31081. i.needsUpdate = !0,
  31082. i
  31083. },
  31084. isLoaded: function(e) {
  31085. return !!a[e]
  31086. }
  31087. }
  31088. window.Texture = t.exports
  31089. }
  31090. , {
  31091. "../settings": 166,
  31092. "../util/ajax": 181,
  31093. three: 217
  31094. }],
  31095. 195: [function(e, t, i) {
  31096. "use strict";
  31097. var n = e("./easing");
  31098. window.transitions = t.exports = {
  31099. globalDone: null,
  31100. funcs: [],
  31101. counter: 0,
  31102. uniqueID: 0,
  31103. start: function(e, t, i, r, o, a, s) {
  31104. return r = r || 0,
  31105. this.funcs.push({
  31106. func: e,
  31107. current: -r * Math.abs(t),
  31108. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31109. done: i,
  31110. easing: o || n.linearTween,
  31111. cycling: t < 0,
  31112. running: !0,
  31113. debug: r < 0,
  31114. name: a || "T" + this.counter,
  31115. id: void 0 === s ? this.counter : s,
  31116. paused: !1
  31117. }),
  31118. e(0, 16),
  31119. this.counter += 1,
  31120. e
  31121. },
  31122. trigger: function(e) {
  31123. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31124. , i = e.func || function() {}
  31125. , r = void 0 === e.duration ? 0 : e.duration;
  31126. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31127. var o = e.done || null
  31128. , a = e.easing || n.linearTween
  31129. , s = e.name || "R" + this.counter
  31130. , l = void 0 === e.id ? this.counter : e.id;
  31131. return this.start(i, r, o, t, a, s, l)
  31132. },
  31133. setTimeout: function(e, t, i) {
  31134. var n = void 0 === i ? this.counter : i;
  31135. return this.trigger({
  31136. done: e,
  31137. duration: void 0 === t ? 0 : t,
  31138. name: "O" + this.counter,
  31139. id: n
  31140. })
  31141. },
  31142. pause: function() {
  31143. this.paused = !0
  31144. },
  31145. resume: function() {
  31146. this.paused = !1
  31147. },
  31148. update: function(e) {
  31149. this.funcs.forEach(function(t) {
  31150. if (!(t.paused || (t.current += 1e3 * e,
  31151. t.current < 0)))
  31152. if (t.current >= t.duration && !t.cycling) {
  31153. var i = t.easing(1, 0, 1, 1);
  31154. t.func(i, 1e3 * e),
  31155. t.done && t.done(),
  31156. t.running = !1
  31157. } else {
  31158. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31159. , r = t.func(n, 1e3 * e) || !1;
  31160. r && (t.done && t.done(),
  31161. t.running = !1)
  31162. }
  31163. });
  31164. var t = this.funcs.length;
  31165. this.funcs = this.funcs.filter(function(e) {
  31166. return e.running
  31167. });
  31168. var i = this.funcs.length;
  31169. if (t > 0 && 0 === i && this.globalDone) {
  31170. var n = this.globalDone;
  31171. this.globalDone = null,
  31172. n()
  31173. }
  31174. },
  31175. adjustSpeed: function(e, t) {
  31176. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31177. var r = i[n];
  31178. r.duration /= t,
  31179. r.current /= t
  31180. }
  31181. },
  31182. getById: function(e) {
  31183. return this.funcs.filter(function(t) {
  31184. return e === t.id
  31185. })
  31186. },
  31187. get: function(e) {
  31188. for (var t = 0; t < this.funcs.length; t += 1)
  31189. if (this.funcs[t].func === e)
  31190. return this.funcs[t];
  31191. return null
  31192. },
  31193. isRunning: function(e) {
  31194. var t = this.get(e);
  31195. return null !== t && t.running
  31196. },
  31197. countActive: function() {
  31198. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31199. e += this.funcs[t].running;
  31200. return e
  31201. },
  31202. listActive: function() {
  31203. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31204. this.funcs[t].running && e.push(this.funcs[t].name);
  31205. return e
  31206. },
  31207. done: function(e) {
  31208. this.globalDone = e
  31209. },
  31210. cancelById: function(e) {
  31211. var t = void 0 === e ? 0 : e;
  31212. this.funcs = this.funcs.filter(function(e) {
  31213. return e.id !== t
  31214. })
  31215. },
  31216. cancel: function(e) {
  31217. this.funcs = this.funcs.filter(function(t) {
  31218. return t.func !== e
  31219. })
  31220. },
  31221. getUniqueId: function() {
  31222. return this.uniqueID -= 1,
  31223. this.uniqueID
  31224. }
  31225. }
  31226. }
  31227. , {
  31228. "./easing": 186
  31229. }],
  31230. 196: [function(e, t, i) {
  31231. function n(e) {
  31232. if (this.set = {},
  31233. this.infContains = function() {
  31234. return !0
  31235. }
  31236. ,
  31237. "object" == typeof e)
  31238. if (e instanceof Array)
  31239. for (var t = 0; t < e.length; t++)
  31240. this.set[e[t]] = !0;
  31241. else
  31242. this.set = e;
  31243. else if ("function" == typeof e)
  31244. this.infContains = e;
  31245. else if ("undefined" != typeof e)
  31246. throw new Error("set must be either an array or an object.")
  31247. }
  31248. t.exports = n,
  31249. n.prototype.contains = function(e) {
  31250. return !!this.set[e]
  31251. }
  31252. ,
  31253. n.prototype.has = n.prototype.contains,
  31254. n.prototype.add = function(e) {
  31255. if (1 == arguments.length)
  31256. this.set[e] = !0;
  31257. else
  31258. for (var t = 0; t < arguments.length; t++)
  31259. this.set[arguments[t]] = !0
  31260. }
  31261. ,
  31262. n.prototype.addAll = function(e) {
  31263. if ("object" != typeof e && !(e instanceof Array))
  31264. throw new Error("arr must be an array.");
  31265. for (var t = 0; t < e.length; t++)
  31266. this.add(e[t])
  31267. }
  31268. ,
  31269. n.prototype.remove = function(e) {
  31270. if (1 == arguments.length)
  31271. delete this.set[e];
  31272. else
  31273. for (var t = 0; t < arguments.length; t++)
  31274. delete this.set[arguments[t]]
  31275. }
  31276. ,
  31277. n.prototype.delete = n.prototype.remove,
  31278. n.prototype.clear = function() {
  31279. this.set = {}
  31280. }
  31281. ,
  31282. n.prototype.size = function() {
  31283. return Object.keys(this.set).length
  31284. }
  31285. ,
  31286. n.prototype.toString = function() {
  31287. return "{" + Object.keys(this.set).toString() + "}"
  31288. }
  31289. ,
  31290. n.prototype.toArray = function() {
  31291. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31292. }
  31293. ,
  31294. n.prototype["*values"] = n.prototype.toArray
  31295. }
  31296. , {}],
  31297. 197: [function(e, t, i) {}
  31298. , {}],
  31299. 198: [function(e, t, i) {
  31300. (function(t) {
  31301. "use strict";
  31302. function n() {
  31303. try {
  31304. var e = new Uint8Array(1);
  31305. return e.__proto__ = {
  31306. __proto__: Uint8Array.prototype,
  31307. foo: function() {
  31308. return 42
  31309. }
  31310. },
  31311. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31312. } catch (e) {
  31313. return !1
  31314. }
  31315. }
  31316. function r() {
  31317. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31318. }
  31319. function o(e, t) {
  31320. if (r() < t)
  31321. throw new RangeError("Invalid typed array length");
  31322. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31323. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31324. e.length = t),
  31325. e
  31326. }
  31327. function a(e, t, i) {
  31328. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31329. return new a(e,t,i);
  31330. if ("number" == typeof e) {
  31331. if ("string" == typeof t)
  31332. throw new Error("If encoding is specified then the first argument must be a string");
  31333. return h(this, e)
  31334. }
  31335. return s(this, e, t, i)
  31336. }
  31337. function s(e, t, i, n) {
  31338. if ("number" == typeof t)
  31339. throw new TypeError('"value" argument must not be a number');
  31340. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31341. }
  31342. function l(e) {
  31343. if ("number" != typeof e)
  31344. throw new TypeError('"size" argument must be a number');
  31345. if (e < 0)
  31346. throw new RangeError('"size" argument must not be negative')
  31347. }
  31348. function c(e, t, i, n) {
  31349. return l(t),
  31350. 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)
  31351. }
  31352. function h(e, t) {
  31353. if (l(t),
  31354. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31355. !a.TYPED_ARRAY_SUPPORT)
  31356. for (var i = 0; i < t; ++i)
  31357. e[i] = 0;
  31358. return e
  31359. }
  31360. function u(e, t, i) {
  31361. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31362. !a.isEncoding(i))
  31363. throw new TypeError('"encoding" must be a valid string encoding');
  31364. var n = 0 | v(t, i);
  31365. e = o(e, n);
  31366. var r = e.write(t, i);
  31367. return r !== n && (e = e.slice(0, r)),
  31368. e
  31369. }
  31370. function d(e, t) {
  31371. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31372. e = o(e, i);
  31373. for (var n = 0; n < i; n += 1)
  31374. e[n] = 255 & t[n];
  31375. return e
  31376. }
  31377. function p(e, t, i, n) {
  31378. if (t.byteLength,
  31379. i < 0 || t.byteLength < i)
  31380. throw new RangeError("'offset' is out of bounds");
  31381. if (t.byteLength < i + (n || 0))
  31382. throw new RangeError("'length' is out of bounds");
  31383. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31384. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31385. e.__proto__ = a.prototype) : e = d(e, t),
  31386. e
  31387. }
  31388. function f(e, t) {
  31389. if (a.isBuffer(t)) {
  31390. var i = 0 | g(t.length);
  31391. return e = o(e, i),
  31392. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31393. e)
  31394. }
  31395. if (t) {
  31396. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31397. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31398. if ("Buffer" === t.type && $(t.data))
  31399. return d(e, t.data)
  31400. }
  31401. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31402. }
  31403. function g(e) {
  31404. if (e >= r())
  31405. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31406. return 0 | e
  31407. }
  31408. function m(e) {
  31409. return +e != e && (e = 0),
  31410. a.alloc(+e)
  31411. }
  31412. function v(e, t) {
  31413. if (a.isBuffer(e))
  31414. return e.length;
  31415. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31416. return e.byteLength;
  31417. "string" != typeof e && (e = "" + e);
  31418. var i = e.length;
  31419. if (0 === i)
  31420. return 0;
  31421. for (var n = !1; ; )
  31422. switch (t) {
  31423. case "ascii":
  31424. case "latin1":
  31425. case "binary":
  31426. return i;
  31427. case "utf8":
  31428. case "utf-8":
  31429. case void 0:
  31430. return j(e).length;
  31431. case "ucs2":
  31432. case "ucs-2":
  31433. case "utf16le":
  31434. case "utf-16le":
  31435. return 2 * i;
  31436. case "hex":
  31437. return i >>> 1;
  31438. case "base64":
  31439. return Z(e).length;
  31440. default:
  31441. if (n)
  31442. return j(e).length;
  31443. t = ("" + t).toLowerCase(),
  31444. n = !0
  31445. }
  31446. }
  31447. function A(e, t, i) {
  31448. var n = !1;
  31449. if ((void 0 === t || t < 0) && (t = 0),
  31450. t > this.length)
  31451. return "";
  31452. if ((void 0 === i || i > this.length) && (i = this.length),
  31453. i <= 0)
  31454. return "";
  31455. if (i >>>= 0,
  31456. t >>>= 0,
  31457. i <= t)
  31458. return "";
  31459. for (e || (e = "utf8"); ; )
  31460. switch (e) {
  31461. case "hex":
  31462. return L(this, t, i);
  31463. case "utf8":
  31464. case "utf-8":
  31465. return M(this, t, i);
  31466. case "ascii":
  31467. return P(this, t, i);
  31468. case "latin1":
  31469. case "binary":
  31470. return O(this, t, i);
  31471. case "base64":
  31472. return S(this, t, i);
  31473. case "ucs2":
  31474. case "ucs-2":
  31475. case "utf16le":
  31476. case "utf-16le":
  31477. return D(this, t, i);
  31478. default:
  31479. if (n)
  31480. throw new TypeError("Unknown encoding: " + e);
  31481. e = (e + "").toLowerCase(),
  31482. n = !0
  31483. }
  31484. }
  31485. function y(e, t, i) {
  31486. var n = e[t];
  31487. e[t] = e[i],
  31488. e[i] = n
  31489. }
  31490. function C(e, t, i, n, r) {
  31491. if (0 === e.length)
  31492. return -1;
  31493. if ("string" == typeof i ? (n = i,
  31494. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31495. i = +i,
  31496. isNaN(i) && (i = r ? 0 : e.length - 1),
  31497. i < 0 && (i = e.length + i),
  31498. i >= e.length) {
  31499. if (r)
  31500. return -1;
  31501. i = e.length - 1
  31502. } else if (i < 0) {
  31503. if (!r)
  31504. return -1;
  31505. i = 0
  31506. }
  31507. if ("string" == typeof t && (t = a.from(t, n)),
  31508. a.isBuffer(t))
  31509. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31510. if ("number" == typeof t)
  31511. return t &= 255,
  31512. 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);
  31513. throw new TypeError("val must be string, number or Buffer")
  31514. }
  31515. function I(e, t, i, n, r) {
  31516. function o(e, t) {
  31517. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31518. }
  31519. var a = 1
  31520. , s = e.length
  31521. , l = t.length;
  31522. if (void 0 !== n && (n = String(n).toLowerCase(),
  31523. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31524. if (e.length < 2 || t.length < 2)
  31525. return -1;
  31526. a = 2,
  31527. s /= 2,
  31528. l /= 2,
  31529. i /= 2
  31530. }
  31531. var c;
  31532. if (r) {
  31533. var h = -1;
  31534. for (c = i; c < s; c++)
  31535. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31536. if (h === -1 && (h = c),
  31537. c - h + 1 === l)
  31538. return h * a
  31539. } else
  31540. h !== -1 && (c -= c - h),
  31541. h = -1
  31542. } else
  31543. for (i + l > s && (i = s - l),
  31544. c = i; c >= 0; c--) {
  31545. for (var u = !0, d = 0; d < l; d++)
  31546. if (o(e, c + d) !== o(t, d)) {
  31547. u = !1;
  31548. break
  31549. }
  31550. if (u)
  31551. return c
  31552. }
  31553. return -1
  31554. }
  31555. function E(e, t, i, n) {
  31556. i = Number(i) || 0;
  31557. var r = e.length - i;
  31558. n ? (n = Number(n),
  31559. n > r && (n = r)) : n = r;
  31560. var o = t.length;
  31561. if (o % 2 !== 0)
  31562. throw new TypeError("Invalid hex string");
  31563. n > o / 2 && (n = o / 2);
  31564. for (var a = 0; a < n; ++a) {
  31565. var s = parseInt(t.substr(2 * a, 2), 16);
  31566. if (isNaN(s))
  31567. return a;
  31568. e[i + a] = s
  31569. }
  31570. return a
  31571. }
  31572. function b(e, t, i, n) {
  31573. return q(j(t, e.length - i), e, i, n)
  31574. }
  31575. function w(e, t, i, n) {
  31576. return q(Y(t), e, i, n)
  31577. }
  31578. function _(e, t, i, n) {
  31579. return w(e, t, i, n)
  31580. }
  31581. function T(e, t, i, n) {
  31582. return q(Z(t), e, i, n)
  31583. }
  31584. function x(e, t, i, n) {
  31585. return q(X(t, e.length - i), e, i, n)
  31586. }
  31587. function S(e, t, i) {
  31588. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31589. }
  31590. function M(e, t, i) {
  31591. i = Math.min(e.length, i);
  31592. for (var n = [], r = t; r < i; ) {
  31593. var o = e[r]
  31594. , a = null
  31595. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31596. if (r + s <= i) {
  31597. var l, c, h, u;
  31598. switch (s) {
  31599. case 1:
  31600. o < 128 && (a = o);
  31601. break;
  31602. case 2:
  31603. l = e[r + 1],
  31604. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31605. u > 127 && (a = u));
  31606. break;
  31607. case 3:
  31608. l = e[r + 1],
  31609. c = e[r + 2],
  31610. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31611. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31612. break;
  31613. case 4:
  31614. l = e[r + 1],
  31615. c = e[r + 2],
  31616. h = e[r + 3],
  31617. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31618. u > 65535 && u < 1114112 && (a = u))
  31619. }
  31620. }
  31621. null === a ? (a = 65533,
  31622. s = 1) : a > 65535 && (a -= 65536,
  31623. n.push(a >>> 10 & 1023 | 55296),
  31624. a = 56320 | 1023 & a),
  31625. n.push(a),
  31626. r += s
  31627. }
  31628. return R(n)
  31629. }
  31630. function R(e) {
  31631. var t = e.length;
  31632. if (t <= ee)
  31633. return String.fromCharCode.apply(String, e);
  31634. for (var i = "", n = 0; n < t; )
  31635. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31636. return i
  31637. }
  31638. function P(e, t, i) {
  31639. var n = "";
  31640. i = Math.min(e.length, i);
  31641. for (var r = t; r < i; ++r)
  31642. n += String.fromCharCode(127 & e[r]);
  31643. return n
  31644. }
  31645. function O(e, t, i) {
  31646. var n = "";
  31647. i = Math.min(e.length, i);
  31648. for (var r = t; r < i; ++r)
  31649. n += String.fromCharCode(e[r]);
  31650. return n
  31651. }
  31652. function L(e, t, i) {
  31653. var n = e.length;
  31654. (!t || t < 0) && (t = 0),
  31655. (!i || i < 0 || i > n) && (i = n);
  31656. for (var r = "", o = t; o < i; ++o)
  31657. r += W(e[o]);
  31658. return r
  31659. }
  31660. function D(e, t, i) {
  31661. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31662. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31663. return r
  31664. }
  31665. function N(e, t, i) {
  31666. if (e % 1 !== 0 || e < 0)
  31667. throw new RangeError("offset is not uint");
  31668. if (e + t > i)
  31669. throw new RangeError("Trying to access beyond buffer length")
  31670. }
  31671. function B(e, t, i, n, r, o) {
  31672. if (!a.isBuffer(e))
  31673. throw new TypeError('"buffer" argument must be a Buffer instance');
  31674. if (t > r || t < o)
  31675. throw new RangeError('"value" argument is out of bounds');
  31676. if (i + n > e.length)
  31677. throw new RangeError("Index out of range")
  31678. }
  31679. function F(e, t, i, n) {
  31680. t < 0 && (t = 65535 + t + 1);
  31681. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31682. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31683. }
  31684. function V(e, t, i, n) {
  31685. t < 0 && (t = 4294967295 + t + 1);
  31686. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31687. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31688. }
  31689. function U(e, t, i, n, r, o) {
  31690. if (i + n > e.length)
  31691. throw new RangeError("Index out of range");
  31692. if (i < 0)
  31693. throw new RangeError("Index out of range")
  31694. }
  31695. function k(e, t, i, n, r) {
  31696. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31697. J.write(e, t, i, n, 23, 4),
  31698. i + 4
  31699. }
  31700. function H(e, t, i, n, r) {
  31701. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31702. J.write(e, t, i, n, 52, 8),
  31703. i + 8
  31704. }
  31705. function G(e) {
  31706. if (e = z(e).replace(te, ""),
  31707. e.length < 2)
  31708. return "";
  31709. for (; e.length % 4 !== 0; )
  31710. e += "=";
  31711. return e
  31712. }
  31713. function z(e) {
  31714. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31715. }
  31716. function W(e) {
  31717. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31718. }
  31719. function j(e, t) {
  31720. t = t || 1 / 0;
  31721. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31722. if (i = e.charCodeAt(a),
  31723. i > 55295 && i < 57344) {
  31724. if (!r) {
  31725. if (i > 56319) {
  31726. (t -= 3) > -1 && o.push(239, 191, 189);
  31727. continue
  31728. }
  31729. if (a + 1 === n) {
  31730. (t -= 3) > -1 && o.push(239, 191, 189);
  31731. continue
  31732. }
  31733. r = i;
  31734. continue
  31735. }
  31736. if (i < 56320) {
  31737. (t -= 3) > -1 && o.push(239, 191, 189),
  31738. r = i;
  31739. continue
  31740. }
  31741. i = (r - 55296 << 10 | i - 56320) + 65536
  31742. } else
  31743. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31744. if (r = null,
  31745. i < 128) {
  31746. if ((t -= 1) < 0)
  31747. break;
  31748. o.push(i)
  31749. } else if (i < 2048) {
  31750. if ((t -= 2) < 0)
  31751. break;
  31752. o.push(i >> 6 | 192, 63 & i | 128)
  31753. } else if (i < 65536) {
  31754. if ((t -= 3) < 0)
  31755. break;
  31756. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31757. } else {
  31758. if (!(i < 1114112))
  31759. throw new Error("Invalid code point");
  31760. if ((t -= 4) < 0)
  31761. break;
  31762. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31763. }
  31764. }
  31765. return o
  31766. }
  31767. function Y(e) {
  31768. for (var t = [], i = 0; i < e.length; ++i)
  31769. t.push(255 & e.charCodeAt(i));
  31770. return t
  31771. }
  31772. function X(e, t) {
  31773. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31774. i = e.charCodeAt(a),
  31775. n = i >> 8,
  31776. r = i % 256,
  31777. o.push(r),
  31778. o.push(n);
  31779. return o
  31780. }
  31781. function Z(e) {
  31782. return Q.toByteArray(G(e))
  31783. }
  31784. function q(e, t, i, n) {
  31785. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  31786. t[r + i] = e[r];
  31787. return r
  31788. }
  31789. function K(e) {
  31790. return e !== e
  31791. }
  31792. var Q = e("base64-js")
  31793. , J = e("ieee754")
  31794. , $ = e("isarray");
  31795. i.Buffer = a,
  31796. i.SlowBuffer = m,
  31797. i.INSPECT_MAX_BYTES = 50,
  31798. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  31799. i.kMaxLength = r(),
  31800. a.poolSize = 8192,
  31801. a._augment = function(e) {
  31802. return e.__proto__ = a.prototype,
  31803. e
  31804. }
  31805. ,
  31806. a.from = function(e, t, i) {
  31807. return s(null, e, t, i)
  31808. }
  31809. ,
  31810. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  31811. a.__proto__ = Uint8Array,
  31812. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  31813. value: null,
  31814. configurable: !0
  31815. })),
  31816. a.alloc = function(e, t, i) {
  31817. return c(null, e, t, i)
  31818. }
  31819. ,
  31820. a.allocUnsafe = function(e) {
  31821. return h(null, e)
  31822. }
  31823. ,
  31824. a.allocUnsafeSlow = function(e) {
  31825. return h(null, e)
  31826. }
  31827. ,
  31828. a.isBuffer = function(e) {
  31829. return !(null == e || !e._isBuffer)
  31830. }
  31831. ,
  31832. a.compare = function(e, t) {
  31833. if (!a.isBuffer(e) || !a.isBuffer(t))
  31834. throw new TypeError("Arguments must be Buffers");
  31835. if (e === t)
  31836. return 0;
  31837. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31838. if (e[r] !== t[r]) {
  31839. i = e[r],
  31840. n = t[r];
  31841. break
  31842. }
  31843. return i < n ? -1 : n < i ? 1 : 0
  31844. }
  31845. ,
  31846. a.isEncoding = function(e) {
  31847. switch (String(e).toLowerCase()) {
  31848. case "hex":
  31849. case "utf8":
  31850. case "utf-8":
  31851. case "ascii":
  31852. case "latin1":
  31853. case "binary":
  31854. case "base64":
  31855. case "ucs2":
  31856. case "ucs-2":
  31857. case "utf16le":
  31858. case "utf-16le":
  31859. return !0;
  31860. default:
  31861. return !1
  31862. }
  31863. }
  31864. ,
  31865. a.concat = function(e, t) {
  31866. if (!$(e))
  31867. throw new TypeError('"list" argument must be an Array of Buffers');
  31868. if (0 === e.length)
  31869. return a.alloc(0);
  31870. var i;
  31871. if (void 0 === t)
  31872. for (t = 0,
  31873. i = 0; i < e.length; ++i)
  31874. t += e[i].length;
  31875. var n = a.allocUnsafe(t)
  31876. , r = 0;
  31877. for (i = 0; i < e.length; ++i) {
  31878. var o = e[i];
  31879. if (!a.isBuffer(o))
  31880. throw new TypeError('"list" argument must be an Array of Buffers');
  31881. o.copy(n, r),
  31882. r += o.length
  31883. }
  31884. return n
  31885. }
  31886. ,
  31887. a.byteLength = v,
  31888. a.prototype._isBuffer = !0,
  31889. a.prototype.swap16 = function() {
  31890. var e = this.length;
  31891. if (e % 2 !== 0)
  31892. throw new RangeError("Buffer size must be a multiple of 16-bits");
  31893. for (var t = 0; t < e; t += 2)
  31894. y(this, t, t + 1);
  31895. return this
  31896. }
  31897. ,
  31898. a.prototype.swap32 = function() {
  31899. var e = this.length;
  31900. if (e % 4 !== 0)
  31901. throw new RangeError("Buffer size must be a multiple of 32-bits");
  31902. for (var t = 0; t < e; t += 4)
  31903. y(this, t, t + 3),
  31904. y(this, t + 1, t + 2);
  31905. return this
  31906. }
  31907. ,
  31908. a.prototype.swap64 = function() {
  31909. var e = this.length;
  31910. if (e % 8 !== 0)
  31911. throw new RangeError("Buffer size must be a multiple of 64-bits");
  31912. for (var t = 0; t < e; t += 8)
  31913. y(this, t, t + 7),
  31914. y(this, t + 1, t + 6),
  31915. y(this, t + 2, t + 5),
  31916. y(this, t + 3, t + 4);
  31917. return this
  31918. }
  31919. ,
  31920. a.prototype.toString = function() {
  31921. var e = 0 | this.length;
  31922. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31923. }
  31924. ,
  31925. a.prototype.equals = function(e) {
  31926. if (!a.isBuffer(e))
  31927. throw new TypeError("Argument must be a Buffer");
  31928. return this === e || 0 === a.compare(this, e)
  31929. }
  31930. ,
  31931. a.prototype.inspect = function() {
  31932. var e = ""
  31933. , t = i.INSPECT_MAX_BYTES;
  31934. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  31935. this.length > t && (e += " ... ")),
  31936. "<Buffer " + e + ">"
  31937. }
  31938. ,
  31939. a.prototype.compare = function(e, t, i, n, r) {
  31940. if (!a.isBuffer(e))
  31941. throw new TypeError("Argument must be a Buffer");
  31942. if (void 0 === t && (t = 0),
  31943. void 0 === i && (i = e ? e.length : 0),
  31944. void 0 === n && (n = 0),
  31945. void 0 === r && (r = this.length),
  31946. t < 0 || i > e.length || n < 0 || r > this.length)
  31947. throw new RangeError("out of range index");
  31948. if (n >= r && t >= i)
  31949. return 0;
  31950. if (n >= r)
  31951. return -1;
  31952. if (t >= i)
  31953. return 1;
  31954. if (t >>>= 0,
  31955. i >>>= 0,
  31956. n >>>= 0,
  31957. r >>>= 0,
  31958. this === e)
  31959. return 0;
  31960. 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)
  31961. if (c[u] !== h[u]) {
  31962. o = c[u],
  31963. s = h[u];
  31964. break
  31965. }
  31966. return o < s ? -1 : s < o ? 1 : 0
  31967. }
  31968. ,
  31969. a.prototype.includes = function(e, t, i) {
  31970. return this.indexOf(e, t, i) !== -1
  31971. }
  31972. ,
  31973. a.prototype.indexOf = function(e, t, i) {
  31974. return C(this, e, t, i, !0)
  31975. }
  31976. ,
  31977. a.prototype.lastIndexOf = function(e, t, i) {
  31978. return C(this, e, t, i, !1)
  31979. }
  31980. ,
  31981. a.prototype.write = function(e, t, i, n) {
  31982. if (void 0 === t)
  31983. n = "utf8",
  31984. i = this.length,
  31985. t = 0;
  31986. else if (void 0 === i && "string" == typeof t)
  31987. n = t,
  31988. i = this.length,
  31989. t = 0;
  31990. else {
  31991. if (!isFinite(t))
  31992. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  31993. t |= 0,
  31994. isFinite(i) ? (i |= 0,
  31995. void 0 === n && (n = "utf8")) : (n = i,
  31996. i = void 0)
  31997. }
  31998. var r = this.length - t;
  31999. if ((void 0 === i || i > r) && (i = r),
  32000. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32001. throw new RangeError("Attempt to write outside buffer bounds");
  32002. n || (n = "utf8");
  32003. for (var o = !1; ; )
  32004. switch (n) {
  32005. case "hex":
  32006. return E(this, e, t, i);
  32007. case "utf8":
  32008. case "utf-8":
  32009. return b(this, e, t, i);
  32010. case "ascii":
  32011. return w(this, e, t, i);
  32012. case "latin1":
  32013. case "binary":
  32014. return _(this, e, t, i);
  32015. case "base64":
  32016. return T(this, e, t, i);
  32017. case "ucs2":
  32018. case "ucs-2":
  32019. case "utf16le":
  32020. case "utf-16le":
  32021. return x(this, e, t, i);
  32022. default:
  32023. if (o)
  32024. throw new TypeError("Unknown encoding: " + n);
  32025. n = ("" + n).toLowerCase(),
  32026. o = !0
  32027. }
  32028. }
  32029. ,
  32030. a.prototype.toJSON = function() {
  32031. return {
  32032. type: "Buffer",
  32033. data: Array.prototype.slice.call(this._arr || this, 0)
  32034. }
  32035. }
  32036. ;
  32037. var ee = 4096;
  32038. a.prototype.slice = function(e, t) {
  32039. var i = this.length;
  32040. e = ~~e,
  32041. t = void 0 === t ? i : ~~t,
  32042. e < 0 ? (e += i,
  32043. e < 0 && (e = 0)) : e > i && (e = i),
  32044. t < 0 ? (t += i,
  32045. t < 0 && (t = 0)) : t > i && (t = i),
  32046. t < e && (t = e);
  32047. var n;
  32048. if (a.TYPED_ARRAY_SUPPORT)
  32049. n = this.subarray(e, t),
  32050. n.__proto__ = a.prototype;
  32051. else {
  32052. var r = t - e;
  32053. n = new a(r,void 0);
  32054. for (var o = 0; o < r; ++o)
  32055. n[o] = this[o + e]
  32056. }
  32057. return n
  32058. }
  32059. ,
  32060. a.prototype.readUIntLE = function(e, t, i) {
  32061. e |= 0,
  32062. t |= 0,
  32063. i || N(e, t, this.length);
  32064. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32065. n += this[e + o] * r;
  32066. return n
  32067. }
  32068. ,
  32069. a.prototype.readUIntBE = function(e, t, i) {
  32070. e |= 0,
  32071. t |= 0,
  32072. i || N(e, t, this.length);
  32073. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32074. n += this[e + --t] * r;
  32075. return n
  32076. }
  32077. ,
  32078. a.prototype.readUInt8 = function(e, t) {
  32079. return t || N(e, 1, this.length),
  32080. this[e]
  32081. }
  32082. ,
  32083. a.prototype.readUInt16LE = function(e, t) {
  32084. return t || N(e, 2, this.length),
  32085. this[e] | this[e + 1] << 8
  32086. }
  32087. ,
  32088. a.prototype.readUInt16BE = function(e, t) {
  32089. return t || N(e, 2, this.length),
  32090. this[e] << 8 | this[e + 1]
  32091. }
  32092. ,
  32093. a.prototype.readUInt32LE = function(e, t) {
  32094. return t || N(e, 4, this.length),
  32095. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32096. }
  32097. ,
  32098. a.prototype.readUInt32BE = function(e, t) {
  32099. return t || N(e, 4, this.length),
  32100. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32101. }
  32102. ,
  32103. a.prototype.readIntLE = function(e, t, i) {
  32104. e |= 0,
  32105. t |= 0,
  32106. i || N(e, t, this.length);
  32107. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32108. n += this[e + o] * r;
  32109. return r *= 128,
  32110. n >= r && (n -= Math.pow(2, 8 * t)),
  32111. n
  32112. }
  32113. ,
  32114. a.prototype.readIntBE = function(e, t, i) {
  32115. e |= 0,
  32116. t |= 0,
  32117. i || N(e, t, this.length);
  32118. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32119. o += this[e + --n] * r;
  32120. return r *= 128,
  32121. o >= r && (o -= Math.pow(2, 8 * t)),
  32122. o
  32123. }
  32124. ,
  32125. a.prototype.readInt8 = function(e, t) {
  32126. return t || N(e, 1, this.length),
  32127. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32128. }
  32129. ,
  32130. a.prototype.readInt16LE = function(e, t) {
  32131. t || N(e, 2, this.length);
  32132. var i = this[e] | this[e + 1] << 8;
  32133. return 32768 & i ? 4294901760 | i : i
  32134. }
  32135. ,
  32136. a.prototype.readInt16BE = function(e, t) {
  32137. t || N(e, 2, this.length);
  32138. var i = this[e + 1] | this[e] << 8;
  32139. return 32768 & i ? 4294901760 | i : i
  32140. }
  32141. ,
  32142. a.prototype.readInt32LE = function(e, t) {
  32143. return t || N(e, 4, this.length),
  32144. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32145. }
  32146. ,
  32147. a.prototype.readInt32BE = function(e, t) {
  32148. return t || N(e, 4, this.length),
  32149. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32150. }
  32151. ,
  32152. a.prototype.readFloatLE = function(e, t) {
  32153. return t || N(e, 4, this.length),
  32154. J.read(this, e, !0, 23, 4)
  32155. }
  32156. ,
  32157. a.prototype.readFloatBE = function(e, t) {
  32158. return t || N(e, 4, this.length),
  32159. J.read(this, e, !1, 23, 4)
  32160. }
  32161. ,
  32162. a.prototype.readDoubleLE = function(e, t) {
  32163. return t || N(e, 8, this.length),
  32164. J.read(this, e, !0, 52, 8)
  32165. }
  32166. ,
  32167. a.prototype.readDoubleBE = function(e, t) {
  32168. return t || N(e, 8, this.length),
  32169. J.read(this, e, !1, 52, 8)
  32170. }
  32171. ,
  32172. a.prototype.writeUIntLE = function(e, t, i, n) {
  32173. if (e = +e,
  32174. t |= 0,
  32175. i |= 0,
  32176. !n) {
  32177. var r = Math.pow(2, 8 * i) - 1;
  32178. B(this, e, t, i, r, 0)
  32179. }
  32180. var o = 1
  32181. , a = 0;
  32182. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32183. this[t + a] = e / o & 255;
  32184. return t + i
  32185. }
  32186. ,
  32187. a.prototype.writeUIntBE = function(e, t, i, n) {
  32188. if (e = +e,
  32189. t |= 0,
  32190. i |= 0,
  32191. !n) {
  32192. var r = Math.pow(2, 8 * i) - 1;
  32193. B(this, e, t, i, r, 0)
  32194. }
  32195. var o = i - 1
  32196. , a = 1;
  32197. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32198. this[t + o] = e / a & 255;
  32199. return t + i
  32200. }
  32201. ,
  32202. a.prototype.writeUInt8 = function(e, t, i) {
  32203. return e = +e,
  32204. t |= 0,
  32205. i || B(this, e, t, 1, 255, 0),
  32206. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32207. this[t] = 255 & e,
  32208. t + 1
  32209. }
  32210. ,
  32211. a.prototype.writeUInt16LE = function(e, t, i) {
  32212. return e = +e,
  32213. t |= 0,
  32214. i || B(this, e, t, 2, 65535, 0),
  32215. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32216. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32217. t + 2
  32218. }
  32219. ,
  32220. a.prototype.writeUInt16BE = function(e, t, i) {
  32221. return e = +e,
  32222. t |= 0,
  32223. i || B(this, e, t, 2, 65535, 0),
  32224. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32225. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32226. t + 2
  32227. }
  32228. ,
  32229. a.prototype.writeUInt32LE = function(e, t, i) {
  32230. return e = +e,
  32231. t |= 0,
  32232. i || B(this, e, t, 4, 4294967295, 0),
  32233. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32234. this[t + 2] = e >>> 16,
  32235. this[t + 1] = e >>> 8,
  32236. this[t] = 255 & e) : V(this, e, t, !0),
  32237. t + 4
  32238. }
  32239. ,
  32240. a.prototype.writeUInt32BE = function(e, t, i) {
  32241. return e = +e,
  32242. t |= 0,
  32243. i || B(this, e, t, 4, 4294967295, 0),
  32244. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32245. this[t + 1] = e >>> 16,
  32246. this[t + 2] = e >>> 8,
  32247. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32248. t + 4
  32249. }
  32250. ,
  32251. a.prototype.writeIntLE = function(e, t, i, n) {
  32252. if (e = +e,
  32253. t |= 0,
  32254. !n) {
  32255. var r = Math.pow(2, 8 * i - 1);
  32256. B(this, e, t, i, r - 1, -r)
  32257. }
  32258. var o = 0
  32259. , a = 1
  32260. , s = 0;
  32261. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32262. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32263. this[t + o] = (e / a >> 0) - s & 255;
  32264. return t + i
  32265. }
  32266. ,
  32267. a.prototype.writeIntBE = function(e, t, i, n) {
  32268. if (e = +e,
  32269. t |= 0,
  32270. !n) {
  32271. var r = Math.pow(2, 8 * i - 1);
  32272. B(this, e, t, i, r - 1, -r)
  32273. }
  32274. var o = i - 1
  32275. , a = 1
  32276. , s = 0;
  32277. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32278. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32279. this[t + o] = (e / a >> 0) - s & 255;
  32280. return t + i
  32281. }
  32282. ,
  32283. a.prototype.writeInt8 = function(e, t, i) {
  32284. return e = +e,
  32285. t |= 0,
  32286. i || B(this, e, t, 1, 127, -128),
  32287. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32288. e < 0 && (e = 255 + e + 1),
  32289. this[t] = 255 & e,
  32290. t + 1
  32291. }
  32292. ,
  32293. a.prototype.writeInt16LE = function(e, t, i) {
  32294. return e = +e,
  32295. t |= 0,
  32296. i || B(this, e, t, 2, 32767, -32768),
  32297. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32298. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32299. t + 2
  32300. }
  32301. ,
  32302. a.prototype.writeInt16BE = function(e, t, i) {
  32303. return e = +e,
  32304. t |= 0,
  32305. i || B(this, e, t, 2, 32767, -32768),
  32306. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32307. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32308. t + 2
  32309. }
  32310. ,
  32311. a.prototype.writeInt32LE = function(e, t, i) {
  32312. return e = +e,
  32313. t |= 0,
  32314. i || B(this, e, t, 4, 2147483647, -2147483648),
  32315. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32316. this[t + 1] = e >>> 8,
  32317. this[t + 2] = e >>> 16,
  32318. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32319. t + 4
  32320. }
  32321. ,
  32322. a.prototype.writeInt32BE = function(e, t, i) {
  32323. return e = +e,
  32324. t |= 0,
  32325. i || B(this, e, t, 4, 2147483647, -2147483648),
  32326. e < 0 && (e = 4294967295 + e + 1),
  32327. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32328. this[t + 1] = e >>> 16,
  32329. this[t + 2] = e >>> 8,
  32330. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32331. t + 4
  32332. }
  32333. ,
  32334. a.prototype.writeFloatLE = function(e, t, i) {
  32335. return k(this, e, t, !0, i)
  32336. }
  32337. ,
  32338. a.prototype.writeFloatBE = function(e, t, i) {
  32339. return k(this, e, t, !1, i)
  32340. }
  32341. ,
  32342. a.prototype.writeDoubleLE = function(e, t, i) {
  32343. return H(this, e, t, !0, i)
  32344. }
  32345. ,
  32346. a.prototype.writeDoubleBE = function(e, t, i) {
  32347. return H(this, e, t, !1, i)
  32348. }
  32349. ,
  32350. a.prototype.copy = function(e, t, i, n) {
  32351. if (i || (i = 0),
  32352. n || 0 === n || (n = this.length),
  32353. t >= e.length && (t = e.length),
  32354. t || (t = 0),
  32355. n > 0 && n < i && (n = i),
  32356. n === i)
  32357. return 0;
  32358. if (0 === e.length || 0 === this.length)
  32359. return 0;
  32360. if (t < 0)
  32361. throw new RangeError("targetStart out of bounds");
  32362. if (i < 0 || i >= this.length)
  32363. throw new RangeError("sourceStart out of bounds");
  32364. if (n < 0)
  32365. throw new RangeError("sourceEnd out of bounds");
  32366. n > this.length && (n = this.length),
  32367. e.length - t < n - i && (n = e.length - t + i);
  32368. var r, o = n - i;
  32369. if (this === e && i < t && t < n)
  32370. for (r = o - 1; r >= 0; --r)
  32371. e[r + t] = this[r + i];
  32372. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32373. for (r = 0; r < o; ++r)
  32374. e[r + t] = this[r + i];
  32375. else
  32376. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32377. return o
  32378. }
  32379. ,
  32380. a.prototype.fill = function(e, t, i, n) {
  32381. if ("string" == typeof e) {
  32382. if ("string" == typeof t ? (n = t,
  32383. t = 0,
  32384. i = this.length) : "string" == typeof i && (n = i,
  32385. i = this.length),
  32386. 1 === e.length) {
  32387. var r = e.charCodeAt(0);
  32388. r < 256 && (e = r)
  32389. }
  32390. if (void 0 !== n && "string" != typeof n)
  32391. throw new TypeError("encoding must be a string");
  32392. if ("string" == typeof n && !a.isEncoding(n))
  32393. throw new TypeError("Unknown encoding: " + n)
  32394. } else
  32395. "number" == typeof e && (e &= 255);
  32396. if (t < 0 || this.length < t || this.length < i)
  32397. throw new RangeError("Out of range index");
  32398. if (i <= t)
  32399. return this;
  32400. t >>>= 0,
  32401. i = void 0 === i ? this.length : i >>> 0,
  32402. e || (e = 0);
  32403. var o;
  32404. if ("number" == typeof e)
  32405. for (o = t; o < i; ++o)
  32406. this[o] = e;
  32407. else {
  32408. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32409. , l = s.length;
  32410. for (o = 0; o < i - t; ++o)
  32411. this[o + t] = s[o % l]
  32412. }
  32413. return this
  32414. }
  32415. ;
  32416. var te = /[^+\/0-9A-Za-z-_]/g
  32417. }
  32418. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32419. }
  32420. , {
  32421. "base64-js": 199,
  32422. ieee754: 200,
  32423. isarray: 201
  32424. }],
  32425. 199: [function(e, t, i) {
  32426. "use strict";
  32427. function n(e) {
  32428. var t = e.length;
  32429. if (t % 4 > 0)
  32430. throw new Error("Invalid string. Length must be a multiple of 4");
  32431. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32432. }
  32433. function r(e) {
  32434. return 3 * e.length / 4 - n(e)
  32435. }
  32436. function o(e) {
  32437. var t, i, r, o, a, s, l = e.length;
  32438. a = n(e),
  32439. s = new u(3 * l / 4 - a),
  32440. r = a > 0 ? l - 4 : l;
  32441. var c = 0;
  32442. for (t = 0,
  32443. i = 0; t < r; t += 4,
  32444. i += 3)
  32445. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32446. s[c++] = o >> 16 & 255,
  32447. s[c++] = o >> 8 & 255,
  32448. s[c++] = 255 & o;
  32449. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32450. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32451. s[c++] = o >> 8 & 255,
  32452. s[c++] = 255 & o),
  32453. s
  32454. }
  32455. function a(e) {
  32456. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32457. }
  32458. function s(e, t, i) {
  32459. for (var n, r = [], o = t; o < i; o += 3)
  32460. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32461. r.push(a(n));
  32462. return r.join("")
  32463. }
  32464. function l(e) {
  32465. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32466. o.push(s(e, l, l + a > h ? h : l + a));
  32467. return 1 === n ? (t = e[i - 1],
  32468. r += c[t >> 2],
  32469. r += c[t << 4 & 63],
  32470. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32471. r += c[t >> 10],
  32472. r += c[t >> 4 & 63],
  32473. r += c[t << 2 & 63],
  32474. r += "="),
  32475. o.push(r),
  32476. o.join("")
  32477. }
  32478. i.byteLength = r,
  32479. i.toByteArray = o,
  32480. i.fromByteArray = l;
  32481. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32482. c[p] = d[p],
  32483. h[d.charCodeAt(p)] = p;
  32484. h["-".charCodeAt(0)] = 62,
  32485. h["_".charCodeAt(0)] = 63
  32486. }
  32487. , {}],
  32488. 200: [function(e, t, i) {
  32489. i.read = function(e, t, i, n, r) {
  32490. 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];
  32491. for (u += d,
  32492. o = p & (1 << -h) - 1,
  32493. p >>= -h,
  32494. h += s; h > 0; o = 256 * o + e[t + u],
  32495. u += d,
  32496. h -= 8)
  32497. ;
  32498. for (a = o & (1 << -h) - 1,
  32499. o >>= -h,
  32500. h += n; h > 0; a = 256 * a + e[t + u],
  32501. u += d,
  32502. h -= 8)
  32503. ;
  32504. if (0 === o)
  32505. o = 1 - c;
  32506. else {
  32507. if (o === l)
  32508. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32509. a += Math.pow(2, n),
  32510. o -= c
  32511. }
  32512. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32513. }
  32514. ,
  32515. i.write = function(e, t, i, n, r, o) {
  32516. 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;
  32517. for (t = Math.abs(t),
  32518. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32519. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32520. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32521. l *= 2),
  32522. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32523. t * l >= 2 && (a++,
  32524. l /= 2),
  32525. a + u >= h ? (s = 0,
  32526. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32527. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32528. a = 0)); r >= 8; e[i + p] = 255 & s,
  32529. p += f,
  32530. s /= 256,
  32531. r -= 8)
  32532. ;
  32533. for (a = a << r | s,
  32534. c += r; c > 0; e[i + p] = 255 & a,
  32535. p += f,
  32536. a /= 256,
  32537. c -= 8)
  32538. ;
  32539. e[i + p - f] |= 128 * g
  32540. }
  32541. }
  32542. , {}],
  32543. 201: [function(e, t, i) {
  32544. var n = {}.toString;
  32545. t.exports = Array.isArray || function(e) {
  32546. return "[object Array]" == n.call(e)
  32547. }
  32548. }
  32549. , {}],
  32550. 202: [function(e, t, i) {
  32551. function n() {
  32552. this._events = this._events || {},
  32553. this._maxListeners = this._maxListeners || void 0
  32554. }
  32555. function r(e) {
  32556. return "function" == typeof e
  32557. }
  32558. function o(e) {
  32559. return "number" == typeof e
  32560. }
  32561. function a(e) {
  32562. return "object" == typeof e && null !== e
  32563. }
  32564. function s(e) {
  32565. return void 0 === e
  32566. }
  32567. t.exports = n,
  32568. n.EventEmitter = n,
  32569. n.prototype._events = void 0,
  32570. n.prototype._maxListeners = void 0,
  32571. n.defaultMaxListeners = 10,
  32572. n.prototype.setMaxListeners = function(e) {
  32573. if (!o(e) || e < 0 || isNaN(e))
  32574. throw TypeError("n must be a positive number");
  32575. return this._maxListeners = e,
  32576. this
  32577. }
  32578. ,
  32579. n.prototype.emit = function(e) {
  32580. var t, i, n, o, l, c;
  32581. if (this._events || (this._events = {}),
  32582. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32583. if (t = arguments[1],
  32584. t instanceof Error)
  32585. throw t;
  32586. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32587. throw h.context = t,
  32588. h
  32589. }
  32590. if (i = this._events[e],
  32591. s(i))
  32592. return !1;
  32593. if (r(i))
  32594. switch (arguments.length) {
  32595. case 1:
  32596. i.call(this);
  32597. break;
  32598. case 2:
  32599. i.call(this, arguments[1]);
  32600. break;
  32601. case 3:
  32602. i.call(this, arguments[1], arguments[2]);
  32603. break;
  32604. default:
  32605. o = Array.prototype.slice.call(arguments, 1),
  32606. i.apply(this, o)
  32607. }
  32608. else if (a(i))
  32609. for (o = Array.prototype.slice.call(arguments, 1),
  32610. c = i.slice(),
  32611. n = c.length,
  32612. l = 0; l < n; l++)
  32613. c[l].apply(this, o);
  32614. return !0
  32615. }
  32616. ,
  32617. n.prototype.addListener = function(e, t) {
  32618. var i;
  32619. if (!r(t))
  32620. throw TypeError("listener must be a function");
  32621. return this._events || (this._events = {}),
  32622. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32623. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32624. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32625. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32626. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32627. "function" == typeof console.trace && console.trace())),
  32628. this
  32629. }
  32630. ,
  32631. n.prototype.on = n.prototype.addListener,
  32632. n.prototype.once = function(e, t) {
  32633. function i() {
  32634. this.removeListener(e, i),
  32635. n || (n = !0,
  32636. t.apply(this, arguments))
  32637. }
  32638. if (!r(t))
  32639. throw TypeError("listener must be a function");
  32640. var n = !1;
  32641. return i.listener = t,
  32642. this.on(e, i),
  32643. this
  32644. }
  32645. ,
  32646. n.prototype.removeListener = function(e, t) {
  32647. var i, n, o, s;
  32648. if (!r(t))
  32649. throw TypeError("listener must be a function");
  32650. if (!this._events || !this._events[e])
  32651. return this;
  32652. if (i = this._events[e],
  32653. o = i.length,
  32654. n = -1,
  32655. i === t || r(i.listener) && i.listener === t)
  32656. delete this._events[e],
  32657. this._events.removeListener && this.emit("removeListener", e, t);
  32658. else if (a(i)) {
  32659. for (s = o; s-- > 0; )
  32660. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32661. n = s;
  32662. break
  32663. }
  32664. if (n < 0)
  32665. return this;
  32666. 1 === i.length ? (i.length = 0,
  32667. delete this._events[e]) : i.splice(n, 1),
  32668. this._events.removeListener && this.emit("removeListener", e, t)
  32669. }
  32670. return this
  32671. }
  32672. ,
  32673. n.prototype.removeAllListeners = function(e) {
  32674. var t, i;
  32675. if (!this._events)
  32676. return this;
  32677. if (!this._events.removeListener)
  32678. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32679. this;
  32680. if (0 === arguments.length) {
  32681. for (t in this._events)
  32682. "removeListener" !== t && this.removeAllListeners(t);
  32683. return this.removeAllListeners("removeListener"),
  32684. this._events = {},
  32685. this
  32686. }
  32687. if (i = this._events[e],
  32688. r(i))
  32689. this.removeListener(e, i);
  32690. else if (i)
  32691. for (; i.length; )
  32692. this.removeListener(e, i[i.length - 1]);
  32693. return delete this._events[e],
  32694. this
  32695. }
  32696. ,
  32697. n.prototype.listeners = function(e) {
  32698. var t;
  32699. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32700. }
  32701. ,
  32702. n.prototype.listenerCount = function(e) {
  32703. if (this._events) {
  32704. var t = this._events[e];
  32705. if (r(t))
  32706. return 1;
  32707. if (t)
  32708. return t.length
  32709. }
  32710. return 0
  32711. }
  32712. ,
  32713. n.listenerCount = function(e, t) {
  32714. return e.listenerCount(t)
  32715. }
  32716. }
  32717. , {}],
  32718. 203: [function(e, t, i) {
  32719. function n() {
  32720. throw new Error("setTimeout has not been defined")
  32721. }
  32722. function r() {
  32723. throw new Error("clearTimeout has not been defined")
  32724. }
  32725. function o(e) {
  32726. if (u === setTimeout)
  32727. return setTimeout(e, 0);
  32728. if ((u === n || !u) && setTimeout)
  32729. return u = setTimeout,
  32730. setTimeout(e, 0);
  32731. try {
  32732. return u(e, 0)
  32733. } catch (t) {
  32734. try {
  32735. return u.call(null, e, 0)
  32736. } catch (t) {
  32737. return u.call(this, e, 0)
  32738. }
  32739. }
  32740. }
  32741. function a(e) {
  32742. if (d === clearTimeout)
  32743. return clearTimeout(e);
  32744. if ((d === r || !d) && clearTimeout)
  32745. return d = clearTimeout,
  32746. clearTimeout(e);
  32747. try {
  32748. return d(e)
  32749. } catch (t) {
  32750. try {
  32751. return d.call(null, e)
  32752. } catch (t) {
  32753. return d.call(this, e)
  32754. }
  32755. }
  32756. }
  32757. function s() {
  32758. m && f && (m = !1,
  32759. f.length ? g = f.concat(g) : v = -1,
  32760. g.length && l())
  32761. }
  32762. function l() {
  32763. if (!m) {
  32764. var e = o(s);
  32765. m = !0;
  32766. for (var t = g.length; t; ) {
  32767. for (f = g,
  32768. g = []; ++v < t; )
  32769. f && f[v].run();
  32770. v = -1,
  32771. t = g.length
  32772. }
  32773. f = null,
  32774. m = !1,
  32775. a(e)
  32776. }
  32777. }
  32778. function c(e, t) {
  32779. this.fun = e,
  32780. this.array = t
  32781. }
  32782. function h() {}
  32783. var u, d, p = t.exports = {};
  32784. !function() {
  32785. try {
  32786. u = "function" == typeof setTimeout ? setTimeout : n
  32787. } catch (e) {
  32788. u = n
  32789. }
  32790. try {
  32791. d = "function" == typeof clearTimeout ? clearTimeout : r
  32792. } catch (e) {
  32793. d = r
  32794. }
  32795. }();
  32796. var f, g = [], m = !1, v = -1;
  32797. p.nextTick = function(e) {
  32798. var t = new Array(arguments.length - 1);
  32799. if (arguments.length > 1)
  32800. for (var i = 1; i < arguments.length; i++)
  32801. t[i - 1] = arguments[i];
  32802. g.push(new c(e,t)),
  32803. 1 !== g.length || m || o(l)
  32804. }
  32805. ,
  32806. c.prototype.run = function() {
  32807. this.fun.apply(null, this.array)
  32808. }
  32809. ,
  32810. p.title = "browser",
  32811. p.browser = !0,
  32812. p.env = {},
  32813. p.argv = [],
  32814. p.version = "",
  32815. p.versions = {},
  32816. p.on = h,
  32817. p.addListener = h,
  32818. p.once = h,
  32819. p.off = h,
  32820. p.removeListener = h,
  32821. p.removeAllListeners = h,
  32822. p.emit = h,
  32823. p.binding = function(e) {
  32824. throw new Error("process.binding is not supported")
  32825. }
  32826. ,
  32827. p.cwd = function() {
  32828. return "/"
  32829. }
  32830. ,
  32831. p.chdir = function(e) {
  32832. throw new Error("process.chdir is not supported")
  32833. }
  32834. ,
  32835. p.umask = function() {
  32836. return 0
  32837. }
  32838. }
  32839. , {}],
  32840. 204: [function(e, t, i) {
  32841. (function(e) {
  32842. !function(n) {
  32843. function r(e) {
  32844. throw new RangeError(L[e])
  32845. }
  32846. function o(e, t) {
  32847. for (var i = e.length, n = []; i--; )
  32848. n[i] = t(e[i]);
  32849. return n
  32850. }
  32851. function a(e, t) {
  32852. var i = e.split("@")
  32853. , n = "";
  32854. i.length > 1 && (n = i[0] + "@",
  32855. e = i[1]),
  32856. e = e.replace(O, ".");
  32857. var r = e.split(".")
  32858. , a = o(r, t).join(".");
  32859. return n + a
  32860. }
  32861. function s(e) {
  32862. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32863. t = e.charCodeAt(r++),
  32864. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  32865. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  32866. r--)) : n.push(t);
  32867. return n
  32868. }
  32869. function l(e) {
  32870. return o(e, function(e) {
  32871. var t = "";
  32872. return e > 65535 && (e -= 65536,
  32873. t += B(e >>> 10 & 1023 | 55296),
  32874. e = 56320 | 1023 & e),
  32875. t += B(e)
  32876. }).join("")
  32877. }
  32878. function c(e) {
  32879. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32880. }
  32881. function h(e, t) {
  32882. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32883. }
  32884. function u(e, t, i) {
  32885. var n = 0;
  32886. for (e = i ? N(e / T) : e >> 1,
  32887. e += N(e / t); e > D * w >> 1; n += E)
  32888. e = N(e / D);
  32889. return N(n + (D + 1) * e / (e + _))
  32890. }
  32891. function d(e) {
  32892. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  32893. for (i = e.lastIndexOf(M),
  32894. i < 0 && (i = 0),
  32895. n = 0; n < i; ++n)
  32896. e.charCodeAt(n) >= 128 && r("not-basic"),
  32897. g.push(e.charCodeAt(n));
  32898. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32899. for (a = v,
  32900. s = 1,
  32901. h = E; o >= m && r("invalid-input"),
  32902. d = c(e.charCodeAt(o++)),
  32903. (d >= E || d > N((I - v) / s)) && r("overflow"),
  32904. v += d * s,
  32905. p = h <= y ? b : h >= y + w ? w : h - y,
  32906. !(d < p); h += E)
  32907. f = E - p,
  32908. s > N(I / f) && r("overflow"),
  32909. s *= f;
  32910. t = g.length + 1,
  32911. y = u(v - a, t, 0 == a),
  32912. N(v / t) > I - A && r("overflow"),
  32913. A += N(v / t),
  32914. v %= t,
  32915. g.splice(v++, 0, A)
  32916. }
  32917. return l(g)
  32918. }
  32919. function p(e) {
  32920. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  32921. for (e = s(e),
  32922. m = e.length,
  32923. t = S,
  32924. i = 0,
  32925. a = x,
  32926. l = 0; l < m; ++l)
  32927. g = e[l],
  32928. g < 128 && C.push(B(g));
  32929. for (n = o = C.length,
  32930. o && C.push(M); n < m; ) {
  32931. for (c = I,
  32932. l = 0; l < m; ++l)
  32933. g = e[l],
  32934. g >= t && g < c && (c = g);
  32935. for (v = n + 1,
  32936. c - t > N((I - i) / v) && r("overflow"),
  32937. i += (c - t) * v,
  32938. t = c,
  32939. l = 0; l < m; ++l)
  32940. if (g = e[l],
  32941. g < t && ++i > I && r("overflow"),
  32942. g == t) {
  32943. for (d = i,
  32944. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  32945. !(d < f); p += E)
  32946. y = d - f,
  32947. A = E - f,
  32948. C.push(B(h(f + y % A, 0))),
  32949. d = N(y / A);
  32950. C.push(B(h(d, 0))),
  32951. a = u(i, v, n == o),
  32952. i = 0,
  32953. ++n
  32954. }
  32955. ++i,
  32956. ++t
  32957. }
  32958. return C.join("")
  32959. }
  32960. function f(e) {
  32961. return a(e, function(e) {
  32962. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32963. })
  32964. }
  32965. function g(e) {
  32966. return a(e, function(e) {
  32967. return P.test(e) ? "xn--" + p(e) : e
  32968. })
  32969. }
  32970. var m = "object" == typeof i && i && !i.nodeType && i
  32971. , v = "object" == typeof t && t && !t.nodeType && t
  32972. , A = "object" == typeof e && e;
  32973. A.global !== A && A.window !== A && A.self !== A || (n = A);
  32974. 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 = {
  32975. overflow: "Overflow: input needs wider integers to process",
  32976. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  32977. "invalid-input": "Invalid input"
  32978. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  32979. if (y = {
  32980. version: "1.4.1",
  32981. ucs2: {
  32982. decode: s,
  32983. encode: l
  32984. },
  32985. decode: d,
  32986. encode: p,
  32987. toASCII: g,
  32988. toUnicode: f
  32989. },
  32990. "function" == typeof define && "object" == typeof define.amd && define.amd)
  32991. define("punycode", function() {
  32992. return y
  32993. });
  32994. else if (m && v)
  32995. if (t.exports == m)
  32996. v.exports = y;
  32997. else
  32998. for (C in y)
  32999. y.hasOwnProperty(C) && (m[C] = y[C]);
  33000. else
  33001. n.punycode = y
  33002. }(this)
  33003. }
  33004. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33005. }
  33006. , {}],
  33007. 205: [function(e, t, i) {
  33008. "use strict";
  33009. function n(e, t) {
  33010. return Object.prototype.hasOwnProperty.call(e, t)
  33011. }
  33012. t.exports = function(e, t, i, o) {
  33013. t = t || "&",
  33014. i = i || "=";
  33015. var a = {};
  33016. if ("string" != typeof e || 0 === e.length)
  33017. return a;
  33018. var s = /\+/g;
  33019. e = e.split(t);
  33020. var l = 1e3;
  33021. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33022. var c = e.length;
  33023. l > 0 && c > l && (c = l);
  33024. for (var h = 0; h < c; ++h) {
  33025. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33026. m >= 0 ? (u = g.substr(0, m),
  33027. d = g.substr(m + 1)) : (u = g,
  33028. d = ""),
  33029. p = decodeURIComponent(u),
  33030. f = decodeURIComponent(d),
  33031. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33032. }
  33033. return a
  33034. }
  33035. ;
  33036. var r = Array.isArray || function(e) {
  33037. return "[object Array]" === Object.prototype.toString.call(e)
  33038. }
  33039. }
  33040. , {}],
  33041. 206: [function(e, t, i) {
  33042. "use strict";
  33043. function n(e, t) {
  33044. if (e.map)
  33045. return e.map(t);
  33046. for (var i = [], n = 0; n < e.length; n++)
  33047. i.push(t(e[n], n));
  33048. return i
  33049. }
  33050. var r = function(e) {
  33051. switch (typeof e) {
  33052. case "string":
  33053. return e;
  33054. case "boolean":
  33055. return e ? "true" : "false";
  33056. case "number":
  33057. return isFinite(e) ? e : "";
  33058. default:
  33059. return ""
  33060. }
  33061. };
  33062. t.exports = function(e, t, i, s) {
  33063. return t = t || "&",
  33064. i = i || "=",
  33065. null === e && (e = void 0),
  33066. "object" == typeof e ? n(a(e), function(a) {
  33067. var s = encodeURIComponent(r(a)) + i;
  33068. return o(e[a]) ? n(e[a], function(e) {
  33069. return s + encodeURIComponent(r(e))
  33070. }).join(t) : s + encodeURIComponent(r(e[a]))
  33071. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33072. }
  33073. ;
  33074. var o = Array.isArray || function(e) {
  33075. return "[object Array]" === Object.prototype.toString.call(e)
  33076. }
  33077. , a = Object.keys || function(e) {
  33078. var t = [];
  33079. for (var i in e)
  33080. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33081. return t
  33082. }
  33083. }
  33084. , {}],
  33085. 207: [function(e, t, i) {
  33086. "use strict";
  33087. i.decode = i.parse = e("./decode"),
  33088. i.encode = i.stringify = e("./encode")
  33089. }
  33090. , {
  33091. "./decode": 205,
  33092. "./encode": 206
  33093. }],
  33094. 208: [function(e, t, i) {
  33095. "use strict";
  33096. function n() {
  33097. this.protocol = null,
  33098. this.slashes = null,
  33099. this.auth = null,
  33100. this.host = null,
  33101. this.port = null,
  33102. this.hostname = null,
  33103. this.hash = null,
  33104. this.search = null,
  33105. this.query = null,
  33106. this.pathname = null,
  33107. this.path = null,
  33108. this.href = null
  33109. }
  33110. function r(e, t, i) {
  33111. if (e && c.isObject(e) && e instanceof n)
  33112. return e;
  33113. var r = new n;
  33114. return r.parse(e, t, i),
  33115. r
  33116. }
  33117. function o(e) {
  33118. return c.isString(e) && (e = r(e)),
  33119. e instanceof n ? e.format() : n.prototype.format.call(e)
  33120. }
  33121. function a(e, t) {
  33122. return r(e, !1, !0).resolve(t)
  33123. }
  33124. function s(e, t) {
  33125. return e ? r(e, !1, !0).resolveObject(t) : t
  33126. }
  33127. var l = e("punycode")
  33128. , c = e("./util");
  33129. i.parse = r,
  33130. i.resolve = a,
  33131. i.resolveObject = s,
  33132. i.format = o,
  33133. i.Url = n;
  33134. var h = /^([a-z0-9.+-]+:)/i
  33135. , u = /:[0-9]*$/
  33136. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33137. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33138. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33139. , g = ["'"].concat(f)
  33140. , m = ["%", "/", "?", ";", "#"].concat(g)
  33141. , v = ["/", "?", "#"]
  33142. , A = 255
  33143. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33144. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33145. , I = {
  33146. javascript: !0,
  33147. "javascript:": !0
  33148. }
  33149. , E = {
  33150. javascript: !0,
  33151. "javascript:": !0
  33152. }
  33153. , b = {
  33154. http: !0,
  33155. https: !0,
  33156. ftp: !0,
  33157. gopher: !0,
  33158. file: !0,
  33159. "http:": !0,
  33160. "https:": !0,
  33161. "ftp:": !0,
  33162. "gopher:": !0,
  33163. "file:": !0
  33164. }
  33165. , w = e("querystring");
  33166. n.prototype.parse = function(e, t, i) {
  33167. if (!c.isString(e))
  33168. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33169. var n = e.indexOf("?")
  33170. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33171. , o = e.split(r)
  33172. , a = /\\/g;
  33173. o[0] = o[0].replace(a, "/"),
  33174. e = o.join(r);
  33175. var s = e;
  33176. if (s = s.trim(),
  33177. !i && 1 === e.split("#").length) {
  33178. var u = d.exec(s);
  33179. if (u)
  33180. return this.path = s,
  33181. this.href = s,
  33182. this.pathname = u[1],
  33183. u[2] ? (this.search = u[2],
  33184. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33185. this.query = {}),
  33186. this
  33187. }
  33188. var p = h.exec(s);
  33189. if (p) {
  33190. p = p[0];
  33191. var f = p.toLowerCase();
  33192. this.protocol = f,
  33193. s = s.substr(p.length)
  33194. }
  33195. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33196. var _ = "//" === s.substr(0, 2);
  33197. !_ || p && E[p] || (s = s.substr(2),
  33198. this.slashes = !0)
  33199. }
  33200. if (!E[p] && (_ || p && !b[p])) {
  33201. for (var T = -1, x = 0; x < v.length; x++) {
  33202. var S = s.indexOf(v[x]);
  33203. S !== -1 && (T === -1 || S < T) && (T = S)
  33204. }
  33205. var M, R;
  33206. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33207. R !== -1 && (M = s.slice(0, R),
  33208. s = s.slice(R + 1),
  33209. this.auth = decodeURIComponent(M)),
  33210. T = -1;
  33211. for (var x = 0; x < m.length; x++) {
  33212. var S = s.indexOf(m[x]);
  33213. S !== -1 && (T === -1 || S < T) && (T = S)
  33214. }
  33215. T === -1 && (T = s.length),
  33216. this.host = s.slice(0, T),
  33217. s = s.slice(T),
  33218. this.parseHost(),
  33219. this.hostname = this.hostname || "";
  33220. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33221. if (!P)
  33222. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33223. var D = O[x];
  33224. if (D && !D.match(y)) {
  33225. for (var N = "", B = 0, F = D.length; B < F; B++)
  33226. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33227. if (!N.match(y)) {
  33228. var V = O.slice(0, x)
  33229. , U = O.slice(x + 1)
  33230. , k = D.match(C);
  33231. k && (V.push(k[1]),
  33232. U.unshift(k[2])),
  33233. U.length && (s = "/" + U.join(".") + s),
  33234. this.hostname = V.join(".");
  33235. break
  33236. }
  33237. }
  33238. }
  33239. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33240. P || (this.hostname = l.toASCII(this.hostname));
  33241. var H = this.port ? ":" + this.port : ""
  33242. , G = this.hostname || "";
  33243. this.host = G + H,
  33244. this.href += this.host,
  33245. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33246. "/" !== s[0] && (s = "/" + s))
  33247. }
  33248. if (!I[f])
  33249. for (var x = 0, L = g.length; x < L; x++) {
  33250. var z = g[x];
  33251. if (s.indexOf(z) !== -1) {
  33252. var W = encodeURIComponent(z);
  33253. W === z && (W = escape(z)),
  33254. s = s.split(z).join(W)
  33255. }
  33256. }
  33257. var j = s.indexOf("#");
  33258. j !== -1 && (this.hash = s.substr(j),
  33259. s = s.slice(0, j));
  33260. var Y = s.indexOf("?");
  33261. if (Y !== -1 ? (this.search = s.substr(Y),
  33262. this.query = s.substr(Y + 1),
  33263. t && (this.query = w.parse(this.query)),
  33264. s = s.slice(0, Y)) : t && (this.search = "",
  33265. this.query = {}),
  33266. s && (this.pathname = s),
  33267. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33268. this.pathname || this.search) {
  33269. var H = this.pathname || ""
  33270. , X = this.search || "";
  33271. this.path = H + X
  33272. }
  33273. return this.href = this.format(),
  33274. this
  33275. }
  33276. ,
  33277. n.prototype.format = function() {
  33278. var e = this.auth || "";
  33279. e && (e = encodeURIComponent(e),
  33280. e = e.replace(/%3A/i, ":"),
  33281. e += "@");
  33282. var t = this.protocol || ""
  33283. , i = this.pathname || ""
  33284. , n = this.hash || ""
  33285. , r = !1
  33286. , o = "";
  33287. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33288. this.port && (r += ":" + this.port)),
  33289. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33290. var a = this.search || o && "?" + o || "";
  33291. return t && ":" !== t.substr(-1) && (t += ":"),
  33292. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33293. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33294. n && "#" !== n.charAt(0) && (n = "#" + n),
  33295. a && "?" !== a.charAt(0) && (a = "?" + a),
  33296. i = i.replace(/[?#]/g, function(e) {
  33297. return encodeURIComponent(e)
  33298. }),
  33299. a = a.replace("#", "%23"),
  33300. t + r + i + a + n
  33301. }
  33302. ,
  33303. n.prototype.resolve = function(e) {
  33304. return this.resolveObject(r(e, !1, !0)).format()
  33305. }
  33306. ,
  33307. n.prototype.resolveObject = function(e) {
  33308. if (c.isString(e)) {
  33309. var t = new n;
  33310. t.parse(e, !1, !0),
  33311. e = t
  33312. }
  33313. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33314. var a = r[o];
  33315. i[a] = this[a]
  33316. }
  33317. if (i.hash = e.hash,
  33318. "" === e.href)
  33319. return i.href = i.format(),
  33320. i;
  33321. if (e.slashes && !e.protocol) {
  33322. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33323. var h = s[l];
  33324. "protocol" !== h && (i[h] = e[h])
  33325. }
  33326. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33327. i.href = i.format(),
  33328. i
  33329. }
  33330. if (e.protocol && e.protocol !== i.protocol) {
  33331. if (!b[e.protocol]) {
  33332. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33333. var p = u[d];
  33334. i[p] = e[p]
  33335. }
  33336. return i.href = i.format(),
  33337. i
  33338. }
  33339. if (i.protocol = e.protocol,
  33340. e.host || E[e.protocol])
  33341. i.pathname = e.pathname;
  33342. else {
  33343. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33344. ;
  33345. e.host || (e.host = ""),
  33346. e.hostname || (e.hostname = ""),
  33347. "" !== f[0] && f.unshift(""),
  33348. f.length < 2 && f.unshift(""),
  33349. i.pathname = f.join("/")
  33350. }
  33351. if (i.search = e.search,
  33352. i.query = e.query,
  33353. i.host = e.host || "",
  33354. i.auth = e.auth,
  33355. i.hostname = e.hostname || e.host,
  33356. i.port = e.port,
  33357. i.pathname || i.search) {
  33358. var g = i.pathname || ""
  33359. , m = i.search || "";
  33360. i.path = g + m
  33361. }
  33362. return i.slashes = i.slashes || e.slashes,
  33363. i.href = i.format(),
  33364. i
  33365. }
  33366. var v = i.pathname && "/" === i.pathname.charAt(0)
  33367. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33368. , y = A || v || i.host && e.pathname
  33369. , C = y
  33370. , I = i.pathname && i.pathname.split("/") || []
  33371. , f = e.pathname && e.pathname.split("/") || []
  33372. , w = i.protocol && !b[i.protocol];
  33373. if (w && (i.hostname = "",
  33374. i.port = null,
  33375. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33376. i.host = "",
  33377. e.protocol && (e.hostname = null,
  33378. e.port = null,
  33379. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33380. e.host = null),
  33381. y = y && ("" === f[0] || "" === I[0])),
  33382. A)
  33383. i.host = e.host || "" === e.host ? e.host : i.host,
  33384. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33385. i.search = e.search,
  33386. i.query = e.query,
  33387. I = f;
  33388. else if (f.length)
  33389. I || (I = []),
  33390. I.pop(),
  33391. I = I.concat(f),
  33392. i.search = e.search,
  33393. i.query = e.query;
  33394. else if (!c.isNullOrUndefined(e.search)) {
  33395. if (w) {
  33396. i.hostname = i.host = I.shift();
  33397. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33398. _ && (i.auth = _.shift(),
  33399. i.host = i.hostname = _.shift())
  33400. }
  33401. return i.search = e.search,
  33402. i.query = e.query,
  33403. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33404. i.href = i.format(),
  33405. i
  33406. }
  33407. if (!I.length)
  33408. return i.pathname = null,
  33409. i.search ? i.path = "/" + i.search : i.path = null,
  33410. i.href = i.format(),
  33411. i;
  33412. 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--)
  33413. T = I[M],
  33414. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33415. S++) : S && (I.splice(M, 1),
  33416. S--);
  33417. if (!y && !C)
  33418. for (; S--; S)
  33419. I.unshift("..");
  33420. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33421. x && "/" !== I.join("/").substr(-1) && I.push("");
  33422. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33423. if (w) {
  33424. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33425. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33426. _ && (i.auth = _.shift(),
  33427. i.host = i.hostname = _.shift())
  33428. }
  33429. return y = y || i.host && I.length,
  33430. y && !R && I.unshift(""),
  33431. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33432. i.path = null),
  33433. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33434. i.auth = e.auth || i.auth,
  33435. i.slashes = i.slashes || e.slashes,
  33436. i.href = i.format(),
  33437. i
  33438. }
  33439. ,
  33440. n.prototype.parseHost = function() {
  33441. var e = this.host
  33442. , t = u.exec(e);
  33443. t && (t = t[0],
  33444. ":" !== t && (this.port = t.substr(1)),
  33445. e = e.substr(0, e.length - t.length)),
  33446. e && (this.hostname = e)
  33447. }
  33448. }
  33449. , {
  33450. "./util": 209,
  33451. punycode: 204,
  33452. querystring: 207
  33453. }],
  33454. 209: [function(e, t, i) {
  33455. "use strict";
  33456. t.exports = {
  33457. isString: function(e) {
  33458. return "string" == typeof e
  33459. },
  33460. isObject: function(e) {
  33461. return "object" == typeof e && null !== e
  33462. },
  33463. isNull: function(e) {
  33464. return null === e
  33465. },
  33466. isNullOrUndefined: function(e) {
  33467. return null == e
  33468. }
  33469. }
  33470. }
  33471. , {}],
  33472. 210: [function(e, t, i) {
  33473. "use strict";
  33474. function n(e) {
  33475. return l + e
  33476. }
  33477. function r(e) {
  33478. return e.substring(l.length)
  33479. }
  33480. function o(e, t) {
  33481. for (var i in t)
  33482. Object.defineProperty(e, i, {
  33483. value: t[i],
  33484. configurable: !0,
  33485. writable: !0
  33486. })
  33487. }
  33488. function a(e) {
  33489. if ("string" != typeof e)
  33490. throw new TypeError("key must be a string.")
  33491. }
  33492. var s = Object.prototype.hasOwnProperty
  33493. , l = "~";
  33494. t.exports = function(e) {
  33495. var t = Object.create(null)
  33496. , i = 0
  33497. , l = {};
  33498. return o(l, {
  33499. get: function(e, i) {
  33500. a(e);
  33501. var r = n(e);
  33502. return r in t ? t[r] : i
  33503. },
  33504. set: function(e, r) {
  33505. a(e);
  33506. var o = n(e);
  33507. return o in t || ++i,
  33508. t[o] = r
  33509. },
  33510. has: function(e) {
  33511. return a(e),
  33512. n(e)in t
  33513. },
  33514. delete: function(e) {
  33515. a(e);
  33516. var r = n(e);
  33517. return r in t && (--i,
  33518. delete t[r],
  33519. !0)
  33520. },
  33521. clear: function() {
  33522. t = Object.create(null),
  33523. i = 0
  33524. },
  33525. forEach: function(e, i) {
  33526. if ("function" != typeof e)
  33527. throw new TypeError("`callback` must be a function");
  33528. for (var n in t)
  33529. if (s.call(t, n)) {
  33530. var o = r(n)
  33531. , a = t[n];
  33532. e.call(i, a, o, l)
  33533. }
  33534. }
  33535. }),
  33536. Object.defineProperty(l, "size", {
  33537. get: function() {
  33538. return i
  33539. },
  33540. configurable: !0
  33541. }),
  33542. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33543. l.set(t, e[t])
  33544. }),
  33545. l
  33546. }
  33547. }
  33548. , {}],
  33549. 211: [function(e, t, i) {
  33550. t.exports = e("./lib/heap")
  33551. }
  33552. , {
  33553. "./lib/heap": 212
  33554. }],
  33555. 212: [function(e, t, i) {
  33556. (function() {
  33557. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33558. r = Math.floor,
  33559. u = Math.min,
  33560. n = function(e, t) {
  33561. return e < t ? -1 : e > t ? 1 : 0
  33562. }
  33563. ,
  33564. h = function(e, t, i, o, a) {
  33565. var s;
  33566. if (null == i && (i = 0),
  33567. null == a && (a = n),
  33568. i < 0)
  33569. throw new Error("lo must be non-negative");
  33570. for (null == o && (o = e.length); i < o; )
  33571. s = r((i + o) / 2),
  33572. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33573. return [].splice.apply(e, [i, i - i].concat(t)),
  33574. t
  33575. }
  33576. ,
  33577. s = function(e, t, i) {
  33578. return null == i && (i = n),
  33579. e.push(t),
  33580. g(e, 0, e.length - 1, i)
  33581. }
  33582. ,
  33583. a = function(e, t) {
  33584. var i, r;
  33585. return null == t && (t = n),
  33586. i = e.pop(),
  33587. e.length ? (r = e[0],
  33588. e[0] = i,
  33589. m(e, 0, t)) : r = i,
  33590. r
  33591. }
  33592. ,
  33593. c = function(e, t, i) {
  33594. var r;
  33595. return null == i && (i = n),
  33596. r = e[0],
  33597. e[0] = t,
  33598. m(e, 0, i),
  33599. r
  33600. }
  33601. ,
  33602. l = function(e, t, i) {
  33603. var r;
  33604. return null == i && (i = n),
  33605. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33606. t = r[0],
  33607. e[0] = r[1],
  33608. m(e, 0, i)),
  33609. t
  33610. }
  33611. ,
  33612. o = function(e, t) {
  33613. var i, o, a, s, l, c;
  33614. for (null == t && (t = n),
  33615. s = function() {
  33616. c = [];
  33617. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33618. c.push(t);
  33619. return c
  33620. }
  33621. .apply(this).reverse(),
  33622. l = [],
  33623. o = 0,
  33624. a = s.length; o < a; o++)
  33625. i = s[o],
  33626. l.push(m(e, i, t));
  33627. return l
  33628. }
  33629. ,
  33630. f = function(e, t, i) {
  33631. var r;
  33632. if (null == i && (i = n),
  33633. r = e.indexOf(t),
  33634. r !== -1)
  33635. return g(e, 0, r, i),
  33636. m(e, r, i)
  33637. }
  33638. ,
  33639. d = function(e, t, i) {
  33640. var r, a, s, c, h;
  33641. if (null == i && (i = n),
  33642. a = e.slice(0, t),
  33643. !a.length)
  33644. return a;
  33645. for (o(a, i),
  33646. h = e.slice(t),
  33647. s = 0,
  33648. c = h.length; s < c; s++)
  33649. r = h[s],
  33650. l(a, r, i);
  33651. return a.sort(i).reverse()
  33652. }
  33653. ,
  33654. p = function(e, t, i) {
  33655. var r, s, l, c, d, p, f, g, m, v;
  33656. if (null == i && (i = n),
  33657. 10 * t <= e.length) {
  33658. if (c = e.slice(0, t).sort(i),
  33659. !c.length)
  33660. return c;
  33661. for (l = c[c.length - 1],
  33662. g = e.slice(t),
  33663. d = 0,
  33664. f = g.length; d < f; d++)
  33665. r = g[d],
  33666. i(r, l) < 0 && (h(c, r, 0, null, i),
  33667. c.pop(),
  33668. l = c[c.length - 1]);
  33669. return c
  33670. }
  33671. for (o(e, i),
  33672. v = [],
  33673. s = p = 0,
  33674. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33675. v.push(a(e, i));
  33676. return v
  33677. }
  33678. ,
  33679. g = function(e, t, i, r) {
  33680. var o, a, s;
  33681. for (null == r && (r = n),
  33682. o = e[i]; i > t && (s = i - 1 >> 1,
  33683. a = e[s],
  33684. r(o, a) < 0); )
  33685. e[i] = a,
  33686. i = s;
  33687. return e[i] = o
  33688. }
  33689. ,
  33690. m = function(e, t, i) {
  33691. var r, o, a, s, l;
  33692. for (null == i && (i = n),
  33693. o = e.length,
  33694. l = t,
  33695. a = e[t],
  33696. r = 2 * t + 1; r < o; )
  33697. s = r + 1,
  33698. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33699. e[t] = e[r],
  33700. t = r,
  33701. r = 2 * t + 1;
  33702. return e[t] = a,
  33703. g(e, l, t, i)
  33704. }
  33705. ,
  33706. e = function() {
  33707. function e(e) {
  33708. this.cmp = null != e ? e : n,
  33709. this.nodes = []
  33710. }
  33711. return e.push = s,
  33712. e.pop = a,
  33713. e.replace = c,
  33714. e.pushpop = l,
  33715. e.heapify = o,
  33716. e.updateItem = f,
  33717. e.nlargest = d,
  33718. e.nsmallest = p,
  33719. e.prototype.push = function(e) {
  33720. return s(this.nodes, e, this.cmp)
  33721. }
  33722. ,
  33723. e.prototype.pop = function() {
  33724. return a(this.nodes, this.cmp)
  33725. }
  33726. ,
  33727. e.prototype.peek = function() {
  33728. return this.nodes[0]
  33729. }
  33730. ,
  33731. e.prototype.contains = function(e) {
  33732. return this.nodes.indexOf(e) !== -1
  33733. }
  33734. ,
  33735. e.prototype.replace = function(e) {
  33736. return c(this.nodes, e, this.cmp)
  33737. }
  33738. ,
  33739. e.prototype.pushpop = function(e) {
  33740. return l(this.nodes, e, this.cmp)
  33741. }
  33742. ,
  33743. e.prototype.heapify = function() {
  33744. return o(this.nodes, this.cmp)
  33745. }
  33746. ,
  33747. e.prototype.updateItem = function(e) {
  33748. return f(this.nodes, e, this.cmp)
  33749. }
  33750. ,
  33751. e.prototype.clear = function() {
  33752. return this.nodes = []
  33753. }
  33754. ,
  33755. e.prototype.empty = function() {
  33756. return 0 === this.nodes.length
  33757. }
  33758. ,
  33759. e.prototype.size = function() {
  33760. return this.nodes.length
  33761. }
  33762. ,
  33763. e.prototype.clone = function() {
  33764. var t;
  33765. return t = new e,
  33766. t.nodes = this.nodes.slice(0),
  33767. t
  33768. }
  33769. ,
  33770. e.prototype.toArray = function() {
  33771. return this.nodes.slice(0)
  33772. }
  33773. ,
  33774. e.prototype.insert = e.prototype.push,
  33775. e.prototype.top = e.prototype.peek,
  33776. e.prototype.front = e.prototype.peek,
  33777. e.prototype.has = e.prototype.contains,
  33778. e.prototype.copy = e.prototype.clone,
  33779. e
  33780. }(),
  33781. function(e, n) {
  33782. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  33783. }(this, function() {
  33784. return e
  33785. })
  33786. }
  33787. ).call(this)
  33788. }
  33789. , {}],
  33790. 213: [function(e, t, i) {
  33791. !function(e) {
  33792. function i() {}
  33793. function n(e, t) {
  33794. return function() {
  33795. e.apply(t, arguments)
  33796. }
  33797. }
  33798. function r(e) {
  33799. if ("object" != typeof this)
  33800. throw new TypeError("Promises must be constructed via new");
  33801. if ("function" != typeof e)
  33802. throw new TypeError("not a function");
  33803. this._state = 0,
  33804. this._handled = !1,
  33805. this._value = void 0,
  33806. this._deferreds = [],
  33807. h(e, this)
  33808. }
  33809. function o(e, t) {
  33810. for (; 3 === e._state; )
  33811. e = e._value;
  33812. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  33813. void r._immediateFn(function() {
  33814. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  33815. if (null === i)
  33816. return void (1 === e._state ? a : s)(t.promise, e._value);
  33817. var n;
  33818. try {
  33819. n = i(e._value)
  33820. } catch (e) {
  33821. return void s(t.promise, e)
  33822. }
  33823. a(t.promise, n)
  33824. }))
  33825. }
  33826. function a(e, t) {
  33827. try {
  33828. if (t === e)
  33829. throw new TypeError("A promise cannot be resolved with itself.");
  33830. if (t && ("object" == typeof t || "function" == typeof t)) {
  33831. var i = t.then;
  33832. if (t instanceof r)
  33833. return e._state = 3,
  33834. e._value = t,
  33835. void l(e);
  33836. if ("function" == typeof i)
  33837. return void h(n(i, t), e)
  33838. }
  33839. e._state = 1,
  33840. e._value = t,
  33841. l(e)
  33842. } catch (t) {
  33843. s(e, t)
  33844. }
  33845. }
  33846. function s(e, t) {
  33847. e._state = 2,
  33848. e._value = t,
  33849. l(e)
  33850. }
  33851. function l(e) {
  33852. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  33853. e._handled || r._unhandledRejectionFn(e._value)
  33854. });
  33855. for (var t = 0, i = e._deferreds.length; t < i; t++)
  33856. o(e, e._deferreds[t]);
  33857. e._deferreds = null
  33858. }
  33859. function c(e, t, i) {
  33860. this.onFulfilled = "function" == typeof e ? e : null,
  33861. this.onRejected = "function" == typeof t ? t : null,
  33862. this.promise = i
  33863. }
  33864. function h(e, t) {
  33865. var i = !1;
  33866. try {
  33867. e(function(e) {
  33868. i || (i = !0,
  33869. a(t, e))
  33870. }, function(e) {
  33871. i || (i = !0,
  33872. s(t, e))
  33873. })
  33874. } catch (e) {
  33875. if (i)
  33876. return;
  33877. i = !0,
  33878. s(t, e)
  33879. }
  33880. }
  33881. var u = setTimeout;
  33882. r.prototype.catch = function(e) {
  33883. return this.then(null, e)
  33884. }
  33885. ,
  33886. r.prototype.then = function(e, t) {
  33887. var n = new this.constructor(i);
  33888. return o(this, new c(e,t,n)),
  33889. n
  33890. }
  33891. ,
  33892. r.all = function(e) {
  33893. var t = Array.prototype.slice.call(e);
  33894. return new r(function(e, i) {
  33895. function n(o, a) {
  33896. try {
  33897. if (a && ("object" == typeof a || "function" == typeof a)) {
  33898. var s = a.then;
  33899. if ("function" == typeof s)
  33900. return void s.call(a, function(e) {
  33901. n(o, e)
  33902. }, i)
  33903. }
  33904. t[o] = a,
  33905. 0 === --r && e(t)
  33906. } catch (e) {
  33907. i(e)
  33908. }
  33909. }
  33910. if (0 === t.length)
  33911. return e([]);
  33912. for (var r = t.length, o = 0; o < t.length; o++)
  33913. n(o, t[o])
  33914. }
  33915. )
  33916. }
  33917. ,
  33918. r.resolve = function(e) {
  33919. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  33920. t(e)
  33921. }
  33922. )
  33923. }
  33924. ,
  33925. r.reject = function(e) {
  33926. return new r(function(t, i) {
  33927. i(e)
  33928. }
  33929. )
  33930. }
  33931. ,
  33932. r.race = function(e) {
  33933. return new r(function(t, i) {
  33934. for (var n = 0, r = e.length; n < r; n++)
  33935. e[n].then(t, i)
  33936. }
  33937. )
  33938. }
  33939. ,
  33940. r._immediateFn = "function" == typeof setImmediate && function(e) {
  33941. setImmediate(e)
  33942. }
  33943. || function(e) {
  33944. u(e, 0)
  33945. }
  33946. ,
  33947. r._unhandledRejectionFn = function(e) {
  33948. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  33949. }
  33950. ,
  33951. r._setImmediateFn = function(e) {
  33952. r._immediateFn = e
  33953. }
  33954. ,
  33955. r._setUnhandledRejectionFn = function(e) {
  33956. r._unhandledRejectionFn = e
  33957. }
  33958. ,
  33959. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  33960. }(this)
  33961. }
  33962. , {}],
  33963. 214: [function(e, t, i) {
  33964. (function(i) {
  33965. !function(i, n) {
  33966. "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)
  33967. }(this, function(t, n) {
  33968. "use strict";
  33969. var r = {};
  33970. return r.ByteBuffer = t,
  33971. r.Long = t.Long || null,
  33972. r.VERSION = "5.0.1",
  33973. r.WIRE_TYPES = {},
  33974. r.WIRE_TYPES.VARINT = 0,
  33975. r.WIRE_TYPES.BITS64 = 1,
  33976. r.WIRE_TYPES.LDELIM = 2,
  33977. r.WIRE_TYPES.STARTGROUP = 3,
  33978. r.WIRE_TYPES.ENDGROUP = 4,
  33979. r.WIRE_TYPES.BITS32 = 5,
  33980. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  33981. r.TYPES = {
  33982. int32: {
  33983. name: "int32",
  33984. wireType: r.WIRE_TYPES.VARINT,
  33985. defaultValue: 0
  33986. },
  33987. uint32: {
  33988. name: "uint32",
  33989. wireType: r.WIRE_TYPES.VARINT,
  33990. defaultValue: 0
  33991. },
  33992. sint32: {
  33993. name: "sint32",
  33994. wireType: r.WIRE_TYPES.VARINT,
  33995. defaultValue: 0
  33996. },
  33997. int64: {
  33998. name: "int64",
  33999. wireType: r.WIRE_TYPES.VARINT,
  34000. defaultValue: r.Long ? r.Long.ZERO : void 0
  34001. },
  34002. uint64: {
  34003. name: "uint64",
  34004. wireType: r.WIRE_TYPES.VARINT,
  34005. defaultValue: r.Long ? r.Long.UZERO : void 0
  34006. },
  34007. sint64: {
  34008. name: "sint64",
  34009. wireType: r.WIRE_TYPES.VARINT,
  34010. defaultValue: r.Long ? r.Long.ZERO : void 0
  34011. },
  34012. bool: {
  34013. name: "bool",
  34014. wireType: r.WIRE_TYPES.VARINT,
  34015. defaultValue: !1
  34016. },
  34017. double: {
  34018. name: "double",
  34019. wireType: r.WIRE_TYPES.BITS64,
  34020. defaultValue: 0
  34021. },
  34022. string: {
  34023. name: "string",
  34024. wireType: r.WIRE_TYPES.LDELIM,
  34025. defaultValue: ""
  34026. },
  34027. bytes: {
  34028. name: "bytes",
  34029. wireType: r.WIRE_TYPES.LDELIM,
  34030. defaultValue: null
  34031. },
  34032. fixed32: {
  34033. name: "fixed32",
  34034. wireType: r.WIRE_TYPES.BITS32,
  34035. defaultValue: 0
  34036. },
  34037. sfixed32: {
  34038. name: "sfixed32",
  34039. wireType: r.WIRE_TYPES.BITS32,
  34040. defaultValue: 0
  34041. },
  34042. fixed64: {
  34043. name: "fixed64",
  34044. wireType: r.WIRE_TYPES.BITS64,
  34045. defaultValue: r.Long ? r.Long.UZERO : void 0
  34046. },
  34047. sfixed64: {
  34048. name: "sfixed64",
  34049. wireType: r.WIRE_TYPES.BITS64,
  34050. defaultValue: r.Long ? r.Long.ZERO : void 0
  34051. },
  34052. float: {
  34053. name: "float",
  34054. wireType: r.WIRE_TYPES.BITS32,
  34055. defaultValue: 0
  34056. },
  34057. enum: {
  34058. name: "enum",
  34059. wireType: r.WIRE_TYPES.VARINT,
  34060. defaultValue: 0
  34061. },
  34062. message: {
  34063. name: "message",
  34064. wireType: r.WIRE_TYPES.LDELIM,
  34065. defaultValue: null
  34066. },
  34067. group: {
  34068. name: "group",
  34069. wireType: r.WIRE_TYPES.STARTGROUP,
  34070. defaultValue: null
  34071. }
  34072. },
  34073. 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],
  34074. r.ID_MIN = 1,
  34075. r.ID_MAX = 536870911,
  34076. r.convertFieldsToCamelCase = !1,
  34077. r.populateAccessors = !0,
  34078. r.populateDefaults = !0,
  34079. r.Util = function() {
  34080. var t = {};
  34081. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34082. t.XHR = function() {
  34083. for (var e = [function() {
  34084. return new XMLHttpRequest
  34085. }
  34086. , function() {
  34087. return new ActiveXObject("Msxml2.XMLHTTP")
  34088. }
  34089. , function() {
  34090. return new ActiveXObject("Msxml3.XMLHTTP")
  34091. }
  34092. , function() {
  34093. return new ActiveXObject("Microsoft.XMLHTTP")
  34094. }
  34095. ], t = null, i = 0; i < e.length; i++) {
  34096. try {
  34097. t = e[i]()
  34098. } catch (e) {
  34099. continue
  34100. }
  34101. break
  34102. }
  34103. if (!t)
  34104. throw Error("XMLHttpRequest is not supported");
  34105. return t
  34106. }
  34107. ,
  34108. t.fetch = function(i, n) {
  34109. if (n && "function" != typeof n && (n = null),
  34110. t.IS_NODE) {
  34111. var r = e("fs");
  34112. if (n)
  34113. r.readFile(i, function(e, t) {
  34114. n(e ? null : "" + t)
  34115. });
  34116. else
  34117. try {
  34118. return r.readFileSync(i)
  34119. } catch (e) {
  34120. return null
  34121. }
  34122. } else {
  34123. var o = t.XHR();
  34124. if (o.open("GET", i, !!n),
  34125. o.setRequestHeader("Accept", "text/plain"),
  34126. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34127. !n)
  34128. return o.send(null),
  34129. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34130. if (o.onreadystatechange = function() {
  34131. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34132. }
  34133. ,
  34134. 4 == o.readyState)
  34135. return;
  34136. o.send(null)
  34137. }
  34138. }
  34139. ,
  34140. t.toCamelCase = function(e) {
  34141. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34142. return t.toUpperCase()
  34143. })
  34144. }
  34145. ,
  34146. t
  34147. }(),
  34148. r.Lang = {
  34149. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34150. RULE: /^(?:required|optional|repeated|map)$/,
  34151. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34152. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34153. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34154. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34155. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34156. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34157. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34158. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34159. NUMBER_OCT: /^0[0-7]+$/,
  34160. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34161. BOOL: /^(?:true|false)$/i,
  34162. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34163. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34164. WHITESPACE: /\s/,
  34165. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34166. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34167. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34168. },
  34169. r.DotProto = function(e, t) {
  34170. function i(e, i) {
  34171. var n = -1
  34172. , r = 1;
  34173. if ("-" == e.charAt(0) && (r = -1,
  34174. e = e.substring(1)),
  34175. t.NUMBER_DEC.test(e))
  34176. n = parseInt(e);
  34177. else if (t.NUMBER_HEX.test(e))
  34178. n = parseInt(e.substring(2), 16);
  34179. else {
  34180. if (!t.NUMBER_OCT.test(e))
  34181. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34182. n = parseInt(e.substring(1), 8)
  34183. }
  34184. if (n = r * n | 0,
  34185. !i && n < 0)
  34186. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34187. return n
  34188. }
  34189. function n(e) {
  34190. var i = 1;
  34191. if ("-" == e.charAt(0) && (i = -1,
  34192. e = e.substring(1)),
  34193. t.NUMBER_DEC.test(e))
  34194. return i * parseInt(e, 10);
  34195. if (t.NUMBER_HEX.test(e))
  34196. return i * parseInt(e.substring(2), 16);
  34197. if (t.NUMBER_OCT.test(e))
  34198. return i * parseInt(e.substring(1), 8);
  34199. if ("inf" === e)
  34200. return i * (1 / 0);
  34201. if ("nan" === e)
  34202. return NaN;
  34203. if (t.NUMBER_FLT.test(e))
  34204. return i * parseFloat(e);
  34205. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34206. }
  34207. function r(e, t, i) {
  34208. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34209. e[t].push(i))
  34210. }
  34211. var o = {}
  34212. , a = function(e) {
  34213. this.source = e + "",
  34214. this.index = 0,
  34215. this.line = 1,
  34216. this.stack = [],
  34217. this._stringOpen = null
  34218. }
  34219. , s = a.prototype;
  34220. s._readString = function() {
  34221. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34222. e.lastIndex = this.index - 1;
  34223. var i = e.exec(this.source);
  34224. if (!i)
  34225. throw Error("unterminated string");
  34226. return this.index = e.lastIndex,
  34227. this.stack.push(this._stringOpen),
  34228. this._stringOpen = null,
  34229. i[1]
  34230. }
  34231. ,
  34232. s.next = function() {
  34233. if (this.stack.length > 0)
  34234. return this.stack.shift();
  34235. if (this.index >= this.source.length)
  34236. return null;
  34237. if (null !== this._stringOpen)
  34238. return this._readString();
  34239. var e, i, n;
  34240. do {
  34241. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34242. if ("\n" === n && ++this.line,
  34243. ++this.index === this.source.length)
  34244. return null;
  34245. if ("/" === this.source.charAt(this.index))
  34246. if (++this.index,
  34247. "/" === this.source.charAt(this.index)) {
  34248. for (; "\n" !== this.source.charAt(++this.index); )
  34249. if (this.index == this.source.length)
  34250. return null;
  34251. ++this.index,
  34252. ++this.line,
  34253. e = !0
  34254. } else {
  34255. if ("*" !== (n = this.source.charAt(this.index)))
  34256. return "/";
  34257. do {
  34258. if ("\n" === n && ++this.line,
  34259. ++this.index === this.source.length)
  34260. return null;
  34261. i = n,
  34262. n = this.source.charAt(this.index)
  34263. } while ("*" !== i || "/" !== n);++this.index,
  34264. e = !0
  34265. }
  34266. } while (e);if (this.index === this.source.length)
  34267. return null;
  34268. var r = this.index;
  34269. t.DELIM.lastIndex = 0;
  34270. var o = t.DELIM.test(this.source.charAt(r++));
  34271. if (!o)
  34272. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34273. ++r;
  34274. var a = this.source.substring(this.index, this.index = r);
  34275. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34276. a
  34277. }
  34278. ,
  34279. s.peek = function() {
  34280. if (0 === this.stack.length) {
  34281. var e = this.next();
  34282. if (null === e)
  34283. return null;
  34284. this.stack.push(e)
  34285. }
  34286. return this.stack[0]
  34287. }
  34288. ,
  34289. s.skip = function(e) {
  34290. var t = this.next();
  34291. if (t !== e)
  34292. throw Error("illegal '" + t + "', '" + e + "' expected")
  34293. }
  34294. ,
  34295. s.omit = function(e) {
  34296. return this.peek() === e && (this.next(),
  34297. !0)
  34298. }
  34299. ,
  34300. s.toString = function() {
  34301. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34302. }
  34303. ,
  34304. o.Tokenizer = a;
  34305. var l = function(e) {
  34306. this.tn = new a(e),
  34307. this.proto3 = !1
  34308. }
  34309. , c = l.prototype;
  34310. return c.parse = function() {
  34311. var e, i, n = {
  34312. name: "[ROOT]",
  34313. package: null,
  34314. messages: [],
  34315. enums: [],
  34316. imports: [],
  34317. options: {},
  34318. services: []
  34319. }, r = !0;
  34320. try {
  34321. for (; e = this.tn.next(); )
  34322. switch (e) {
  34323. case "package":
  34324. if (!r || null !== n.package)
  34325. throw Error("unexpected 'package'");
  34326. if (e = this.tn.next(),
  34327. !t.TYPEREF.test(e))
  34328. throw Error("illegal package name: " + e);
  34329. this.tn.skip(";"),
  34330. n.package = e;
  34331. break;
  34332. case "import":
  34333. if (!r)
  34334. throw Error("unexpected 'import'");
  34335. e = this.tn.peek(),
  34336. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34337. e = this._readString(),
  34338. this.tn.skip(";"),
  34339. i || n.imports.push(e);
  34340. break;
  34341. case "syntax":
  34342. if (!r)
  34343. throw Error("unexpected 'syntax'");
  34344. this.tn.skip("="),
  34345. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34346. this.tn.skip(";");
  34347. break;
  34348. case "message":
  34349. this._parseMessage(n, null),
  34350. r = !1;
  34351. break;
  34352. case "enum":
  34353. this._parseEnum(n),
  34354. r = !1;
  34355. break;
  34356. case "option":
  34357. this._parseOption(n);
  34358. break;
  34359. case "service":
  34360. this._parseService(n);
  34361. break;
  34362. case "extend":
  34363. this._parseExtend(n);
  34364. break;
  34365. default:
  34366. throw Error("unexpected '" + e + "'")
  34367. }
  34368. } catch (e) {
  34369. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34370. e
  34371. }
  34372. return delete n.name,
  34373. n
  34374. }
  34375. ,
  34376. l.parse = function(e) {
  34377. return new l(e).parse()
  34378. }
  34379. ,
  34380. c._readString = function() {
  34381. var e, t, i = "";
  34382. do {
  34383. if (t = this.tn.next(),
  34384. "'" !== t && '"' !== t)
  34385. throw Error("illegal string delimiter: " + t);
  34386. i += this.tn.next(),
  34387. this.tn.skip(t),
  34388. e = this.tn.peek()
  34389. } while ('"' === e || '"' === e);return i
  34390. }
  34391. ,
  34392. c._readValue = function(e) {
  34393. var i = this.tn.peek();
  34394. if ('"' === i || "'" === i)
  34395. return this._readString();
  34396. if (this.tn.next(),
  34397. t.NUMBER.test(i))
  34398. return n(i);
  34399. if (t.BOOL.test(i))
  34400. return "true" === i.toLowerCase();
  34401. if (e && t.TYPEREF.test(i))
  34402. return i;
  34403. throw Error("illegal value: " + i)
  34404. }
  34405. ,
  34406. c._parseOption = function(e, i) {
  34407. var n = this.tn.next()
  34408. , r = !1;
  34409. if ("(" === n && (r = !0,
  34410. n = this.tn.next()),
  34411. !t.TYPEREF.test(n))
  34412. throw Error("illegal option name: " + n);
  34413. var o = n;
  34414. r && (this.tn.skip(")"),
  34415. o = "(" + o + ")",
  34416. n = this.tn.peek(),
  34417. t.FQTYPEREF.test(n) && (o += n,
  34418. this.tn.next())),
  34419. this.tn.skip("="),
  34420. this._parseOptionValue(e, o),
  34421. i || this.tn.skip(";")
  34422. }
  34423. ,
  34424. c._parseOptionValue = function(e, i) {
  34425. var n = this.tn.peek();
  34426. if ("{" !== n)
  34427. r(e.options, i, this._readValue(!0));
  34428. else
  34429. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34430. if (!t.NAME.test(n))
  34431. throw Error("illegal option name: " + i + "." + n);
  34432. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34433. }
  34434. }
  34435. ,
  34436. c._parseService = function(e) {
  34437. var i = this.tn.next();
  34438. if (!t.NAME.test(i))
  34439. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34440. var n = i
  34441. , r = {
  34442. name: n,
  34443. rpc: {},
  34444. options: {}
  34445. };
  34446. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34447. if ("option" === i)
  34448. this._parseOption(r);
  34449. else {
  34450. if ("rpc" !== i)
  34451. throw Error("illegal service token: " + i);
  34452. this._parseServiceRPC(r)
  34453. }
  34454. this.tn.omit(";"),
  34455. e.services.push(r)
  34456. }
  34457. ,
  34458. c._parseServiceRPC = function(e) {
  34459. var i = "rpc"
  34460. , n = this.tn.next();
  34461. if (!t.NAME.test(n))
  34462. throw Error("illegal rpc service method name: " + n);
  34463. var r = n
  34464. , o = {
  34465. request: null,
  34466. response: null,
  34467. request_stream: !1,
  34468. response_stream: !1,
  34469. options: {}
  34470. };
  34471. if (this.tn.skip("("),
  34472. n = this.tn.next(),
  34473. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34474. n = this.tn.next()),
  34475. !t.TYPEREF.test(n))
  34476. throw Error("illegal rpc service request type: " + n);
  34477. if (o.request = n,
  34478. this.tn.skip(")"),
  34479. n = this.tn.next(),
  34480. "returns" !== n.toLowerCase())
  34481. throw Error("illegal rpc service request type delimiter: " + n);
  34482. if (this.tn.skip("("),
  34483. n = this.tn.next(),
  34484. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34485. n = this.tn.next()),
  34486. o.response = n,
  34487. this.tn.skip(")"),
  34488. n = this.tn.peek(),
  34489. "{" === n) {
  34490. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34491. if ("option" !== n)
  34492. throw Error("illegal rpc service token: " + n);
  34493. this._parseOption(o)
  34494. }
  34495. this.tn.omit(";")
  34496. } else
  34497. this.tn.skip(";");
  34498. "undefined" == typeof e[i] && (e[i] = {}),
  34499. e[i][r] = o
  34500. }
  34501. ,
  34502. c._parseMessage = function(e, n) {
  34503. var r = !!n
  34504. , o = this.tn.next()
  34505. , a = {
  34506. name: "",
  34507. fields: [],
  34508. enums: [],
  34509. messages: [],
  34510. options: {},
  34511. services: [],
  34512. oneofs: {}
  34513. };
  34514. if (!t.NAME.test(o))
  34515. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34516. for (a.name = o,
  34517. r && (this.tn.skip("="),
  34518. n.id = i(this.tn.next()),
  34519. a.isGroup = !0),
  34520. o = this.tn.peek(),
  34521. "[" === o && n && this._parseFieldOptions(n),
  34522. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34523. if (t.RULE.test(o))
  34524. this._parseMessageField(a, o);
  34525. else if ("oneof" === o)
  34526. this._parseMessageOneOf(a);
  34527. else if ("enum" === o)
  34528. this._parseEnum(a);
  34529. else if ("message" === o)
  34530. this._parseMessage(a);
  34531. else if ("option" === o)
  34532. this._parseOption(a);
  34533. else if ("service" === o)
  34534. this._parseService(a);
  34535. else if ("extensions" === o)
  34536. a.extensions = this._parseExtensionRanges();
  34537. else if ("reserved" === o)
  34538. this._parseIgnored();
  34539. else if ("extend" === o)
  34540. this._parseExtend(a);
  34541. else {
  34542. if (!t.TYPEREF.test(o))
  34543. throw Error("illegal message token: " + o);
  34544. if (!this.proto3)
  34545. throw Error("illegal field rule: " + o);
  34546. this._parseMessageField(a, "optional", o)
  34547. }
  34548. return this.tn.omit(";"),
  34549. e.messages.push(a),
  34550. a
  34551. }
  34552. ,
  34553. c._parseIgnored = function() {
  34554. for (; ";" !== this.tn.peek(); )
  34555. this.tn.next();
  34556. this.tn.skip(";")
  34557. }
  34558. ,
  34559. c._parseMessageField = function(e, n, r) {
  34560. if (!t.RULE.test(n))
  34561. throw Error("illegal message field rule: " + n);
  34562. var o, a = {
  34563. rule: n,
  34564. type: "",
  34565. name: "",
  34566. options: {},
  34567. id: 0
  34568. };
  34569. if ("map" === n) {
  34570. if (r)
  34571. throw Error("illegal type: " + r);
  34572. if (this.tn.skip("<"),
  34573. o = this.tn.next(),
  34574. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34575. throw Error("illegal message field type: " + o);
  34576. if (a.keytype = o,
  34577. this.tn.skip(","),
  34578. o = this.tn.next(),
  34579. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34580. throw Error("illegal message field: " + o);
  34581. if (a.type = o,
  34582. this.tn.skip(">"),
  34583. o = this.tn.next(),
  34584. !t.NAME.test(o))
  34585. throw Error("illegal message field name: " + o);
  34586. a.name = o,
  34587. this.tn.skip("="),
  34588. a.id = i(this.tn.next()),
  34589. o = this.tn.peek(),
  34590. "[" === o && this._parseFieldOptions(a),
  34591. this.tn.skip(";")
  34592. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34593. "group" === r) {
  34594. var s = this._parseMessage(e, a);
  34595. if (!/^[A-Z]/.test(s.name))
  34596. throw Error("illegal group name: " + s.name);
  34597. a.type = s.name,
  34598. a.name = s.name.toLowerCase(),
  34599. this.tn.omit(";")
  34600. } else {
  34601. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34602. throw Error("illegal message field type: " + r);
  34603. if (a.type = r,
  34604. o = this.tn.next(),
  34605. !t.NAME.test(o))
  34606. throw Error("illegal message field name: " + o);
  34607. a.name = o,
  34608. this.tn.skip("="),
  34609. a.id = i(this.tn.next()),
  34610. o = this.tn.peek(),
  34611. "[" === o && this._parseFieldOptions(a),
  34612. this.tn.skip(";")
  34613. }
  34614. return e.fields.push(a),
  34615. a
  34616. }
  34617. ,
  34618. c._parseMessageOneOf = function(e) {
  34619. var i = this.tn.next();
  34620. if (!t.NAME.test(i))
  34621. throw Error("illegal oneof name: " + i);
  34622. var n, r = i, o = [];
  34623. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34624. n = this._parseMessageField(e, "optional", i),
  34625. n.oneof = r,
  34626. o.push(n.id);
  34627. this.tn.omit(";"),
  34628. e.oneofs[r] = o
  34629. }
  34630. ,
  34631. c._parseFieldOptions = function(e) {
  34632. this.tn.skip("[");
  34633. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34634. i || this.tn.skip(","),
  34635. this._parseOption(e, !0),
  34636. i = !1;
  34637. this.tn.next()
  34638. }
  34639. ,
  34640. c._parseEnum = function(e) {
  34641. var n = {
  34642. name: "",
  34643. values: [],
  34644. options: {}
  34645. }
  34646. , r = this.tn.next();
  34647. if (!t.NAME.test(r))
  34648. throw Error("illegal name: " + r);
  34649. for (n.name = r,
  34650. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34651. if ("option" === r)
  34652. this._parseOption(n);
  34653. else {
  34654. if (!t.NAME.test(r))
  34655. throw Error("illegal name: " + r);
  34656. this.tn.skip("=");
  34657. var o = {
  34658. name: r,
  34659. id: i(this.tn.next(), !0)
  34660. };
  34661. r = this.tn.peek(),
  34662. "[" === r && this._parseFieldOptions({
  34663. options: {}
  34664. }),
  34665. this.tn.skip(";"),
  34666. n.values.push(o)
  34667. }
  34668. this.tn.omit(";"),
  34669. e.enums.push(n)
  34670. }
  34671. ,
  34672. c._parseExtensionRanges = function() {
  34673. var t, i, r, o = [];
  34674. do {
  34675. for (i = []; ; ) {
  34676. switch (t = this.tn.next()) {
  34677. case "min":
  34678. r = e.ID_MIN;
  34679. break;
  34680. case "max":
  34681. r = e.ID_MAX;
  34682. break;
  34683. default:
  34684. r = n(t)
  34685. }
  34686. if (i.push(r),
  34687. 2 === i.length)
  34688. break;
  34689. if ("to" !== this.tn.peek()) {
  34690. i.push(r);
  34691. break
  34692. }
  34693. this.tn.next()
  34694. }
  34695. o.push(i)
  34696. } while (this.tn.omit(","));return this.tn.skip(";"),
  34697. o
  34698. }
  34699. ,
  34700. c._parseExtend = function(e) {
  34701. var i = this.tn.next();
  34702. if (!t.TYPEREF.test(i))
  34703. throw Error("illegal extend reference: " + i);
  34704. var n = {
  34705. ref: i,
  34706. fields: []
  34707. };
  34708. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34709. if (t.RULE.test(i))
  34710. this._parseMessageField(n, i);
  34711. else {
  34712. if (!t.TYPEREF.test(i))
  34713. throw Error("illegal extend token: " + i);
  34714. if (!this.proto3)
  34715. throw Error("illegal field rule: " + i);
  34716. this._parseMessageField(n, "optional", i)
  34717. }
  34718. return this.tn.omit(";"),
  34719. e.messages.push(n),
  34720. n
  34721. }
  34722. ,
  34723. c.toString = function() {
  34724. return "Parser at line " + this.tn.line
  34725. }
  34726. ,
  34727. o.Parser = l,
  34728. o
  34729. }(r, r.Lang),
  34730. r.Reflect = function(e) {
  34731. function i(i) {
  34732. if ("string" == typeof i && (i = e.TYPES[i]),
  34733. "undefined" == typeof i.defaultValue)
  34734. throw Error("default value for type " + i.name + " is not supported");
  34735. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34736. }
  34737. function n(t, i) {
  34738. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34739. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34740. if ("string" == typeof t)
  34741. return e.Long.fromString(t, i || !1, 10);
  34742. if ("number" == typeof t)
  34743. return e.Long.fromNumber(t, i || !1);
  34744. throw Error("not convertible to Long")
  34745. }
  34746. function r(t, i) {
  34747. var n = i.readVarint32()
  34748. , o = 7 & n
  34749. , a = n >>> 3;
  34750. switch (o) {
  34751. case e.WIRE_TYPES.VARINT:
  34752. do
  34753. n = i.readUint8();
  34754. while (128 === (128 & n));break;
  34755. case e.WIRE_TYPES.BITS64:
  34756. i.offset += 8;
  34757. break;
  34758. case e.WIRE_TYPES.LDELIM:
  34759. n = i.readVarint32(),
  34760. i.offset += n;
  34761. break;
  34762. case e.WIRE_TYPES.STARTGROUP:
  34763. r(a, i);
  34764. break;
  34765. case e.WIRE_TYPES.ENDGROUP:
  34766. if (a === t)
  34767. return !1;
  34768. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34769. case e.WIRE_TYPES.BITS32:
  34770. i.offset += 4;
  34771. break;
  34772. default:
  34773. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34774. }
  34775. return !0
  34776. }
  34777. var o = {}
  34778. , a = function(e, t, i) {
  34779. this.builder = e,
  34780. this.parent = t,
  34781. this.name = i,
  34782. this.className
  34783. }
  34784. , s = a.prototype;
  34785. s.fqn = function() {
  34786. for (var e = this.name, t = this; ; ) {
  34787. if (t = t.parent,
  34788. null == t)
  34789. break;
  34790. e = t.name + "." + e
  34791. }
  34792. return e
  34793. }
  34794. ,
  34795. s.toString = function(e) {
  34796. return (e ? this.className + " " : "") + this.fqn()
  34797. }
  34798. ,
  34799. s.build = function() {
  34800. throw Error(this.toString(!0) + " cannot be built directly")
  34801. }
  34802. ,
  34803. o.T = a;
  34804. var l = function(e, t, i, n, r) {
  34805. a.call(this, e, t, i),
  34806. this.className = "Namespace",
  34807. this.children = [],
  34808. this.options = n || {},
  34809. this.syntax = r || "proto2"
  34810. }
  34811. , c = l.prototype = Object.create(a.prototype);
  34812. c.getChildren = function(e) {
  34813. if (e = e || null,
  34814. null == e)
  34815. return this.children.slice();
  34816. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  34817. this.children[i]instanceof e && t.push(this.children[i]);
  34818. return t
  34819. }
  34820. ,
  34821. c.addChild = function(e) {
  34822. var t;
  34823. if (t = this.getChild(e.name))
  34824. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  34825. t.name = t.originalName;
  34826. else {
  34827. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34828. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  34829. e.name = e.originalName
  34830. }
  34831. this.children.push(e)
  34832. }
  34833. ,
  34834. c.getChild = function(e) {
  34835. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  34836. if (this.children[i][t] === e)
  34837. return this.children[i];
  34838. return null
  34839. }
  34840. ,
  34841. c.resolve = function(e, t) {
  34842. var i = "string" == typeof e ? e.split(".") : e
  34843. , n = this
  34844. , r = 0;
  34845. if ("" === i[r]) {
  34846. for (; null !== n.parent; )
  34847. n = n.parent;
  34848. r++
  34849. }
  34850. var a;
  34851. do {
  34852. do {
  34853. if (!(n instanceof o.Namespace)) {
  34854. n = null;
  34855. break
  34856. }
  34857. if (a = n.getChild(i[r]),
  34858. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  34859. n = null;
  34860. break
  34861. }
  34862. n = a,
  34863. r++
  34864. } while (r < i.length);if (null != n)
  34865. break;
  34866. if (null !== this.parent)
  34867. return this.parent.resolve(e, t)
  34868. } while (null != n);return n
  34869. }
  34870. ,
  34871. c.qn = function(e) {
  34872. var t = []
  34873. , i = e;
  34874. do
  34875. t.unshift(i.name),
  34876. i = i.parent;
  34877. while (null !== i);for (var n = 1; n <= t.length; n++) {
  34878. var r = t.slice(t.length - n);
  34879. if (e === this.resolve(r, e instanceof o.Namespace))
  34880. return r.join(".")
  34881. }
  34882. return e.fqn()
  34883. }
  34884. ,
  34885. c.build = function() {
  34886. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  34887. e = i[n],
  34888. e instanceof l && (t[e.name] = e.build());
  34889. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34890. value: this.buildOpt()
  34891. }),
  34892. t
  34893. }
  34894. ,
  34895. c.buildOpt = function() {
  34896. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34897. var r = t[i]
  34898. , o = this.options[t[i]];
  34899. e[r] = o
  34900. }
  34901. return e
  34902. }
  34903. ,
  34904. c.getOption = function(e) {
  34905. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  34906. }
  34907. ,
  34908. o.Namespace = l;
  34909. var h = function(t, i, n, r) {
  34910. if (this.type = t,
  34911. this.resolvedType = i,
  34912. this.isMapKey = n,
  34913. this.syntax = r,
  34914. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  34915. throw Error("Invalid map key type: " + t.name)
  34916. }
  34917. , u = h.prototype;
  34918. h.defaultFieldValue = i,
  34919. u.verifyValue = function(i) {
  34920. function r(e, t) {
  34921. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  34922. }
  34923. var o = this;
  34924. switch (this.type) {
  34925. case e.TYPES.int32:
  34926. case e.TYPES.sint32:
  34927. case e.TYPES.sfixed32:
  34928. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34929. i > 4294967295 ? 0 | i : i;
  34930. case e.TYPES.uint32:
  34931. case e.TYPES.fixed32:
  34932. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34933. i < 0 ? i >>> 0 : i;
  34934. case e.TYPES.int64:
  34935. case e.TYPES.sint64:
  34936. case e.TYPES.sfixed64:
  34937. if (e.Long)
  34938. try {
  34939. return n(i, !1)
  34940. } catch (e) {
  34941. r(typeof i, e.message)
  34942. }
  34943. else
  34944. r(typeof i, "requires Long.js");
  34945. case e.TYPES.uint64:
  34946. case e.TYPES.fixed64:
  34947. if (e.Long)
  34948. try {
  34949. return n(i, !0)
  34950. } catch (e) {
  34951. r(typeof i, e.message)
  34952. }
  34953. else
  34954. r(typeof i, "requires Long.js");
  34955. case e.TYPES.bool:
  34956. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  34957. i;
  34958. case e.TYPES.float:
  34959. case e.TYPES.double:
  34960. return "number" != typeof i && r(typeof i, "not a number"),
  34961. i;
  34962. case e.TYPES.string:
  34963. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  34964. "" + i;
  34965. case e.TYPES.bytes:
  34966. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  34967. case e.TYPES.enum:
  34968. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  34969. for (l = 0; l < a.length; l++) {
  34970. if (a[l].name == i)
  34971. return a[l].id;
  34972. if (a[l].id == i)
  34973. return a[l].id
  34974. }
  34975. if ("proto3" === this.syntax)
  34976. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34977. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  34978. i;
  34979. r(i, "not a valid enum value");
  34980. case e.TYPES.group:
  34981. case e.TYPES.message:
  34982. if (i && "object" == typeof i || r(typeof i, "object expected"),
  34983. i instanceof this.resolvedType.clazz)
  34984. return i;
  34985. if (i instanceof e.Builder.Message) {
  34986. var s = {};
  34987. for (var l in i)
  34988. i.hasOwnProperty(l) && (s[l] = i[l]);
  34989. i = s
  34990. }
  34991. return new this.resolvedType.clazz(i)
  34992. }
  34993. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  34994. }
  34995. ,
  34996. u.calculateLength = function(i, n) {
  34997. if (null === n)
  34998. return 0;
  34999. var r;
  35000. switch (this.type) {
  35001. case e.TYPES.int32:
  35002. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35003. case e.TYPES.uint32:
  35004. return t.calculateVarint32(n);
  35005. case e.TYPES.sint32:
  35006. return t.calculateVarint32(t.zigZagEncode32(n));
  35007. case e.TYPES.fixed32:
  35008. case e.TYPES.sfixed32:
  35009. case e.TYPES.float:
  35010. return 4;
  35011. case e.TYPES.int64:
  35012. case e.TYPES.uint64:
  35013. return t.calculateVarint64(n);
  35014. case e.TYPES.sint64:
  35015. return t.calculateVarint64(t.zigZagEncode64(n));
  35016. case e.TYPES.fixed64:
  35017. case e.TYPES.sfixed64:
  35018. return 8;
  35019. case e.TYPES.bool:
  35020. return 1;
  35021. case e.TYPES.enum:
  35022. return t.calculateVarint32(n);
  35023. case e.TYPES.double:
  35024. return 8;
  35025. case e.TYPES.string:
  35026. return r = t.calculateUTF8Bytes(n),
  35027. t.calculateVarint32(r) + r;
  35028. case e.TYPES.bytes:
  35029. if (n.remaining() < 0)
  35030. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35031. return t.calculateVarint32(n.remaining()) + n.remaining();
  35032. case e.TYPES.message:
  35033. return r = this.resolvedType.calculate(n),
  35034. t.calculateVarint32(r) + r;
  35035. case e.TYPES.group:
  35036. return r = this.resolvedType.calculate(n),
  35037. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35038. }
  35039. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35040. }
  35041. ,
  35042. u.encodeValue = function(i, n, r) {
  35043. if (null === n)
  35044. return r;
  35045. switch (this.type) {
  35046. case e.TYPES.int32:
  35047. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35048. break;
  35049. case e.TYPES.uint32:
  35050. r.writeVarint32(n);
  35051. break;
  35052. case e.TYPES.sint32:
  35053. r.writeVarint32ZigZag(n);
  35054. break;
  35055. case e.TYPES.fixed32:
  35056. r.writeUint32(n);
  35057. break;
  35058. case e.TYPES.sfixed32:
  35059. r.writeInt32(n);
  35060. break;
  35061. case e.TYPES.int64:
  35062. case e.TYPES.uint64:
  35063. r.writeVarint64(n);
  35064. break;
  35065. case e.TYPES.sint64:
  35066. r.writeVarint64ZigZag(n);
  35067. break;
  35068. case e.TYPES.fixed64:
  35069. r.writeUint64(n);
  35070. break;
  35071. case e.TYPES.sfixed64:
  35072. r.writeInt64(n);
  35073. break;
  35074. case e.TYPES.bool:
  35075. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35076. break;
  35077. case e.TYPES.enum:
  35078. r.writeVarint32(n);
  35079. break;
  35080. case e.TYPES.float:
  35081. r.writeFloat32(n);
  35082. break;
  35083. case e.TYPES.double:
  35084. r.writeFloat64(n);
  35085. break;
  35086. case e.TYPES.string:
  35087. r.writeVString(n);
  35088. break;
  35089. case e.TYPES.bytes:
  35090. if (n.remaining() < 0)
  35091. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35092. var o = n.offset;
  35093. r.writeVarint32(n.remaining()),
  35094. r.append(n),
  35095. n.offset = o;
  35096. break;
  35097. case e.TYPES.message:
  35098. var a = (new t).LE();
  35099. this.resolvedType.encode(n, a),
  35100. r.writeVarint32(a.offset),
  35101. r.append(a.flip());
  35102. break;
  35103. case e.TYPES.group:
  35104. this.resolvedType.encode(n, r),
  35105. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35106. break;
  35107. default:
  35108. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35109. }
  35110. return r
  35111. }
  35112. ,
  35113. u.decode = function(t, i, n) {
  35114. if (i != this.type.wireType)
  35115. throw Error("Unexpected wire type for element");
  35116. var r, o;
  35117. switch (this.type) {
  35118. case e.TYPES.int32:
  35119. return 0 | t.readVarint32();
  35120. case e.TYPES.uint32:
  35121. return t.readVarint32() >>> 0;
  35122. case e.TYPES.sint32:
  35123. return 0 | t.readVarint32ZigZag();
  35124. case e.TYPES.fixed32:
  35125. return t.readUint32() >>> 0;
  35126. case e.TYPES.sfixed32:
  35127. return 0 | t.readInt32();
  35128. case e.TYPES.int64:
  35129. return t.readVarint64();
  35130. case e.TYPES.uint64:
  35131. return t.readVarint64().toUnsigned();
  35132. case e.TYPES.sint64:
  35133. return t.readVarint64ZigZag();
  35134. case e.TYPES.fixed64:
  35135. return t.readUint64();
  35136. case e.TYPES.sfixed64:
  35137. return t.readInt64();
  35138. case e.TYPES.bool:
  35139. return !!t.readVarint32();
  35140. case e.TYPES.enum:
  35141. return t.readVarint32();
  35142. case e.TYPES.float:
  35143. return t.readFloat();
  35144. case e.TYPES.double:
  35145. return t.readDouble();
  35146. case e.TYPES.string:
  35147. return t.readVString();
  35148. case e.TYPES.bytes:
  35149. if (o = t.readVarint32(),
  35150. t.remaining() < o)
  35151. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35152. return r = t.clone(),
  35153. r.limit = r.offset + o,
  35154. t.offset += o,
  35155. r;
  35156. case e.TYPES.message:
  35157. return o = t.readVarint32(),
  35158. this.resolvedType.decode(t, o);
  35159. case e.TYPES.group:
  35160. return this.resolvedType.decode(t, -1, n)
  35161. }
  35162. throw Error("[INTERNAL] Illegal decode type")
  35163. }
  35164. ,
  35165. u.valueFromString = function(i) {
  35166. if (!this.isMapKey)
  35167. throw Error("valueFromString() called on non-map-key element");
  35168. switch (this.type) {
  35169. case e.TYPES.int32:
  35170. case e.TYPES.sint32:
  35171. case e.TYPES.sfixed32:
  35172. case e.TYPES.uint32:
  35173. case e.TYPES.fixed32:
  35174. return this.verifyValue(parseInt(i));
  35175. case e.TYPES.int64:
  35176. case e.TYPES.sint64:
  35177. case e.TYPES.sfixed64:
  35178. case e.TYPES.uint64:
  35179. case e.TYPES.fixed64:
  35180. return this.verifyValue(i);
  35181. case e.TYPES.bool:
  35182. return "true" === i;
  35183. case e.TYPES.string:
  35184. return this.verifyValue(i);
  35185. case e.TYPES.bytes:
  35186. return t.fromBinary(i)
  35187. }
  35188. }
  35189. ,
  35190. u.valueToString = function(t) {
  35191. if (!this.isMapKey)
  35192. throw Error("valueToString() called on non-map-key element");
  35193. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35194. }
  35195. ,
  35196. o.Element = h;
  35197. var d = function(e, t, i, n, r, o) {
  35198. l.call(this, e, t, i, n, o),
  35199. this.className = "Message",
  35200. this.extensions = void 0,
  35201. this.clazz = null,
  35202. this.isGroup = !!r,
  35203. this._fields = null,
  35204. this._fieldsById = null,
  35205. this._fieldsByName = null
  35206. }
  35207. , p = d.prototype = Object.create(l.prototype);
  35208. p.build = function(i) {
  35209. if (this.clazz && !i)
  35210. return this.clazz;
  35211. var n = function(e, i) {
  35212. function n(i, r, o, a) {
  35213. if (null === i || "object" != typeof i) {
  35214. if (a && a instanceof e.Reflect.Enum) {
  35215. var s = e.Reflect.Enum.getName(a.object, i);
  35216. if (null !== s)
  35217. return s
  35218. }
  35219. return i
  35220. }
  35221. if (t.isByteBuffer(i))
  35222. return r ? i.toBase64() : i.toBuffer();
  35223. if (e.Long.isLong(i))
  35224. return o ? i.toString() : e.Long.fromValue(i);
  35225. var l;
  35226. if (Array.isArray(i))
  35227. return l = [],
  35228. i.forEach(function(e, t) {
  35229. l[t] = n(e, r, o, a)
  35230. }),
  35231. l;
  35232. if (l = {},
  35233. i instanceof e.Map) {
  35234. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35235. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35236. return l
  35237. }
  35238. var u = i.$type
  35239. , d = void 0;
  35240. for (var p in i)
  35241. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35242. return l
  35243. }
  35244. var r = i.getChildren(e.Reflect.Message.Field)
  35245. , o = i.getChildren(e.Reflect.Message.OneOf)
  35246. , a = function(n, s) {
  35247. e.Builder.Message.call(this);
  35248. for (var l = 0, c = o.length; l < c; ++l)
  35249. this[o[l].name] = null;
  35250. for (l = 0,
  35251. c = r.length; l < c; ++l) {
  35252. var h = r[l];
  35253. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35254. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35255. }
  35256. if (arguments.length > 0) {
  35257. var u;
  35258. 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)
  35259. for (l = 0,
  35260. c = arguments.length; l < c; ++l)
  35261. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35262. else
  35263. this.$set(n)
  35264. }
  35265. }
  35266. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35267. s.add = function(t, n, r) {
  35268. var o = i._fieldsByName[t];
  35269. if (!r) {
  35270. if (!o)
  35271. throw Error(this + "#" + t + " is undefined");
  35272. if (!(o instanceof e.Reflect.Message.Field))
  35273. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35274. if (!o.repeated)
  35275. throw Error(this + "#" + t + " is not a repeated field");
  35276. n = o.verifyValue(n, !0)
  35277. }
  35278. return null === this[t] && (this[t] = []),
  35279. this[t].push(n),
  35280. this
  35281. }
  35282. ,
  35283. s.$add = s.add,
  35284. s.set = function(t, n, r) {
  35285. if (t && "object" == typeof t) {
  35286. r = n;
  35287. for (var o in t)
  35288. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35289. return this
  35290. }
  35291. var a = i._fieldsByName[t];
  35292. if (r)
  35293. this[t] = n;
  35294. else {
  35295. if (!a)
  35296. throw Error(this + "#" + t + " is not a field: undefined");
  35297. if (!(a instanceof e.Reflect.Message.Field))
  35298. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35299. this[a.name] = n = a.verifyValue(n)
  35300. }
  35301. if (a && a.oneof) {
  35302. var s = this[a.oneof.name];
  35303. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35304. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35305. }
  35306. return this
  35307. }
  35308. ,
  35309. s.$set = s.set,
  35310. s.get = function(t, n) {
  35311. if (n)
  35312. return this[t];
  35313. var r = i._fieldsByName[t];
  35314. if (!(r && r instanceof e.Reflect.Message.Field))
  35315. throw Error(this + "#" + t + " is not a field: undefined");
  35316. if (!(r instanceof e.Reflect.Message.Field))
  35317. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35318. return this[r.name]
  35319. }
  35320. ,
  35321. s.$get = s.get;
  35322. for (var l = 0; l < r.length; l++) {
  35323. var c = r[l];
  35324. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35325. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35326. return e.toUpperCase().replace("_", "")
  35327. });
  35328. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35329. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35330. return "_" + e
  35331. })
  35332. , r = function(t, i) {
  35333. return this[e.name] = i ? t : e.verifyValue(t),
  35334. this
  35335. }
  35336. , o = function() {
  35337. return this[e.name]
  35338. };
  35339. null === i.getChild("set" + t) && (s["set" + t] = r),
  35340. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35341. null === i.getChild("get" + t) && (s["get" + t] = o),
  35342. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35343. }(c)
  35344. }
  35345. s.encode = function(e, n) {
  35346. "boolean" == typeof e && (n = e,
  35347. e = void 0);
  35348. var r = !1;
  35349. e || (e = new t,
  35350. r = !0);
  35351. var o = e.littleEndian;
  35352. try {
  35353. return i.encode(this, e.LE(), n),
  35354. (r ? e.flip() : e).LE(o)
  35355. } catch (t) {
  35356. throw e.LE(o),
  35357. t
  35358. }
  35359. }
  35360. ,
  35361. a.encode = function(e, t, i) {
  35362. return new a(e).encode(t, i)
  35363. }
  35364. ,
  35365. s.calculate = function() {
  35366. return i.calculate(this)
  35367. }
  35368. ,
  35369. s.encodeDelimited = function(e, n) {
  35370. var r = !1;
  35371. e || (e = new t,
  35372. r = !0);
  35373. var o = (new t).LE();
  35374. return i.encode(this, o, n).flip(),
  35375. e.writeVarint32(o.remaining()),
  35376. e.append(o),
  35377. r ? e.flip() : e
  35378. }
  35379. ,
  35380. s.encodeAB = function() {
  35381. try {
  35382. return this.encode().toArrayBuffer()
  35383. } catch (e) {
  35384. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35385. e
  35386. }
  35387. }
  35388. ,
  35389. s.toArrayBuffer = s.encodeAB,
  35390. s.encodeNB = function() {
  35391. try {
  35392. return this.encode().toBuffer()
  35393. } catch (e) {
  35394. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35395. e
  35396. }
  35397. }
  35398. ,
  35399. s.toBuffer = s.encodeNB,
  35400. s.encode64 = function() {
  35401. try {
  35402. return this.encode().toBase64()
  35403. } catch (e) {
  35404. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35405. e
  35406. }
  35407. }
  35408. ,
  35409. s.toBase64 = s.encode64,
  35410. s.encodeHex = function() {
  35411. try {
  35412. return this.encode().toHex()
  35413. } catch (e) {
  35414. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35415. e
  35416. }
  35417. }
  35418. ,
  35419. s.toHex = s.encodeHex,
  35420. s.toRaw = function(e, t) {
  35421. return n(this, !!e, !!t, this.$type)
  35422. }
  35423. ,
  35424. s.encodeJSON = function() {
  35425. return JSON.stringify(n(this, !0, !0, this.$type))
  35426. }
  35427. ,
  35428. a.decode = function(e, n, r) {
  35429. "string" == typeof n && (r = n,
  35430. n = -1),
  35431. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35432. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35433. var o = e.littleEndian;
  35434. try {
  35435. var a = i.decode(e.LE());
  35436. return e.LE(o),
  35437. a
  35438. } catch (t) {
  35439. throw e.LE(o),
  35440. t
  35441. }
  35442. }
  35443. ,
  35444. a.decodeDelimited = function(e, n) {
  35445. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35446. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35447. e.remaining() < 1)
  35448. return null;
  35449. var r = e.offset
  35450. , o = e.readVarint32();
  35451. if (e.remaining() < o)
  35452. return e.offset = r,
  35453. null;
  35454. try {
  35455. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35456. return e.offset += o,
  35457. a
  35458. } catch (t) {
  35459. throw e.offset += o,
  35460. t
  35461. }
  35462. }
  35463. ,
  35464. a.decode64 = function(e) {
  35465. return a.decode(e, "base64")
  35466. }
  35467. ,
  35468. a.decodeHex = function(e) {
  35469. return a.decode(e, "hex")
  35470. }
  35471. ,
  35472. a.decodeJSON = function(e) {
  35473. return new a(JSON.parse(e))
  35474. }
  35475. ,
  35476. s.toString = function() {
  35477. return i.toString()
  35478. }
  35479. ;
  35480. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35481. value: i.buildOpt()
  35482. }),
  35483. Object.defineProperty(s, "$options", {
  35484. value: a.$options
  35485. }),
  35486. Object.defineProperty(a, "$type", {
  35487. value: i
  35488. }),
  35489. Object.defineProperty(s, "$type", {
  35490. value: i
  35491. })),
  35492. a
  35493. }(e, this);
  35494. this._fields = [],
  35495. this._fieldsById = {},
  35496. this._fieldsByName = {};
  35497. for (var r, o = 0, a = this.children.length; o < a; o++)
  35498. if (r = this.children[o],
  35499. r instanceof A || r instanceof d || r instanceof E) {
  35500. if (n.hasOwnProperty(r.name))
  35501. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35502. n[r.name] = r.build()
  35503. } else if (r instanceof d.Field)
  35504. r.build(),
  35505. this._fields.push(r),
  35506. this._fieldsById[r.id] = r,
  35507. this._fieldsByName[r.name] = r;
  35508. else if (!(r instanceof d.OneOf || r instanceof I))
  35509. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35510. return this.clazz = n
  35511. }
  35512. ,
  35513. p.encode = function(e, t, i) {
  35514. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35515. n = this._fields[a],
  35516. r = e[n.name],
  35517. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35518. if (null !== o) {
  35519. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35520. throw l.encoded = t,
  35521. l
  35522. }
  35523. return t
  35524. }
  35525. ,
  35526. p.calculate = function(e) {
  35527. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35528. if (t = this._fields[r],
  35529. i = e[t.name],
  35530. t.required && null === i)
  35531. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35532. n += t.calculate(i, e)
  35533. }
  35534. return n
  35535. }
  35536. ,
  35537. p.decode = function(t, i, n) {
  35538. i = "number" == typeof i ? i : -1;
  35539. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35540. if (o = t.readVarint32(),
  35541. a = 7 & o,
  35542. s = o >>> 3,
  35543. a === e.WIRE_TYPES.ENDGROUP) {
  35544. if (s !== n)
  35545. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35546. break
  35547. }
  35548. if (l = this._fieldsById[s]) {
  35549. if (l.repeated && !l.options.packed)
  35550. h[l.name].push(l.decode(a, t));
  35551. else if (l.map) {
  35552. var u = l.decode(a, t);
  35553. h[l.name].set(u[0], u[1])
  35554. } else if (h[l.name] = l.decode(a, t),
  35555. l.oneof) {
  35556. var d = h[l.oneof.name];
  35557. null !== d && d !== l.name && (h[d] = null),
  35558. h[l.oneof.name] = l.name
  35559. }
  35560. } else
  35561. switch (a) {
  35562. case e.WIRE_TYPES.VARINT:
  35563. t.readVarint32();
  35564. break;
  35565. case e.WIRE_TYPES.BITS32:
  35566. t.offset += 4;
  35567. break;
  35568. case e.WIRE_TYPES.BITS64:
  35569. t.offset += 8;
  35570. break;
  35571. case e.WIRE_TYPES.LDELIM:
  35572. var p = t.readVarint32();
  35573. t.offset += p;
  35574. break;
  35575. case e.WIRE_TYPES.STARTGROUP:
  35576. for (; r(s, t); )
  35577. ;
  35578. break;
  35579. default:
  35580. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35581. }
  35582. }
  35583. for (var f = 0, g = this._fields.length; f < g; ++f)
  35584. if (l = this._fields[f],
  35585. null === h[l.name])
  35586. if ("proto3" === this.syntax)
  35587. h[l.name] = l.defaultValue;
  35588. else {
  35589. if (l.required) {
  35590. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35591. throw m.decoded = h,
  35592. m
  35593. }
  35594. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35595. }
  35596. return h
  35597. }
  35598. ,
  35599. o.Message = d;
  35600. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35601. a.call(this, t, i, s),
  35602. this.className = "Message.Field",
  35603. this.required = "required" === n,
  35604. this.repeated = "repeated" === n,
  35605. this.map = "map" === n,
  35606. this.keyType = r || null,
  35607. this.type = o,
  35608. this.resolvedType = null,
  35609. this.id = l,
  35610. this.options = c || {},
  35611. this.defaultValue = null,
  35612. this.oneof = h || null,
  35613. this.syntax = u || "proto2",
  35614. this.originalName = this.name,
  35615. this.element = null,
  35616. this.keyElement = null,
  35617. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35618. }
  35619. , g = f.prototype = Object.create(a.prototype);
  35620. g.build = function() {
  35621. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35622. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35623. "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)
  35624. }
  35625. ,
  35626. g.verifyValue = function(t, i) {
  35627. function n(e, t) {
  35628. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35629. }
  35630. i = i || !1;
  35631. var r = this;
  35632. if (null === t)
  35633. return this.required && n(typeof t, "required"),
  35634. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35635. null;
  35636. var o;
  35637. if (this.repeated && !i) {
  35638. Array.isArray(t) || (t = [t]);
  35639. var a = [];
  35640. for (o = 0; o < t.length; o++)
  35641. a.push(this.element.verifyValue(t[o]));
  35642. return a
  35643. }
  35644. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35645. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35646. this.element.verifyValue(t))
  35647. }
  35648. ,
  35649. g.hasWirePresence = function(t, i) {
  35650. if ("proto3" !== this.syntax)
  35651. return null !== t;
  35652. if (this.oneof && i[this.oneof.name] === this.name)
  35653. return !0;
  35654. switch (this.type) {
  35655. case e.TYPES.int32:
  35656. case e.TYPES.sint32:
  35657. case e.TYPES.sfixed32:
  35658. case e.TYPES.uint32:
  35659. case e.TYPES.fixed32:
  35660. return 0 !== t;
  35661. case e.TYPES.int64:
  35662. case e.TYPES.sint64:
  35663. case e.TYPES.sfixed64:
  35664. case e.TYPES.uint64:
  35665. case e.TYPES.fixed64:
  35666. return 0 !== t.low || 0 !== t.high;
  35667. case e.TYPES.bool:
  35668. return t;
  35669. case e.TYPES.float:
  35670. case e.TYPES.double:
  35671. return 0 !== t;
  35672. case e.TYPES.string:
  35673. return t.length > 0;
  35674. case e.TYPES.bytes:
  35675. return t.remaining() > 0;
  35676. case e.TYPES.enum:
  35677. return 0 !== t;
  35678. case e.TYPES.message:
  35679. return null !== t;
  35680. default:
  35681. return !0
  35682. }
  35683. }
  35684. ,
  35685. g.encode = function(i, n, r) {
  35686. if (null === this.type || "object" != typeof this.type)
  35687. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35688. if (null === i || this.repeated && 0 == i.length)
  35689. return n;
  35690. try {
  35691. if (this.repeated) {
  35692. var o;
  35693. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35694. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35695. n.ensureCapacity(n.offset += 1);
  35696. var a = n.offset;
  35697. for (o = 0; o < i.length; o++)
  35698. this.element.encodeValue(this.id, i[o], n);
  35699. var s = n.offset - a
  35700. , l = t.calculateVarint32(s);
  35701. if (l > 1) {
  35702. var c = n.slice(a, n.offset);
  35703. a += l - 1,
  35704. n.offset = a,
  35705. n.append(c)
  35706. }
  35707. n.writeVarint32(s, a - l)
  35708. } else
  35709. for (o = 0; o < i.length; o++)
  35710. n.writeVarint32(this.id << 3 | this.type.wireType),
  35711. this.element.encodeValue(this.id, i[o], n)
  35712. } else
  35713. this.map ? i.forEach(function(i, r, o) {
  35714. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35715. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35716. n.writeVarint32(a),
  35717. n.writeVarint32(8 | this.keyType.wireType),
  35718. this.keyElement.encodeValue(1, r, n),
  35719. n.writeVarint32(16 | this.type.wireType),
  35720. this.element.encodeValue(2, i, n)
  35721. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35722. this.element.encodeValue(this.id, i, n))
  35723. } catch (e) {
  35724. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35725. }
  35726. return n
  35727. }
  35728. ,
  35729. g.calculate = function(i, n) {
  35730. if (i = this.verifyValue(i),
  35731. null === this.type || "object" != typeof this.type)
  35732. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35733. if (null === i || this.repeated && 0 == i.length)
  35734. return 0;
  35735. var r = 0;
  35736. try {
  35737. if (this.repeated) {
  35738. var o, a;
  35739. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35740. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35741. a = 0,
  35742. o = 0; o < i.length; o++)
  35743. a += this.element.calculateLength(this.id, i[o]);
  35744. r += t.calculateVarint32(a),
  35745. r += a
  35746. } else
  35747. for (o = 0; o < i.length; o++)
  35748. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35749. r += this.element.calculateLength(this.id, i[o])
  35750. } else
  35751. this.map ? i.forEach(function(i, n, o) {
  35752. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35753. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35754. r += t.calculateVarint32(a),
  35755. r += a
  35756. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35757. r += this.element.calculateLength(this.id, i))
  35758. } catch (e) {
  35759. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35760. }
  35761. return r
  35762. }
  35763. ,
  35764. g.decode = function(t, i, n) {
  35765. 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;
  35766. if (!a)
  35767. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35768. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35769. o = i.readVarint32(),
  35770. o = i.offset + o;
  35771. for (var s = []; i.offset < o; )
  35772. s.push(this.decode(this.type.wireType, i, !0));
  35773. return s
  35774. }
  35775. if (this.map) {
  35776. var l = h.defaultFieldValue(this.keyType);
  35777. if (r = h.defaultFieldValue(this.type),
  35778. o = i.readVarint32(),
  35779. i.remaining() < o)
  35780. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  35781. var c = i.clone();
  35782. for (c.limit = c.offset + o,
  35783. i.offset += o; c.remaining() > 0; ) {
  35784. var u = c.readVarint32();
  35785. t = 7 & u;
  35786. var d = u >>> 3;
  35787. if (1 === d)
  35788. l = this.keyElement.decode(c, t, d);
  35789. else {
  35790. if (2 !== d)
  35791. throw Error("Unexpected tag in map field key/value submessage");
  35792. r = this.element.decode(c, t, d)
  35793. }
  35794. }
  35795. return [l, r]
  35796. }
  35797. return this.element.decode(i, t, this.id)
  35798. }
  35799. ,
  35800. o.Message.Field = f;
  35801. var m = function(e, t, i, n, r, o, a) {
  35802. f.call(this, e, t, i, null, n, r, o, a),
  35803. this.extension
  35804. };
  35805. m.prototype = Object.create(f.prototype),
  35806. o.Message.ExtensionField = m;
  35807. var v = function(e, t, i) {
  35808. a.call(this, e, t, i),
  35809. this.fields = []
  35810. };
  35811. o.Message.OneOf = v;
  35812. var A = function(e, t, i, n, r) {
  35813. l.call(this, e, t, i, n, r),
  35814. this.className = "Enum",
  35815. this.object = null
  35816. };
  35817. A.getName = function(e, t) {
  35818. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  35819. if (e[i = n[r]] === t)
  35820. return i;
  35821. return null
  35822. }
  35823. ;
  35824. var y = A.prototype = Object.create(l.prototype);
  35825. y.build = function(t) {
  35826. if (this.object && !t)
  35827. return this.object;
  35828. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  35829. i[n[r].name] = n[r].id;
  35830. return Object.defineProperty && Object.defineProperty(i, "$options", {
  35831. value: this.buildOpt(),
  35832. enumerable: !1
  35833. }),
  35834. this.object = i
  35835. }
  35836. ,
  35837. o.Enum = A;
  35838. var C = function(e, t, i, n) {
  35839. a.call(this, e, t, i),
  35840. this.className = "Enum.Value",
  35841. this.id = n
  35842. };
  35843. C.prototype = Object.create(a.prototype),
  35844. o.Enum.Value = C;
  35845. var I = function(e, t, i, n) {
  35846. a.call(this, e, t, i),
  35847. this.field = n
  35848. };
  35849. I.prototype = Object.create(a.prototype),
  35850. o.Extension = I;
  35851. var E = function(e, t, i, n) {
  35852. l.call(this, e, t, i, n),
  35853. this.className = "Service",
  35854. this.clazz = null
  35855. }
  35856. , b = E.prototype = Object.create(l.prototype);
  35857. b.build = function(i) {
  35858. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  35859. for (var n = function(t) {
  35860. e.Builder.Service.call(this),
  35861. this.rpcImpl = t || function(e, t, i) {
  35862. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  35863. }
  35864. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  35865. !function(e) {
  35866. r[e.name] = function(n, r) {
  35867. try {
  35868. try {
  35869. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35870. } catch (e) {
  35871. if (!(e instanceof TypeError))
  35872. throw e
  35873. }
  35874. if (null === n || "object" != typeof n)
  35875. throw Error("Illegal arguments");
  35876. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35877. this.rpcImpl(e.fqn(), n, function(t, n) {
  35878. if (t)
  35879. return void r(t);
  35880. null === n && (n = "");
  35881. try {
  35882. n = e.resolvedResponseType.clazz.decode(n)
  35883. } catch (e) {}
  35884. 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))
  35885. })
  35886. } catch (e) {
  35887. setTimeout(r.bind(this, e), 0)
  35888. }
  35889. }
  35890. ,
  35891. n[e.name] = function(t, i, r) {
  35892. new n(t)[e.name](i, r)
  35893. }
  35894. ,
  35895. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  35896. value: e.buildOpt()
  35897. }),
  35898. Object.defineProperty(r[e.name], "$options", {
  35899. value: n[e.name].$options
  35900. }))
  35901. }(o[a]);
  35902. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  35903. value: i.buildOpt()
  35904. }),
  35905. Object.defineProperty(r, "$options", {
  35906. value: n.$options
  35907. }),
  35908. Object.defineProperty(n, "$type", {
  35909. value: i
  35910. }),
  35911. Object.defineProperty(r, "$type", {
  35912. value: i
  35913. })),
  35914. n
  35915. }(e, this)
  35916. }
  35917. ,
  35918. o.Service = E;
  35919. var w = function(e, t, i, n) {
  35920. a.call(this, e, t, i),
  35921. this.className = "Service.Method",
  35922. this.options = n || {}
  35923. }
  35924. , _ = w.prototype = Object.create(a.prototype);
  35925. _.buildOpt = c.buildOpt,
  35926. o.Service.Method = w;
  35927. var T = function(e, t, i, n, r, o, a, s) {
  35928. w.call(this, e, t, i, s),
  35929. this.className = "Service.RPCMethod",
  35930. this.requestName = n,
  35931. this.responseName = r,
  35932. this.requestStream = o,
  35933. this.responseStream = a,
  35934. this.resolvedRequestType = null,
  35935. this.resolvedResponseType = null
  35936. };
  35937. return T.prototype = Object.create(w.prototype),
  35938. o.Service.RPCMethod = T,
  35939. o
  35940. }(r),
  35941. r.Builder = function(t, i, n) {
  35942. function r(e) {
  35943. e.messages && e.messages.forEach(function(t) {
  35944. t.syntax = e.syntax,
  35945. r(t)
  35946. }),
  35947. e.enums && e.enums.forEach(function(t) {
  35948. t.syntax = e.syntax
  35949. })
  35950. }
  35951. var o = function(e) {
  35952. this.ns = new n.Namespace(this,null,""),
  35953. this.ptr = this.ns,
  35954. this.resolved = !1,
  35955. this.result = null,
  35956. this.files = {},
  35957. this.importRoot = null,
  35958. this.options = e || {}
  35959. }
  35960. , a = o.prototype;
  35961. return o.isMessage = function(e) {
  35962. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  35963. }
  35964. ,
  35965. o.isMessageField = function(e) {
  35966. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  35967. }
  35968. ,
  35969. o.isEnum = function(e) {
  35970. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35971. }
  35972. ,
  35973. o.isService = function(e) {
  35974. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  35975. }
  35976. ,
  35977. o.isExtend = function(e) {
  35978. return "string" == typeof e.ref
  35979. }
  35980. ,
  35981. a.reset = function() {
  35982. return this.ptr = this.ns,
  35983. this
  35984. }
  35985. ,
  35986. a.define = function(e) {
  35987. if ("string" != typeof e || !i.TYPEREF.test(e))
  35988. throw Error("illegal namespace: " + e);
  35989. return e.split(".").forEach(function(e) {
  35990. var t = this.ptr.getChild(e);
  35991. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  35992. this.ptr = t
  35993. }, this),
  35994. this
  35995. }
  35996. ,
  35997. a.create = function(e) {
  35998. if (!e)
  35999. return this;
  36000. if (Array.isArray(e)) {
  36001. if (0 === e.length)
  36002. return this;
  36003. e = e.slice()
  36004. } else
  36005. e = [e];
  36006. for (var i = [e]; i.length > 0; ) {
  36007. if (e = i.pop(),
  36008. !Array.isArray(e))
  36009. throw Error("not a valid namespace: " + JSON.stringify(e));
  36010. for (; e.length > 0; ) {
  36011. var r = e.shift();
  36012. if (o.isMessage(r)) {
  36013. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36014. , s = {};
  36015. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36016. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36017. }, this),
  36018. r.fields && r.fields.forEach(function(e) {
  36019. if (null !== a.getChild(0 | e.id))
  36020. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36021. if (e.options && "object" != typeof e.options)
  36022. throw Error("illegal field options in " + a.name + "#" + e.name);
  36023. var t = null;
  36024. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36025. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36026. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36027. t && t.fields.push(e),
  36028. a.addChild(e)
  36029. }, this);
  36030. var l = [];
  36031. if (r.enums && r.enums.forEach(function(e) {
  36032. l.push(e)
  36033. }),
  36034. r.messages && r.messages.forEach(function(e) {
  36035. l.push(e)
  36036. }),
  36037. r.services && r.services.forEach(function(e) {
  36038. l.push(e)
  36039. }),
  36040. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36041. this.ptr.addChild(a),
  36042. l.length > 0) {
  36043. i.push(e),
  36044. e = l,
  36045. l = null,
  36046. this.ptr = a,
  36047. a = null;
  36048. continue
  36049. }
  36050. l = null
  36051. } else if (o.isEnum(r))
  36052. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36053. r.values.forEach(function(e) {
  36054. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36055. }, this),
  36056. this.ptr.addChild(a);
  36057. else if (o.isService(r))
  36058. a = new n.Service(this,this.ptr,r.name,r.options),
  36059. Object.keys(r.rpc).forEach(function(e) {
  36060. var t = r.rpc[e];
  36061. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36062. }, this),
  36063. this.ptr.addChild(a);
  36064. else {
  36065. if (!o.isExtend(r))
  36066. throw Error("not a valid definition: " + JSON.stringify(r));
  36067. if (a = this.ptr.resolve(r.ref, !0))
  36068. r.fields.forEach(function(e) {
  36069. if (null !== a.getChild(0 | e.id))
  36070. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36071. if (a.extensions) {
  36072. var i = !1;
  36073. if (a.extensions.forEach(function(t) {
  36074. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36075. }),
  36076. !i)
  36077. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36078. }
  36079. var r = e.name;
  36080. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36081. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36082. , s = new n.Extension(this,this.ptr,e.name,o);
  36083. o.extension = s,
  36084. this.ptr.addChild(s),
  36085. a.addChild(o)
  36086. }, this);
  36087. else if (!/\.?google\.protobuf\./.test(r.ref))
  36088. throw Error("extended message " + r.ref + " is not defined")
  36089. }
  36090. r = null,
  36091. a = null
  36092. }
  36093. e = null,
  36094. this.ptr = this.ptr.parent
  36095. }
  36096. return this.resolved = !1,
  36097. this.result = null,
  36098. this
  36099. }
  36100. ,
  36101. a.import = function(i, n) {
  36102. var o = "/";
  36103. if ("string" == typeof n) {
  36104. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36105. this.files[n] === !0)
  36106. return this.reset();
  36107. this.files[n] = !0
  36108. } else if ("object" == typeof n) {
  36109. var a = n.root;
  36110. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36111. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36112. var s = a + o + n.file;
  36113. if (this.files[s] === !0)
  36114. return this.reset();
  36115. this.files[s] = !0
  36116. }
  36117. if (i.imports && i.imports.length > 0) {
  36118. var l, c = !1;
  36119. "object" == typeof n ? (this.importRoot = n.root,
  36120. c = !0,
  36121. l = this.importRoot,
  36122. n = n.file,
  36123. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36124. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36125. o = "\\") : l = "." : l = null;
  36126. for (var h = 0; h < i.imports.length; h++)
  36127. if ("string" == typeof i.imports[h]) {
  36128. if (!l)
  36129. throw Error("cannot determine import root");
  36130. var u = i.imports[h];
  36131. if ("google/protobuf/descriptor.proto" === u)
  36132. continue;
  36133. if (u = l + o + u,
  36134. this.files[u] === !0)
  36135. continue;
  36136. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36137. var d = t.Util.fetch(u);
  36138. if (null === d)
  36139. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36140. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36141. } else
  36142. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36143. return t + "_import" + h + "." + i
  36144. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36145. c && (this.importRoot = null)
  36146. }
  36147. i.package && this.define(i.package),
  36148. i.syntax && r(i);
  36149. var p = this.ptr;
  36150. return i.options && Object.keys(i.options).forEach(function(e) {
  36151. p.options[e] = i.options[e]
  36152. }),
  36153. i.messages && (this.create(i.messages),
  36154. this.ptr = p),
  36155. i.enums && (this.create(i.enums),
  36156. this.ptr = p),
  36157. i.services && (this.create(i.services),
  36158. this.ptr = p),
  36159. i.extends && this.create(i.extends),
  36160. this.reset()
  36161. }
  36162. ,
  36163. a.resolveAll = function() {
  36164. var e;
  36165. if (null == this.ptr || "object" == typeof this.ptr.type)
  36166. return this;
  36167. if (this.ptr instanceof n.Namespace)
  36168. this.ptr.children.forEach(function(e) {
  36169. this.ptr = e,
  36170. this.resolveAll()
  36171. }, this);
  36172. else if (this.ptr instanceof n.Message.Field) {
  36173. if (i.TYPE.test(this.ptr.type))
  36174. this.ptr.type = t.TYPES[this.ptr.type];
  36175. else {
  36176. if (!i.TYPEREF.test(this.ptr.type))
  36177. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36178. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36179. !e)
  36180. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36181. if (this.ptr.resolvedType = e,
  36182. e instanceof n.Enum) {
  36183. if (this.ptr.type = t.TYPES.enum,
  36184. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36185. throw Error("proto3 message cannot reference proto2 enum")
  36186. } else {
  36187. if (!(e instanceof n.Message))
  36188. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36189. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36190. }
  36191. }
  36192. if (this.ptr.map) {
  36193. if (!i.TYPE.test(this.ptr.keyType))
  36194. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36195. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36196. }
  36197. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36198. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36199. throw Error("illegal service type in " + this.ptr.toString(!0));
  36200. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36201. !(e && e instanceof t.Reflect.Message))
  36202. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36203. if (this.ptr.resolvedRequestType = e,
  36204. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36205. !(e && e instanceof t.Reflect.Message))
  36206. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36207. this.ptr.resolvedResponseType = e
  36208. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36209. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36210. return this.reset()
  36211. }
  36212. ,
  36213. a.build = function(e) {
  36214. if (this.reset(),
  36215. this.resolved || (this.resolveAll(),
  36216. this.resolved = !0,
  36217. this.result = null),
  36218. null === this.result && (this.result = this.ns.build()),
  36219. !e)
  36220. return this.result;
  36221. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36222. if (!i[t[n]]) {
  36223. i = null;
  36224. break
  36225. }
  36226. i = i[t[n]]
  36227. }
  36228. return i
  36229. }
  36230. ,
  36231. a.lookup = function(e, t) {
  36232. return e ? this.ns.resolve(e, t) : this.ns
  36233. }
  36234. ,
  36235. a.toString = function() {
  36236. return "Builder"
  36237. }
  36238. ,
  36239. o.Message = function() {}
  36240. ,
  36241. o.Enum = function() {}
  36242. ,
  36243. o.Service = function() {}
  36244. ,
  36245. o
  36246. }(r, r.Lang, r.Reflect),
  36247. r.Map = function(e, t) {
  36248. function i(e) {
  36249. var t = 0;
  36250. return {
  36251. next: function() {
  36252. return t < e.length ? {
  36253. done: !1,
  36254. value: e[t++]
  36255. } : {
  36256. done: !0
  36257. }
  36258. }
  36259. }
  36260. }
  36261. var n = function(e, i) {
  36262. if (!e.map)
  36263. throw Error("field is not a map");
  36264. if (this.field = e,
  36265. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36266. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36267. this.map = {},
  36268. Object.defineProperty(this, "size", {
  36269. get: function() {
  36270. return Object.keys(this.map).length
  36271. }
  36272. }),
  36273. i)
  36274. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36275. var o = this.keyElem.valueFromString(n[r])
  36276. , a = this.valueElem.verifyValue(i[n[r]]);
  36277. this.map[this.keyElem.valueToString(o)] = {
  36278. key: o,
  36279. value: a
  36280. }
  36281. }
  36282. }
  36283. , r = n.prototype;
  36284. return r.clear = function() {
  36285. this.map = {}
  36286. }
  36287. ,
  36288. r.delete = function(e) {
  36289. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36290. , i = t in this.map;
  36291. return delete this.map[t],
  36292. i
  36293. }
  36294. ,
  36295. r.entries = function() {
  36296. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36297. t.push([(e = this.map[n[r]]).key, e.value]);
  36298. return i(t)
  36299. }
  36300. ,
  36301. r.keys = function() {
  36302. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36303. e.push(this.map[t[n]].key);
  36304. return i(e)
  36305. }
  36306. ,
  36307. r.values = function() {
  36308. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36309. e.push(this.map[t[n]].value);
  36310. return i(e)
  36311. }
  36312. ,
  36313. r.forEach = function(e, t) {
  36314. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36315. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36316. }
  36317. ,
  36318. r.set = function(e, t) {
  36319. var i = this.keyElem.verifyValue(e)
  36320. , n = this.valueElem.verifyValue(t);
  36321. return this.map[this.keyElem.valueToString(i)] = {
  36322. key: i,
  36323. value: n
  36324. },
  36325. this
  36326. }
  36327. ,
  36328. r.get = function(e) {
  36329. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36330. if (t in this.map)
  36331. return this.map[t].value
  36332. }
  36333. ,
  36334. r.has = function(e) {
  36335. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36336. return t in this.map
  36337. }
  36338. ,
  36339. n
  36340. }(r, r.Reflect),
  36341. r.loadProto = function(e, t, i) {
  36342. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36343. t = void 0),
  36344. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36345. }
  36346. ,
  36347. r.protoFromString = r.loadProto,
  36348. r.loadProtoFile = function(e, t, i) {
  36349. if (t && "object" == typeof t ? (i = t,
  36350. t = null) : t && "function" == typeof t || (t = null),
  36351. t)
  36352. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36353. if (null === n)
  36354. return void t(Error("Failed to fetch file"));
  36355. try {
  36356. t(null, r.loadProto(n, i, e))
  36357. } catch (e) {
  36358. t(e)
  36359. }
  36360. });
  36361. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36362. return null === n ? null : r.loadProto(n, i, e)
  36363. }
  36364. ,
  36365. r.protoFromFile = r.loadProtoFile,
  36366. r.newBuilder = function(e) {
  36367. return e = e || {},
  36368. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36369. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36370. new r.Builder(e)
  36371. }
  36372. ,
  36373. r.loadJson = function(e, t, i) {
  36374. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36375. t = null),
  36376. t && "object" == typeof t || (t = r.newBuilder()),
  36377. "string" == typeof e && (e = JSON.parse(e)),
  36378. t.import(e, i),
  36379. t.resolveAll(),
  36380. t
  36381. }
  36382. ,
  36383. r.loadJsonFile = function(e, t, i) {
  36384. if (t && "object" == typeof t ? (i = t,
  36385. t = null) : t && "function" == typeof t || (t = null),
  36386. t)
  36387. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36388. if (null === n)
  36389. return void t(Error("Failed to fetch file"));
  36390. try {
  36391. t(null, r.loadJson(JSON.parse(n), i, e))
  36392. } catch (e) {
  36393. t(e)
  36394. }
  36395. });
  36396. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36397. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36398. }
  36399. ,
  36400. r
  36401. })
  36402. }
  36403. ).call(this, e("_process"))
  36404. }
  36405. , {
  36406. _process: 203,
  36407. bytebuffer: 215,
  36408. fs: 197,
  36409. path: 197
  36410. }],
  36411. 215: [function(e, t, i) {
  36412. !function(i, n) {
  36413. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36414. var t;
  36415. try {
  36416. t = e("long")
  36417. } catch (e) {}
  36418. return n(t)
  36419. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36420. }(this, function(e) {
  36421. "use strict";
  36422. function t(e) {
  36423. var t = 0;
  36424. return function() {
  36425. return t < e.length ? e.charCodeAt(t++) : null
  36426. }
  36427. }
  36428. function i() {
  36429. var e = []
  36430. , t = [];
  36431. return function() {
  36432. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36433. e.length = 0),
  36434. void Array.prototype.push.apply(e, arguments))
  36435. }
  36436. }
  36437. function n(e, t, i, n, r) {
  36438. 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];
  36439. for (u += d,
  36440. o = p & (1 << -h) - 1,
  36441. p >>= -h,
  36442. h += s; h > 0; o = 256 * o + e[t + u],
  36443. u += d,
  36444. h -= 8)
  36445. ;
  36446. for (a = o & (1 << -h) - 1,
  36447. o >>= -h,
  36448. h += n; h > 0; a = 256 * a + e[t + u],
  36449. u += d,
  36450. h -= 8)
  36451. ;
  36452. if (0 === o)
  36453. o = 1 - c;
  36454. else {
  36455. if (o === l)
  36456. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36457. a += Math.pow(2, n),
  36458. o -= c
  36459. }
  36460. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36461. }
  36462. function r(e, t, i, n, r, o) {
  36463. 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;
  36464. for (t = Math.abs(t),
  36465. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36466. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36467. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36468. l *= 2),
  36469. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36470. t * l >= 2 && (a++,
  36471. l /= 2),
  36472. a + u >= h ? (s = 0,
  36473. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36474. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36475. a = 0)); r >= 8; e[i + p] = 255 & s,
  36476. p += f,
  36477. s /= 256,
  36478. r -= 8)
  36479. ;
  36480. for (a = a << r | s,
  36481. c += r; c > 0; e[i + p] = 255 & a,
  36482. p += f,
  36483. a /= 256,
  36484. c -= 8)
  36485. ;
  36486. e[i + p - f] |= 128 * g
  36487. }
  36488. var o = function(e, t, i) {
  36489. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36490. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36491. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36492. !i) {
  36493. if (e |= 0,
  36494. e < 0)
  36495. throw RangeError("Illegal capacity");
  36496. t = !!t,
  36497. i = !!i
  36498. }
  36499. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36500. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36501. this.offset = 0,
  36502. this.markedOffset = -1,
  36503. this.limit = e,
  36504. this.littleEndian = t,
  36505. this.noAssert = i
  36506. };
  36507. o.VERSION = "5.0.1",
  36508. o.LITTLE_ENDIAN = !0,
  36509. o.BIG_ENDIAN = !1,
  36510. o.DEFAULT_CAPACITY = 16,
  36511. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36512. o.DEFAULT_NOASSERT = !1,
  36513. o.Long = e || null;
  36514. var a = o.prototype;
  36515. a.__isByteBuffer__,
  36516. Object.defineProperty(a, "__isByteBuffer__", {
  36517. value: !0,
  36518. enumerable: !1,
  36519. configurable: !1
  36520. });
  36521. var s = new ArrayBuffer(0)
  36522. , l = String.fromCharCode;
  36523. o.accessor = function() {
  36524. return Uint8Array
  36525. }
  36526. ,
  36527. o.allocate = function(e, t, i) {
  36528. return new o(e,t,i)
  36529. }
  36530. ,
  36531. o.concat = function(e, t, i, n) {
  36532. "boolean" != typeof t && "string" == typeof t || (n = i,
  36533. i = t,
  36534. t = void 0);
  36535. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36536. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36537. r = e[s].limit - e[s].offset,
  36538. r > 0 && (a += r);
  36539. if (0 === a)
  36540. return new o(0,i,n);
  36541. var c, h = new o(a,i,n);
  36542. for (s = 0; s < l; )
  36543. c = e[s++],
  36544. r = c.limit - c.offset,
  36545. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36546. h.offset += r);
  36547. return h.limit = h.offset,
  36548. h.offset = 0,
  36549. h
  36550. }
  36551. ,
  36552. o.isByteBuffer = function(e) {
  36553. return (e && e.__isByteBuffer__) === !0
  36554. }
  36555. ,
  36556. o.type = function() {
  36557. return ArrayBuffer
  36558. }
  36559. ,
  36560. o.wrap = function(e, t, i, n) {
  36561. if ("string" != typeof t && (n = i,
  36562. i = t,
  36563. t = void 0),
  36564. "string" == typeof e)
  36565. switch ("undefined" == typeof t && (t = "utf8"),
  36566. t) {
  36567. case "base64":
  36568. return o.fromBase64(e, i);
  36569. case "hex":
  36570. return o.fromHex(e, i);
  36571. case "binary":
  36572. return o.fromBinary(e, i);
  36573. case "utf8":
  36574. return o.fromUTF8(e, i);
  36575. case "debug":
  36576. return o.fromDebug(e, i);
  36577. default:
  36578. throw Error("Unsupported encoding: " + t)
  36579. }
  36580. if (null === e || "object" != typeof e)
  36581. throw TypeError("Illegal buffer");
  36582. var r;
  36583. if (o.isByteBuffer(e))
  36584. return r = a.clone.call(e),
  36585. r.markedOffset = -1,
  36586. r;
  36587. if (e instanceof Uint8Array)
  36588. r = new o(0,i,n),
  36589. e.length > 0 && (r.buffer = e.buffer,
  36590. r.offset = e.byteOffset,
  36591. r.limit = e.byteOffset + e.byteLength,
  36592. r.view = new Uint8Array(e.buffer));
  36593. else if (e instanceof ArrayBuffer)
  36594. r = new o(0,i,n),
  36595. e.byteLength > 0 && (r.buffer = e,
  36596. r.offset = 0,
  36597. r.limit = e.byteLength,
  36598. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36599. else {
  36600. if ("[object Array]" !== Object.prototype.toString.call(e))
  36601. throw TypeError("Illegal buffer");
  36602. r = new o(e.length,i,n),
  36603. r.limit = e.length;
  36604. for (var s = 0; s < e.length; ++s)
  36605. r.view[s] = e[s]
  36606. }
  36607. return r
  36608. }
  36609. ,
  36610. a.writeBitSet = function(e, t) {
  36611. var i = "undefined" == typeof t;
  36612. if (i && (t = this.offset),
  36613. !this.noAssert) {
  36614. if (!(e instanceof Array))
  36615. throw TypeError("Illegal BitSet: Not an array");
  36616. if ("number" != typeof t || t % 1 !== 0)
  36617. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36618. if (t >>>= 0,
  36619. t < 0 || t + 0 > this.buffer.byteLength)
  36620. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36621. }
  36622. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36623. for (t += this.writeVarint32(o, t); a--; )
  36624. 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,
  36625. this.writeByte(n, t++);
  36626. if (s < o) {
  36627. var l = 0;
  36628. for (n = 0; s < o; )
  36629. n |= (1 & !!e[s++]) << l++;
  36630. this.writeByte(n, t++)
  36631. }
  36632. return i ? (this.offset = t,
  36633. this) : t - r
  36634. }
  36635. ,
  36636. a.readBitSet = function(e) {
  36637. var t = "undefined" == typeof e;
  36638. t && (e = this.offset);
  36639. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36640. for (e += n.length; o--; )
  36641. i = this.readByte(e++),
  36642. s[a++] = !!(1 & i),
  36643. s[a++] = !!(2 & i),
  36644. s[a++] = !!(4 & i),
  36645. s[a++] = !!(8 & i),
  36646. s[a++] = !!(16 & i),
  36647. s[a++] = !!(32 & i),
  36648. s[a++] = !!(64 & i),
  36649. s[a++] = !!(128 & i);
  36650. if (a < r) {
  36651. var l = 0;
  36652. for (i = this.readByte(e++); a < r; )
  36653. s[a++] = !!(i >> l++ & 1)
  36654. }
  36655. return t && (this.offset = e),
  36656. s
  36657. }
  36658. ,
  36659. a.readBytes = function(e, t) {
  36660. var i = "undefined" == typeof t;
  36661. if (i && (t = this.offset),
  36662. !this.noAssert) {
  36663. if ("number" != typeof t || t % 1 !== 0)
  36664. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36665. if (t >>>= 0,
  36666. t < 0 || t + e > this.buffer.byteLength)
  36667. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36668. }
  36669. var n = this.slice(t, t + e);
  36670. return i && (this.offset += e),
  36671. n
  36672. }
  36673. ,
  36674. a.writeBytes = a.append,
  36675. a.writeInt8 = function(e, t) {
  36676. var i = "undefined" == typeof t;
  36677. if (i && (t = this.offset),
  36678. !this.noAssert) {
  36679. if ("number" != typeof e || e % 1 !== 0)
  36680. throw TypeError("Illegal value: " + e + " (not an integer)");
  36681. if (e |= 0,
  36682. "number" != typeof t || t % 1 !== 0)
  36683. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36684. if (t >>>= 0,
  36685. t < 0 || t + 0 > this.buffer.byteLength)
  36686. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36687. }
  36688. t += 1;
  36689. var n = this.buffer.byteLength;
  36690. return t > n && this.resize((n *= 2) > t ? n : t),
  36691. t -= 1,
  36692. this.view[t] = e,
  36693. i && (this.offset += 1),
  36694. this
  36695. }
  36696. ,
  36697. a.writeByte = a.writeInt8,
  36698. a.readInt8 = function(e) {
  36699. var t = "undefined" == typeof e;
  36700. if (t && (e = this.offset),
  36701. !this.noAssert) {
  36702. if ("number" != typeof e || e % 1 !== 0)
  36703. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36704. if (e >>>= 0,
  36705. e < 0 || e + 1 > this.buffer.byteLength)
  36706. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36707. }
  36708. var i = this.view[e];
  36709. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36710. t && (this.offset += 1),
  36711. i
  36712. }
  36713. ,
  36714. a.readByte = a.readInt8,
  36715. a.writeUint8 = function(e, t) {
  36716. var i = "undefined" == typeof t;
  36717. if (i && (t = this.offset),
  36718. !this.noAssert) {
  36719. if ("number" != typeof e || e % 1 !== 0)
  36720. throw TypeError("Illegal value: " + e + " (not an integer)");
  36721. if (e >>>= 0,
  36722. "number" != typeof t || t % 1 !== 0)
  36723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36724. if (t >>>= 0,
  36725. t < 0 || t + 0 > this.buffer.byteLength)
  36726. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36727. }
  36728. t += 1;
  36729. var n = this.buffer.byteLength;
  36730. return t > n && this.resize((n *= 2) > t ? n : t),
  36731. t -= 1,
  36732. this.view[t] = e,
  36733. i && (this.offset += 1),
  36734. this
  36735. }
  36736. ,
  36737. a.writeUInt8 = a.writeUint8,
  36738. a.readUint8 = function(e) {
  36739. var t = "undefined" == typeof e;
  36740. if (t && (e = this.offset),
  36741. !this.noAssert) {
  36742. if ("number" != typeof e || e % 1 !== 0)
  36743. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36744. if (e >>>= 0,
  36745. e < 0 || e + 1 > this.buffer.byteLength)
  36746. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36747. }
  36748. var i = this.view[e];
  36749. return t && (this.offset += 1),
  36750. i
  36751. }
  36752. ,
  36753. a.readUInt8 = a.readUint8,
  36754. a.writeInt16 = function(e, t) {
  36755. var i = "undefined" == typeof t;
  36756. if (i && (t = this.offset),
  36757. !this.noAssert) {
  36758. if ("number" != typeof e || e % 1 !== 0)
  36759. throw TypeError("Illegal value: " + e + " (not an integer)");
  36760. if (e |= 0,
  36761. "number" != typeof t || t % 1 !== 0)
  36762. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36763. if (t >>>= 0,
  36764. t < 0 || t + 0 > this.buffer.byteLength)
  36765. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36766. }
  36767. t += 2;
  36768. var n = this.buffer.byteLength;
  36769. return t > n && this.resize((n *= 2) > t ? n : t),
  36770. t -= 2,
  36771. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36772. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36773. this.view[t + 1] = 255 & e),
  36774. i && (this.offset += 2),
  36775. this
  36776. }
  36777. ,
  36778. a.writeShort = a.writeInt16,
  36779. a.readInt16 = function(e) {
  36780. var t = "undefined" == typeof e;
  36781. if (t && (e = this.offset),
  36782. !this.noAssert) {
  36783. if ("number" != typeof e || e % 1 !== 0)
  36784. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36785. if (e >>>= 0,
  36786. e < 0 || e + 2 > this.buffer.byteLength)
  36787. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36788. }
  36789. var i = 0;
  36790. return this.littleEndian ? (i = this.view[e],
  36791. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36792. i |= this.view[e + 1]),
  36793. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  36794. t && (this.offset += 2),
  36795. i
  36796. }
  36797. ,
  36798. a.readShort = a.readInt16,
  36799. a.writeUint16 = function(e, t) {
  36800. var i = "undefined" == typeof t;
  36801. if (i && (t = this.offset),
  36802. !this.noAssert) {
  36803. if ("number" != typeof e || e % 1 !== 0)
  36804. throw TypeError("Illegal value: " + e + " (not an integer)");
  36805. if (e >>>= 0,
  36806. "number" != typeof t || t % 1 !== 0)
  36807. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36808. if (t >>>= 0,
  36809. t < 0 || t + 0 > this.buffer.byteLength)
  36810. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36811. }
  36812. t += 2;
  36813. var n = this.buffer.byteLength;
  36814. return t > n && this.resize((n *= 2) > t ? n : t),
  36815. t -= 2,
  36816. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36817. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36818. this.view[t + 1] = 255 & e),
  36819. i && (this.offset += 2),
  36820. this
  36821. }
  36822. ,
  36823. a.writeUInt16 = a.writeUint16,
  36824. a.readUint16 = function(e) {
  36825. var t = "undefined" == typeof e;
  36826. if (t && (e = this.offset),
  36827. !this.noAssert) {
  36828. if ("number" != typeof e || e % 1 !== 0)
  36829. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36830. if (e >>>= 0,
  36831. e < 0 || e + 2 > this.buffer.byteLength)
  36832. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36833. }
  36834. var i = 0;
  36835. return this.littleEndian ? (i = this.view[e],
  36836. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36837. i |= this.view[e + 1]),
  36838. t && (this.offset += 2),
  36839. i
  36840. }
  36841. ,
  36842. a.readUInt16 = a.readUint16,
  36843. a.writeInt32 = function(e, t) {
  36844. var i = "undefined" == typeof t;
  36845. if (i && (t = this.offset),
  36846. !this.noAssert) {
  36847. if ("number" != typeof e || e % 1 !== 0)
  36848. throw TypeError("Illegal value: " + e + " (not an integer)");
  36849. if (e |= 0,
  36850. "number" != typeof t || t % 1 !== 0)
  36851. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36852. if (t >>>= 0,
  36853. t < 0 || t + 0 > this.buffer.byteLength)
  36854. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36855. }
  36856. t += 4;
  36857. var n = this.buffer.byteLength;
  36858. return t > n && this.resize((n *= 2) > t ? n : t),
  36859. t -= 4,
  36860. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36861. this.view[t + 2] = e >>> 16 & 255,
  36862. this.view[t + 1] = e >>> 8 & 255,
  36863. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36864. this.view[t + 1] = e >>> 16 & 255,
  36865. this.view[t + 2] = e >>> 8 & 255,
  36866. this.view[t + 3] = 255 & e),
  36867. i && (this.offset += 4),
  36868. this
  36869. }
  36870. ,
  36871. a.writeInt = a.writeInt32,
  36872. a.readInt32 = function(e) {
  36873. var t = "undefined" == typeof e;
  36874. if (t && (e = this.offset),
  36875. !this.noAssert) {
  36876. if ("number" != typeof e || e % 1 !== 0)
  36877. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36878. if (e >>>= 0,
  36879. e < 0 || e + 4 > this.buffer.byteLength)
  36880. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36881. }
  36882. var i = 0;
  36883. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36884. i |= this.view[e + 1] << 8,
  36885. i |= this.view[e],
  36886. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36887. i |= this.view[e + 2] << 8,
  36888. i |= this.view[e + 3],
  36889. i += this.view[e] << 24 >>> 0),
  36890. i |= 0,
  36891. t && (this.offset += 4),
  36892. i
  36893. }
  36894. ,
  36895. a.readInt = a.readInt32,
  36896. a.writeUint32 = function(e, t) {
  36897. var i = "undefined" == typeof t;
  36898. if (i && (t = this.offset),
  36899. !this.noAssert) {
  36900. if ("number" != typeof e || e % 1 !== 0)
  36901. throw TypeError("Illegal value: " + e + " (not an integer)");
  36902. if (e >>>= 0,
  36903. "number" != typeof t || t % 1 !== 0)
  36904. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36905. if (t >>>= 0,
  36906. t < 0 || t + 0 > this.buffer.byteLength)
  36907. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36908. }
  36909. t += 4;
  36910. var n = this.buffer.byteLength;
  36911. return t > n && this.resize((n *= 2) > t ? n : t),
  36912. t -= 4,
  36913. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36914. this.view[t + 2] = e >>> 16 & 255,
  36915. this.view[t + 1] = e >>> 8 & 255,
  36916. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36917. this.view[t + 1] = e >>> 16 & 255,
  36918. this.view[t + 2] = e >>> 8 & 255,
  36919. this.view[t + 3] = 255 & e),
  36920. i && (this.offset += 4),
  36921. this
  36922. }
  36923. ,
  36924. a.writeUInt32 = a.writeUint32,
  36925. a.readUint32 = function(e) {
  36926. var t = "undefined" == typeof e;
  36927. if (t && (e = this.offset),
  36928. !this.noAssert) {
  36929. if ("number" != typeof e || e % 1 !== 0)
  36930. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36931. if (e >>>= 0,
  36932. e < 0 || e + 4 > this.buffer.byteLength)
  36933. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36934. }
  36935. var i = 0;
  36936. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36937. i |= this.view[e + 1] << 8,
  36938. i |= this.view[e],
  36939. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36940. i |= this.view[e + 2] << 8,
  36941. i |= this.view[e + 3],
  36942. i += this.view[e] << 24 >>> 0),
  36943. t && (this.offset += 4),
  36944. i
  36945. }
  36946. ,
  36947. a.readUInt32 = a.readUint32,
  36948. e && (a.writeInt64 = function(t, i) {
  36949. var n = "undefined" == typeof i;
  36950. if (n && (i = this.offset),
  36951. !this.noAssert) {
  36952. if ("number" == typeof t)
  36953. t = e.fromNumber(t);
  36954. else if ("string" == typeof t)
  36955. t = e.fromString(t);
  36956. else if (!(t && t instanceof e))
  36957. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36958. if ("number" != typeof i || i % 1 !== 0)
  36959. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36960. if (i >>>= 0,
  36961. i < 0 || i + 0 > this.buffer.byteLength)
  36962. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36963. }
  36964. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36965. i += 8;
  36966. var r = this.buffer.byteLength;
  36967. i > r && this.resize((r *= 2) > i ? r : i),
  36968. i -= 8;
  36969. var o = t.low
  36970. , a = t.high;
  36971. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36972. this.view[i + 2] = o >>> 16 & 255,
  36973. this.view[i + 1] = o >>> 8 & 255,
  36974. this.view[i] = 255 & o,
  36975. i += 4,
  36976. this.view[i + 3] = a >>> 24 & 255,
  36977. this.view[i + 2] = a >>> 16 & 255,
  36978. this.view[i + 1] = a >>> 8 & 255,
  36979. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36980. this.view[i + 1] = a >>> 16 & 255,
  36981. this.view[i + 2] = a >>> 8 & 255,
  36982. this.view[i + 3] = 255 & a,
  36983. i += 4,
  36984. this.view[i] = o >>> 24 & 255,
  36985. this.view[i + 1] = o >>> 16 & 255,
  36986. this.view[i + 2] = o >>> 8 & 255,
  36987. this.view[i + 3] = 255 & o),
  36988. n && (this.offset += 8),
  36989. this
  36990. }
  36991. ,
  36992. a.writeLong = a.writeInt64,
  36993. a.readInt64 = function(t) {
  36994. var i = "undefined" == typeof t;
  36995. if (i && (t = this.offset),
  36996. !this.noAssert) {
  36997. if ("number" != typeof t || t % 1 !== 0)
  36998. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36999. if (t >>>= 0,
  37000. t < 0 || t + 8 > this.buffer.byteLength)
  37001. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37002. }
  37003. var n = 0
  37004. , r = 0;
  37005. this.littleEndian ? (n = this.view[t + 2] << 16,
  37006. n |= this.view[t + 1] << 8,
  37007. n |= this.view[t],
  37008. n += this.view[t + 3] << 24 >>> 0,
  37009. t += 4,
  37010. r = this.view[t + 2] << 16,
  37011. r |= this.view[t + 1] << 8,
  37012. r |= this.view[t],
  37013. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37014. r |= this.view[t + 2] << 8,
  37015. r |= this.view[t + 3],
  37016. r += this.view[t] << 24 >>> 0,
  37017. t += 4,
  37018. n = this.view[t + 1] << 16,
  37019. n |= this.view[t + 2] << 8,
  37020. n |= this.view[t + 3],
  37021. n += this.view[t] << 24 >>> 0);
  37022. var o = new e(n,r,!1);
  37023. return i && (this.offset += 8),
  37024. o
  37025. }
  37026. ,
  37027. a.readLong = a.readInt64,
  37028. a.writeUint64 = function(t, i) {
  37029. var n = "undefined" == typeof i;
  37030. if (n && (i = this.offset),
  37031. !this.noAssert) {
  37032. if ("number" == typeof t)
  37033. t = e.fromNumber(t);
  37034. else if ("string" == typeof t)
  37035. t = e.fromString(t);
  37036. else if (!(t && t instanceof e))
  37037. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37038. if ("number" != typeof i || i % 1 !== 0)
  37039. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37040. if (i >>>= 0,
  37041. i < 0 || i + 0 > this.buffer.byteLength)
  37042. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37043. }
  37044. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37045. i += 8;
  37046. var r = this.buffer.byteLength;
  37047. i > r && this.resize((r *= 2) > i ? r : i),
  37048. i -= 8;
  37049. var o = t.low
  37050. , a = t.high;
  37051. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37052. this.view[i + 2] = o >>> 16 & 255,
  37053. this.view[i + 1] = o >>> 8 & 255,
  37054. this.view[i] = 255 & o,
  37055. i += 4,
  37056. this.view[i + 3] = a >>> 24 & 255,
  37057. this.view[i + 2] = a >>> 16 & 255,
  37058. this.view[i + 1] = a >>> 8 & 255,
  37059. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37060. this.view[i + 1] = a >>> 16 & 255,
  37061. this.view[i + 2] = a >>> 8 & 255,
  37062. this.view[i + 3] = 255 & a,
  37063. i += 4,
  37064. this.view[i] = o >>> 24 & 255,
  37065. this.view[i + 1] = o >>> 16 & 255,
  37066. this.view[i + 2] = o >>> 8 & 255,
  37067. this.view[i + 3] = 255 & o),
  37068. n && (this.offset += 8),
  37069. this
  37070. }
  37071. ,
  37072. a.writeUInt64 = a.writeUint64,
  37073. a.readUint64 = function(t) {
  37074. var i = "undefined" == typeof t;
  37075. if (i && (t = this.offset),
  37076. !this.noAssert) {
  37077. if ("number" != typeof t || t % 1 !== 0)
  37078. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37079. if (t >>>= 0,
  37080. t < 0 || t + 8 > this.buffer.byteLength)
  37081. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37082. }
  37083. var n = 0
  37084. , r = 0;
  37085. this.littleEndian ? (n = this.view[t + 2] << 16,
  37086. n |= this.view[t + 1] << 8,
  37087. n |= this.view[t],
  37088. n += this.view[t + 3] << 24 >>> 0,
  37089. t += 4,
  37090. r = this.view[t + 2] << 16,
  37091. r |= this.view[t + 1] << 8,
  37092. r |= this.view[t],
  37093. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37094. r |= this.view[t + 2] << 8,
  37095. r |= this.view[t + 3],
  37096. r += this.view[t] << 24 >>> 0,
  37097. t += 4,
  37098. n = this.view[t + 1] << 16,
  37099. n |= this.view[t + 2] << 8,
  37100. n |= this.view[t + 3],
  37101. n += this.view[t] << 24 >>> 0);
  37102. var o = new e(n,r,!0);
  37103. return i && (this.offset += 8),
  37104. o
  37105. }
  37106. ,
  37107. a.readUInt64 = a.readUint64),
  37108. a.writeFloat32 = function(e, t) {
  37109. var i = "undefined" == typeof t;
  37110. if (i && (t = this.offset),
  37111. !this.noAssert) {
  37112. if ("number" != typeof e)
  37113. throw TypeError("Illegal value: " + e + " (not a number)");
  37114. if ("number" != typeof t || t % 1 !== 0)
  37115. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37116. if (t >>>= 0,
  37117. t < 0 || t + 0 > this.buffer.byteLength)
  37118. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37119. }
  37120. t += 4;
  37121. var n = this.buffer.byteLength;
  37122. return t > n && this.resize((n *= 2) > t ? n : t),
  37123. t -= 4,
  37124. r(this.view, e, t, this.littleEndian, 23, 4),
  37125. i && (this.offset += 4),
  37126. this
  37127. }
  37128. ,
  37129. a.writeFloat = a.writeFloat32,
  37130. a.readFloat32 = function(e) {
  37131. var t = "undefined" == typeof e;
  37132. if (t && (e = this.offset),
  37133. !this.noAssert) {
  37134. if ("number" != typeof e || e % 1 !== 0)
  37135. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37136. if (e >>>= 0,
  37137. e < 0 || e + 4 > this.buffer.byteLength)
  37138. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37139. }
  37140. var i = n(this.view, e, this.littleEndian, 23, 4);
  37141. return t && (this.offset += 4),
  37142. i
  37143. }
  37144. ,
  37145. a.readFloat = a.readFloat32,
  37146. a.writeFloat64 = function(e, t) {
  37147. var i = "undefined" == typeof t;
  37148. if (i && (t = this.offset),
  37149. !this.noAssert) {
  37150. if ("number" != typeof e)
  37151. throw TypeError("Illegal value: " + e + " (not a number)");
  37152. if ("number" != typeof t || t % 1 !== 0)
  37153. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37154. if (t >>>= 0,
  37155. t < 0 || t + 0 > this.buffer.byteLength)
  37156. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37157. }
  37158. t += 8;
  37159. var n = this.buffer.byteLength;
  37160. return t > n && this.resize((n *= 2) > t ? n : t),
  37161. t -= 8,
  37162. r(this.view, e, t, this.littleEndian, 52, 8),
  37163. i && (this.offset += 8),
  37164. this
  37165. }
  37166. ,
  37167. a.writeDouble = a.writeFloat64,
  37168. a.readFloat64 = function(e) {
  37169. var t = "undefined" == typeof e;
  37170. if (t && (e = this.offset),
  37171. !this.noAssert) {
  37172. if ("number" != typeof e || e % 1 !== 0)
  37173. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37174. if (e >>>= 0,
  37175. e < 0 || e + 8 > this.buffer.byteLength)
  37176. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37177. }
  37178. var i = n(this.view, e, this.littleEndian, 52, 8);
  37179. return t && (this.offset += 8),
  37180. i
  37181. }
  37182. ,
  37183. a.readDouble = a.readFloat64,
  37184. o.MAX_VARINT32_BYTES = 5,
  37185. o.calculateVarint32 = function(e) {
  37186. return e >>>= 0,
  37187. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37188. }
  37189. ,
  37190. o.zigZagEncode32 = function(e) {
  37191. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37192. }
  37193. ,
  37194. o.zigZagDecode32 = function(e) {
  37195. return e >>> 1 ^ -(1 & e) | 0
  37196. }
  37197. ,
  37198. a.writeVarint32 = function(e, t) {
  37199. var i = "undefined" == typeof t;
  37200. if (i && (t = this.offset),
  37201. !this.noAssert) {
  37202. if ("number" != typeof e || e % 1 !== 0)
  37203. throw TypeError("Illegal value: " + e + " (not an integer)");
  37204. if (e |= 0,
  37205. "number" != typeof t || t % 1 !== 0)
  37206. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37207. if (t >>>= 0,
  37208. t < 0 || t + 0 > this.buffer.byteLength)
  37209. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37210. }
  37211. var n, r = o.calculateVarint32(e);
  37212. t += r;
  37213. var a = this.buffer.byteLength;
  37214. for (t > a && this.resize((a *= 2) > t ? a : t),
  37215. t -= r,
  37216. e >>>= 0; e >= 128; )
  37217. n = 127 & e | 128,
  37218. this.view[t++] = n,
  37219. e >>>= 7;
  37220. return this.view[t++] = e,
  37221. i ? (this.offset = t,
  37222. this) : r
  37223. }
  37224. ,
  37225. a.writeVarint32ZigZag = function(e, t) {
  37226. return this.writeVarint32(o.zigZagEncode32(e), t)
  37227. }
  37228. ,
  37229. a.readVarint32 = function(e) {
  37230. var t = "undefined" == typeof e;
  37231. if (t && (e = this.offset),
  37232. !this.noAssert) {
  37233. if ("number" != typeof e || e % 1 !== 0)
  37234. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37235. if (e >>>= 0,
  37236. e < 0 || e + 1 > this.buffer.byteLength)
  37237. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37238. }
  37239. var i, n = 0, r = 0;
  37240. do {
  37241. if (!this.noAssert && e > this.limit) {
  37242. var o = Error("Truncated");
  37243. throw o.truncated = !0,
  37244. o
  37245. }
  37246. i = this.view[e++],
  37247. n < 5 && (r |= (127 & i) << 7 * n),
  37248. ++n
  37249. } while (0 !== (128 & i));return r |= 0,
  37250. t ? (this.offset = e,
  37251. r) : {
  37252. value: r,
  37253. length: n
  37254. }
  37255. }
  37256. ,
  37257. a.readVarint32ZigZag = function(e) {
  37258. var t = this.readVarint32(e);
  37259. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37260. t
  37261. }
  37262. ,
  37263. e && (o.MAX_VARINT64_BYTES = 10,
  37264. o.calculateVarint64 = function(t) {
  37265. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37266. var i = t.toInt() >>> 0
  37267. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37268. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37269. 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
  37270. }
  37271. ,
  37272. o.zigZagEncode64 = function(t) {
  37273. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37274. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37275. }
  37276. ,
  37277. o.zigZagDecode64 = function(t) {
  37278. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37279. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37280. }
  37281. ,
  37282. a.writeVarint64 = function(t, i) {
  37283. var n = "undefined" == typeof i;
  37284. if (n && (i = this.offset),
  37285. !this.noAssert) {
  37286. if ("number" == typeof t)
  37287. t = e.fromNumber(t);
  37288. else if ("string" == typeof t)
  37289. t = e.fromString(t);
  37290. else if (!(t && t instanceof e))
  37291. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37292. if ("number" != typeof i || i % 1 !== 0)
  37293. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37294. if (i >>>= 0,
  37295. i < 0 || i + 0 > this.buffer.byteLength)
  37296. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37297. }
  37298. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37299. var r = o.calculateVarint64(t)
  37300. , a = t.toInt() >>> 0
  37301. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37302. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37303. i += r;
  37304. var c = this.buffer.byteLength;
  37305. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37306. i -= r,
  37307. r) {
  37308. case 10:
  37309. this.view[i + 9] = l >>> 7 & 1;
  37310. case 9:
  37311. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37312. case 8:
  37313. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37314. case 7:
  37315. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37316. case 6:
  37317. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37318. case 5:
  37319. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37320. case 4:
  37321. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37322. case 3:
  37323. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37324. case 2:
  37325. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37326. case 1:
  37327. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37328. }
  37329. return n ? (this.offset += r,
  37330. this) : r
  37331. }
  37332. ,
  37333. a.writeVarint64ZigZag = function(e, t) {
  37334. return this.writeVarint64(o.zigZagEncode64(e), t)
  37335. }
  37336. ,
  37337. a.readVarint64 = function(t) {
  37338. var i = "undefined" == typeof t;
  37339. if (i && (t = this.offset),
  37340. !this.noAssert) {
  37341. if ("number" != typeof t || t % 1 !== 0)
  37342. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37343. if (t >>>= 0,
  37344. t < 0 || t + 1 > this.buffer.byteLength)
  37345. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37346. }
  37347. var n = t
  37348. , r = 0
  37349. , o = 0
  37350. , a = 0
  37351. , s = 0;
  37352. if (s = this.view[t++],
  37353. r = 127 & s,
  37354. 128 & s && (s = this.view[t++],
  37355. r |= (127 & s) << 7,
  37356. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37357. r |= (127 & s) << 14,
  37358. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37359. r |= (127 & s) << 21,
  37360. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37361. o = 127 & s,
  37362. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37363. o |= (127 & s) << 7,
  37364. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37365. o |= (127 & s) << 14,
  37366. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37367. o |= (127 & s) << 21,
  37368. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37369. a = 127 & s,
  37370. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37371. a |= (127 & s) << 7,
  37372. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37373. throw Error("Buffer overrun");
  37374. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37375. return i ? (this.offset = t,
  37376. l) : {
  37377. value: l,
  37378. length: t - n
  37379. }
  37380. }
  37381. ,
  37382. a.readVarint64ZigZag = function(t) {
  37383. var i = this.readVarint64(t);
  37384. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37385. i
  37386. }
  37387. ),
  37388. a.writeCString = function(e, i) {
  37389. var n = "undefined" == typeof i;
  37390. n && (i = this.offset);
  37391. var r, o = e.length;
  37392. if (!this.noAssert) {
  37393. if ("string" != typeof e)
  37394. throw TypeError("Illegal str: Not a string");
  37395. for (r = 0; r < o; ++r)
  37396. if (0 === e.charCodeAt(r))
  37397. throw RangeError("Illegal str: Contains NULL-characters");
  37398. if ("number" != typeof i || i % 1 !== 0)
  37399. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37400. if (i >>>= 0,
  37401. i < 0 || i + 0 > this.buffer.byteLength)
  37402. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37403. }
  37404. o = h.calculateUTF16asUTF8(t(e))[1],
  37405. i += o + 1;
  37406. var a = this.buffer.byteLength;
  37407. return i > a && this.resize((a *= 2) > i ? a : i),
  37408. i -= o + 1,
  37409. h.encodeUTF16toUTF8(t(e), function(e) {
  37410. this.view[i++] = e
  37411. }
  37412. .bind(this)),
  37413. this.view[i++] = 0,
  37414. n ? (this.offset = i,
  37415. this) : o
  37416. }
  37417. ,
  37418. a.readCString = function(e) {
  37419. var t = "undefined" == typeof e;
  37420. if (t && (e = this.offset),
  37421. !this.noAssert) {
  37422. if ("number" != typeof e || e % 1 !== 0)
  37423. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37424. if (e >>>= 0,
  37425. e < 0 || e + 1 > this.buffer.byteLength)
  37426. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37427. }
  37428. var n, r = e, o = -1;
  37429. return h.decodeUTF8toUTF16(function() {
  37430. if (0 === o)
  37431. return null;
  37432. if (e >= this.limit)
  37433. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37434. return o = this.view[e++],
  37435. 0 === o ? null : o
  37436. }
  37437. .bind(this), n = i(), !0),
  37438. t ? (this.offset = e,
  37439. n()) : {
  37440. string: n(),
  37441. length: e - r
  37442. }
  37443. }
  37444. ,
  37445. a.writeIString = function(e, i) {
  37446. var n = "undefined" == typeof i;
  37447. if (n && (i = this.offset),
  37448. !this.noAssert) {
  37449. if ("string" != typeof e)
  37450. throw TypeError("Illegal str: Not a string");
  37451. if ("number" != typeof i || i % 1 !== 0)
  37452. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37453. if (i >>>= 0,
  37454. i < 0 || i + 0 > this.buffer.byteLength)
  37455. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37456. }
  37457. var r, o = i;
  37458. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37459. i += 4 + r;
  37460. var a = this.buffer.byteLength;
  37461. if (i > a && this.resize((a *= 2) > i ? a : i),
  37462. i -= 4 + r,
  37463. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37464. this.view[i + 2] = r >>> 16 & 255,
  37465. this.view[i + 1] = r >>> 8 & 255,
  37466. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37467. this.view[i + 1] = r >>> 16 & 255,
  37468. this.view[i + 2] = r >>> 8 & 255,
  37469. this.view[i + 3] = 255 & r),
  37470. i += 4,
  37471. h.encodeUTF16toUTF8(t(e), function(e) {
  37472. this.view[i++] = e
  37473. }
  37474. .bind(this)),
  37475. i !== o + 4 + r)
  37476. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37477. return n ? (this.offset = i,
  37478. this) : i - o
  37479. }
  37480. ,
  37481. a.readIString = function(e) {
  37482. var t = "undefined" == typeof e;
  37483. if (t && (e = this.offset),
  37484. !this.noAssert) {
  37485. if ("number" != typeof e || e % 1 !== 0)
  37486. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37487. if (e >>>= 0,
  37488. e < 0 || e + 4 > this.buffer.byteLength)
  37489. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37490. }
  37491. var i = e
  37492. , n = this.readUint32(e)
  37493. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37494. return e += r.length,
  37495. t ? (this.offset = e,
  37496. r.string) : {
  37497. string: r.string,
  37498. length: e - i
  37499. }
  37500. }
  37501. ,
  37502. o.METRICS_CHARS = "c",
  37503. o.METRICS_BYTES = "b",
  37504. a.writeUTF8String = function(e, i) {
  37505. var n = "undefined" == typeof i;
  37506. if (n && (i = this.offset),
  37507. !this.noAssert) {
  37508. if ("number" != typeof i || i % 1 !== 0)
  37509. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37510. if (i >>>= 0,
  37511. i < 0 || i + 0 > this.buffer.byteLength)
  37512. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37513. }
  37514. var r, o = i;
  37515. r = h.calculateUTF16asUTF8(t(e))[1],
  37516. i += r;
  37517. var a = this.buffer.byteLength;
  37518. return i > a && this.resize((a *= 2) > i ? a : i),
  37519. i -= r,
  37520. h.encodeUTF16toUTF8(t(e), function(e) {
  37521. this.view[i++] = e
  37522. }
  37523. .bind(this)),
  37524. n ? (this.offset = i,
  37525. this) : i - o
  37526. }
  37527. ,
  37528. a.writeString = a.writeUTF8String,
  37529. o.calculateUTF8Chars = function(e) {
  37530. return h.calculateUTF16asUTF8(t(e))[0]
  37531. }
  37532. ,
  37533. o.calculateUTF8Bytes = function(e) {
  37534. return h.calculateUTF16asUTF8(t(e))[1]
  37535. }
  37536. ,
  37537. o.calculateString = o.calculateUTF8Bytes,
  37538. a.readUTF8String = function(e, t, n) {
  37539. "number" == typeof t && (n = t,
  37540. t = void 0);
  37541. var r = "undefined" == typeof n;
  37542. if (r && (n = this.offset),
  37543. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37544. !this.noAssert) {
  37545. if ("number" != typeof e || e % 1 !== 0)
  37546. throw TypeError("Illegal length: " + e + " (not an integer)");
  37547. if (e |= 0,
  37548. "number" != typeof n || n % 1 !== 0)
  37549. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37550. if (n >>>= 0,
  37551. n < 0 || n + 0 > this.buffer.byteLength)
  37552. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37553. }
  37554. var a, s = 0, l = n;
  37555. if (t === o.METRICS_CHARS) {
  37556. if (a = i(),
  37557. h.decodeUTF8(function() {
  37558. return s < e && n < this.limit ? this.view[n++] : null
  37559. }
  37560. .bind(this), function(e) {
  37561. ++s,
  37562. h.UTF8toUTF16(e, a)
  37563. }),
  37564. s !== e)
  37565. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37566. return r ? (this.offset = n,
  37567. a()) : {
  37568. string: a(),
  37569. length: n - l
  37570. }
  37571. }
  37572. if (t === o.METRICS_BYTES) {
  37573. if (!this.noAssert) {
  37574. if ("number" != typeof n || n % 1 !== 0)
  37575. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37576. if (n >>>= 0,
  37577. n < 0 || n + e > this.buffer.byteLength)
  37578. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37579. }
  37580. var c = n + e;
  37581. if (h.decodeUTF8toUTF16(function() {
  37582. return n < c ? this.view[n++] : null
  37583. }
  37584. .bind(this), a = i(), this.noAssert),
  37585. n !== c)
  37586. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37587. return r ? (this.offset = n,
  37588. a()) : {
  37589. string: a(),
  37590. length: n - l
  37591. }
  37592. }
  37593. throw TypeError("Unsupported metrics: " + t)
  37594. }
  37595. ,
  37596. a.readString = a.readUTF8String,
  37597. a.writeVString = function(e, i) {
  37598. var n = "undefined" == typeof i;
  37599. if (n && (i = this.offset),
  37600. !this.noAssert) {
  37601. if ("string" != typeof e)
  37602. throw TypeError("Illegal str: Not a string");
  37603. if ("number" != typeof i || i % 1 !== 0)
  37604. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37605. if (i >>>= 0,
  37606. i < 0 || i + 0 > this.buffer.byteLength)
  37607. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37608. }
  37609. var r, a, s = i;
  37610. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37611. a = o.calculateVarint32(r),
  37612. i += a + r;
  37613. var l = this.buffer.byteLength;
  37614. if (i > l && this.resize((l *= 2) > i ? l : i),
  37615. i -= a + r,
  37616. i += this.writeVarint32(r, i),
  37617. h.encodeUTF16toUTF8(t(e), function(e) {
  37618. this.view[i++] = e
  37619. }
  37620. .bind(this)),
  37621. i !== s + r + a)
  37622. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37623. return n ? (this.offset = i,
  37624. this) : i - s
  37625. }
  37626. ,
  37627. a.readVString = function(e) {
  37628. var t = "undefined" == typeof e;
  37629. if (t && (e = this.offset),
  37630. !this.noAssert) {
  37631. if ("number" != typeof e || e % 1 !== 0)
  37632. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37633. if (e >>>= 0,
  37634. e < 0 || e + 1 > this.buffer.byteLength)
  37635. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37636. }
  37637. var i = e
  37638. , n = this.readVarint32(e)
  37639. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37640. return e += r.length,
  37641. t ? (this.offset = e,
  37642. r.string) : {
  37643. string: r.string,
  37644. length: e - i
  37645. }
  37646. }
  37647. ,
  37648. a.append = function(e, t, i) {
  37649. "number" != typeof t && "string" == typeof t || (i = t,
  37650. t = void 0);
  37651. var n = "undefined" == typeof i;
  37652. if (n && (i = this.offset),
  37653. !this.noAssert) {
  37654. if ("number" != typeof i || i % 1 !== 0)
  37655. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37656. if (i >>>= 0,
  37657. i < 0 || i + 0 > this.buffer.byteLength)
  37658. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37659. }
  37660. e instanceof o || (e = o.wrap(e, t));
  37661. var r = e.limit - e.offset;
  37662. if (r <= 0)
  37663. return this;
  37664. i += r;
  37665. var a = this.buffer.byteLength;
  37666. return i > a && this.resize((a *= 2) > i ? a : i),
  37667. i -= r,
  37668. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37669. e.offset += r,
  37670. n && (this.offset += r),
  37671. this
  37672. }
  37673. ,
  37674. a.appendTo = function(e, t) {
  37675. return e.append(this, t),
  37676. this
  37677. }
  37678. ,
  37679. a.assert = function(e) {
  37680. return this.noAssert = !e,
  37681. this
  37682. }
  37683. ,
  37684. a.capacity = function() {
  37685. return this.buffer.byteLength
  37686. }
  37687. ,
  37688. a.clear = function() {
  37689. return this.offset = 0,
  37690. this.limit = this.buffer.byteLength,
  37691. this.markedOffset = -1,
  37692. this
  37693. }
  37694. ,
  37695. a.clone = function(e) {
  37696. var t = new o(0,this.littleEndian,this.noAssert);
  37697. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37698. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37699. t.view = this.view),
  37700. t.offset = this.offset,
  37701. t.markedOffset = this.markedOffset,
  37702. t.limit = this.limit,
  37703. t
  37704. }
  37705. ,
  37706. a.compact = function(e, t) {
  37707. if ("undefined" == typeof e && (e = this.offset),
  37708. "undefined" == typeof t && (t = this.limit),
  37709. !this.noAssert) {
  37710. if ("number" != typeof e || e % 1 !== 0)
  37711. throw TypeError("Illegal begin: Not an integer");
  37712. if (e >>>= 0,
  37713. "number" != typeof t || t % 1 !== 0)
  37714. throw TypeError("Illegal end: Not an integer");
  37715. if (t >>>= 0,
  37716. e < 0 || e > t || t > this.buffer.byteLength)
  37717. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37718. }
  37719. if (0 === e && t === this.buffer.byteLength)
  37720. return this;
  37721. var i = t - e;
  37722. if (0 === i)
  37723. return this.buffer = s,
  37724. this.view = null,
  37725. this.markedOffset >= 0 && (this.markedOffset -= e),
  37726. this.offset = 0,
  37727. this.limit = 0,
  37728. this;
  37729. var n = new ArrayBuffer(i)
  37730. , r = new Uint8Array(n);
  37731. return r.set(this.view.subarray(e, t)),
  37732. this.buffer = n,
  37733. this.view = r,
  37734. this.markedOffset >= 0 && (this.markedOffset -= e),
  37735. this.offset = 0,
  37736. this.limit = i,
  37737. this
  37738. }
  37739. ,
  37740. a.copy = function(e, t) {
  37741. if ("undefined" == typeof e && (e = this.offset),
  37742. "undefined" == typeof t && (t = this.limit),
  37743. !this.noAssert) {
  37744. if ("number" != typeof e || e % 1 !== 0)
  37745. throw TypeError("Illegal begin: Not an integer");
  37746. if (e >>>= 0,
  37747. "number" != typeof t || t % 1 !== 0)
  37748. throw TypeError("Illegal end: Not an integer");
  37749. if (t >>>= 0,
  37750. e < 0 || e > t || t > this.buffer.byteLength)
  37751. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37752. }
  37753. if (e === t)
  37754. return new o(0,this.littleEndian,this.noAssert);
  37755. var i = t - e
  37756. , n = new o(i,this.littleEndian,this.noAssert);
  37757. return n.offset = 0,
  37758. n.limit = i,
  37759. n.markedOffset >= 0 && (n.markedOffset -= e),
  37760. this.copyTo(n, 0, e, t),
  37761. n
  37762. }
  37763. ,
  37764. a.copyTo = function(e, t, i, n) {
  37765. var r, a;
  37766. if (!this.noAssert && !o.isByteBuffer(e))
  37767. throw TypeError("Illegal target: Not a ByteBuffer");
  37768. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37769. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37770. n = "undefined" == typeof n ? this.limit : 0 | n,
  37771. t < 0 || t > e.buffer.byteLength)
  37772. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37773. if (i < 0 || n > this.buffer.byteLength)
  37774. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37775. var s = n - i;
  37776. return 0 === s ? e : (e.ensureCapacity(t + s),
  37777. e.view.set(this.view.subarray(i, n), t),
  37778. r && (this.offset += s),
  37779. a && (e.offset += s),
  37780. this)
  37781. }
  37782. ,
  37783. a.ensureCapacity = function(e) {
  37784. var t = this.buffer.byteLength;
  37785. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  37786. }
  37787. ,
  37788. a.fill = function(e, t, i) {
  37789. var n = "undefined" == typeof t;
  37790. if (n && (t = this.offset),
  37791. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  37792. "undefined" == typeof t && (t = this.offset),
  37793. "undefined" == typeof i && (i = this.limit),
  37794. !this.noAssert) {
  37795. if ("number" != typeof e || e % 1 !== 0)
  37796. throw TypeError("Illegal value: " + e + " (not an integer)");
  37797. if (e |= 0,
  37798. "number" != typeof t || t % 1 !== 0)
  37799. throw TypeError("Illegal begin: Not an integer");
  37800. if (t >>>= 0,
  37801. "number" != typeof i || i % 1 !== 0)
  37802. throw TypeError("Illegal end: Not an integer");
  37803. if (i >>>= 0,
  37804. t < 0 || t > i || i > this.buffer.byteLength)
  37805. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37806. }
  37807. if (t >= i)
  37808. return this;
  37809. for (; t < i; )
  37810. this.view[t++] = e;
  37811. return n && (this.offset = t),
  37812. this
  37813. }
  37814. ,
  37815. a.flip = function() {
  37816. return this.limit = this.offset,
  37817. this.offset = 0,
  37818. this
  37819. }
  37820. ,
  37821. a.mark = function(e) {
  37822. if (e = "undefined" == typeof e ? this.offset : e,
  37823. !this.noAssert) {
  37824. if ("number" != typeof e || e % 1 !== 0)
  37825. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37826. if (e >>>= 0,
  37827. e < 0 || e + 0 > this.buffer.byteLength)
  37828. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  37829. }
  37830. return this.markedOffset = e,
  37831. this
  37832. }
  37833. ,
  37834. a.order = function(e) {
  37835. if (!this.noAssert && "boolean" != typeof e)
  37836. throw TypeError("Illegal littleEndian: Not a boolean");
  37837. return this.littleEndian = !!e,
  37838. this
  37839. }
  37840. ,
  37841. a.LE = function(e) {
  37842. return this.littleEndian = "undefined" == typeof e || !!e,
  37843. this
  37844. }
  37845. ,
  37846. a.BE = function(e) {
  37847. return this.littleEndian = "undefined" != typeof e && !e,
  37848. this
  37849. }
  37850. ,
  37851. a.prepend = function(e, t, i) {
  37852. "number" != typeof t && "string" == typeof t || (i = t,
  37853. t = void 0);
  37854. var n = "undefined" == typeof i;
  37855. if (n && (i = this.offset),
  37856. !this.noAssert) {
  37857. if ("number" != typeof i || i % 1 !== 0)
  37858. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37859. if (i >>>= 0,
  37860. i < 0 || i + 0 > this.buffer.byteLength)
  37861. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37862. }
  37863. e instanceof o || (e = o.wrap(e, t));
  37864. var r = e.limit - e.offset;
  37865. if (r <= 0)
  37866. return this;
  37867. var a = r - i;
  37868. if (a > 0) {
  37869. var s = new ArrayBuffer(this.buffer.byteLength + a)
  37870. , l = new Uint8Array(s);
  37871. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  37872. this.buffer = s,
  37873. this.view = l,
  37874. this.offset += a,
  37875. this.markedOffset >= 0 && (this.markedOffset += a),
  37876. this.limit += a,
  37877. i += a
  37878. } else {
  37879. new Uint8Array(this.buffer)
  37880. }
  37881. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  37882. e.offset = e.limit,
  37883. n && (this.offset -= r),
  37884. this
  37885. }
  37886. ,
  37887. a.prependTo = function(e, t) {
  37888. return e.prepend(this, t),
  37889. this
  37890. }
  37891. ,
  37892. a.printDebug = function(e) {
  37893. "function" != typeof e && (e = console.log.bind(console)),
  37894. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  37895. }
  37896. ,
  37897. a.remaining = function() {
  37898. return this.limit - this.offset
  37899. }
  37900. ,
  37901. a.reset = function() {
  37902. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  37903. this.markedOffset = -1) : this.offset = 0,
  37904. this
  37905. }
  37906. ,
  37907. a.resize = function(e) {
  37908. if (!this.noAssert) {
  37909. if ("number" != typeof e || e % 1 !== 0)
  37910. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  37911. if (e |= 0,
  37912. e < 0)
  37913. throw RangeError("Illegal capacity: 0 <= " + e)
  37914. }
  37915. if (this.buffer.byteLength < e) {
  37916. var t = new ArrayBuffer(e)
  37917. , i = new Uint8Array(t);
  37918. i.set(this.view),
  37919. this.buffer = t,
  37920. this.view = i
  37921. }
  37922. return this
  37923. }
  37924. ,
  37925. a.reverse = function(e, t) {
  37926. if ("undefined" == typeof e && (e = this.offset),
  37927. "undefined" == typeof t && (t = this.limit),
  37928. !this.noAssert) {
  37929. if ("number" != typeof e || e % 1 !== 0)
  37930. throw TypeError("Illegal begin: Not an integer");
  37931. if (e >>>= 0,
  37932. "number" != typeof t || t % 1 !== 0)
  37933. throw TypeError("Illegal end: Not an integer");
  37934. if (t >>>= 0,
  37935. e < 0 || e > t || t > this.buffer.byteLength)
  37936. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37937. }
  37938. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  37939. this)
  37940. }
  37941. ,
  37942. a.skip = function(e) {
  37943. if (!this.noAssert) {
  37944. if ("number" != typeof e || e % 1 !== 0)
  37945. throw TypeError("Illegal length: " + e + " (not an integer)");
  37946. e |= 0
  37947. }
  37948. var t = this.offset + e;
  37949. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  37950. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  37951. return this.offset = t,
  37952. this
  37953. }
  37954. ,
  37955. a.slice = function(e, t) {
  37956. if ("undefined" == typeof e && (e = this.offset),
  37957. "undefined" == typeof t && (t = this.limit),
  37958. !this.noAssert) {
  37959. if ("number" != typeof e || e % 1 !== 0)
  37960. throw TypeError("Illegal begin: Not an integer");
  37961. if (e >>>= 0,
  37962. "number" != typeof t || t % 1 !== 0)
  37963. throw TypeError("Illegal end: Not an integer");
  37964. if (t >>>= 0,
  37965. e < 0 || e > t || t > this.buffer.byteLength)
  37966. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37967. }
  37968. var i = this.clone();
  37969. return i.offset = e,
  37970. i.limit = t,
  37971. i
  37972. }
  37973. ,
  37974. a.toBuffer = function(e) {
  37975. var t = this.offset
  37976. , i = this.limit;
  37977. if (!this.noAssert) {
  37978. if ("number" != typeof t || t % 1 !== 0)
  37979. throw TypeError("Illegal offset: Not an integer");
  37980. if (t >>>= 0,
  37981. "number" != typeof i || i % 1 !== 0)
  37982. throw TypeError("Illegal limit: Not an integer");
  37983. if (i >>>= 0,
  37984. t < 0 || t > i || i > this.buffer.byteLength)
  37985. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37986. }
  37987. if (!e && 0 === t && i === this.buffer.byteLength)
  37988. return this.buffer;
  37989. if (t === i)
  37990. return s;
  37991. var n = new ArrayBuffer(i - t);
  37992. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  37993. n
  37994. }
  37995. ,
  37996. a.toArrayBuffer = a.toBuffer,
  37997. a.toString = function(e, t, i) {
  37998. if ("undefined" == typeof e)
  37999. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38000. switch ("number" == typeof e && (e = "utf8",
  38001. t = e,
  38002. i = t),
  38003. e) {
  38004. case "utf8":
  38005. return this.toUTF8(t, i);
  38006. case "base64":
  38007. return this.toBase64(t, i);
  38008. case "hex":
  38009. return this.toHex(t, i);
  38010. case "binary":
  38011. return this.toBinary(t, i);
  38012. case "debug":
  38013. return this.toDebug();
  38014. case "columns":
  38015. return this.toColumns();
  38016. default:
  38017. throw Error("Unsupported encoding: " + e)
  38018. }
  38019. }
  38020. ;
  38021. var c = function() {
  38022. 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)
  38023. i[t[n]] = n;
  38024. return e.encode = function(e, i) {
  38025. for (var n, r; null !== (n = e()); )
  38026. i(t[n >> 2 & 63]),
  38027. r = (3 & n) << 4,
  38028. null !== (n = e()) ? (r |= n >> 4 & 15,
  38029. i(t[63 & (r | n >> 4 & 15)]),
  38030. r = (15 & n) << 2,
  38031. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38032. i(t[63 & n])) : (i(t[63 & r]),
  38033. i(61))) : (i(t[63 & r]),
  38034. i(61),
  38035. i(61))
  38036. }
  38037. ,
  38038. e.decode = function(e, t) {
  38039. function n(e) {
  38040. throw Error("Illegal character code: " + e)
  38041. }
  38042. for (var r, o, a; null !== (r = e()); )
  38043. if (o = i[r],
  38044. "undefined" == typeof o && n(r),
  38045. null !== (r = e()) && (a = i[r],
  38046. "undefined" == typeof a && n(r),
  38047. t(o << 2 >>> 0 | (48 & a) >> 4),
  38048. null !== (r = e()))) {
  38049. if (o = i[r],
  38050. "undefined" == typeof o) {
  38051. if (61 === r)
  38052. break;
  38053. n(r)
  38054. }
  38055. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38056. null !== (r = e())) {
  38057. if (a = i[r],
  38058. "undefined" == typeof a) {
  38059. if (61 === r)
  38060. break;
  38061. n(r)
  38062. }
  38063. t((3 & o) << 6 >>> 0 | a)
  38064. }
  38065. }
  38066. }
  38067. ,
  38068. e.test = function(e) {
  38069. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38070. }
  38071. ,
  38072. e
  38073. }();
  38074. a.toBase64 = function(e, t) {
  38075. if ("undefined" == typeof e && (e = this.offset),
  38076. "undefined" == typeof t && (t = this.limit),
  38077. e |= 0,
  38078. t |= 0,
  38079. e < 0 || t > this.capacity || e > t)
  38080. throw RangeError("begin, end");
  38081. var n;
  38082. return c.encode(function() {
  38083. return e < t ? this.view[e++] : null
  38084. }
  38085. .bind(this), n = i()),
  38086. n()
  38087. }
  38088. ,
  38089. o.fromBase64 = function(e, i) {
  38090. if ("string" != typeof e)
  38091. throw TypeError("str");
  38092. var n = new o(e.length / 4 * 3,i)
  38093. , r = 0;
  38094. return c.decode(t(e), function(e) {
  38095. n.view[r++] = e
  38096. }),
  38097. n.limit = r,
  38098. n
  38099. }
  38100. ,
  38101. o.btoa = function(e) {
  38102. return o.fromBinary(e).toBase64()
  38103. }
  38104. ,
  38105. o.atob = function(e) {
  38106. return o.fromBase64(e).toBinary()
  38107. }
  38108. ,
  38109. a.toBinary = function(e, t) {
  38110. if ("undefined" == typeof e && (e = this.offset),
  38111. "undefined" == typeof t && (t = this.limit),
  38112. e |= 0,
  38113. t |= 0,
  38114. e < 0 || t > this.capacity() || e > t)
  38115. throw RangeError("begin, end");
  38116. if (e === t)
  38117. return "";
  38118. for (var i = [], n = []; e < t; )
  38119. i.push(this.view[e++]),
  38120. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38121. i = []);
  38122. return n.join("") + String.fromCharCode.apply(String, i)
  38123. }
  38124. ,
  38125. o.fromBinary = function(e, t) {
  38126. if ("string" != typeof e)
  38127. throw TypeError("str");
  38128. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38129. if (i = e.charCodeAt(n),
  38130. i > 255)
  38131. throw RangeError("illegal char code: " + i);
  38132. a.view[n++] = i
  38133. }
  38134. return a.limit = r,
  38135. a
  38136. }
  38137. ,
  38138. a.toDebug = function(e) {
  38139. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38140. if (i !== -1 && (t = this.view[i],
  38141. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38142. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38143. ++i,
  38144. e && i > 0 && i % 16 === 0 && i !== n) {
  38145. for (; r.length < 51; )
  38146. r += " ";
  38147. a += r + o + "\n",
  38148. r = o = ""
  38149. }
  38150. 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 ? " " : ""
  38151. }
  38152. if (e && " " !== r) {
  38153. for (; r.length < 51; )
  38154. r += " ";
  38155. a += r + o + "\n"
  38156. }
  38157. return e ? a : r
  38158. }
  38159. ,
  38160. o.fromDebug = function(e, t, i) {
  38161. 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; ) {
  38162. switch (n = e.charAt(l++)) {
  38163. case "!":
  38164. if (!i) {
  38165. if (u || d || p) {
  38166. f = !0;
  38167. break
  38168. }
  38169. u = d = p = !0
  38170. }
  38171. s.offset = s.markedOffset = s.limit = c,
  38172. h = !1;
  38173. break;
  38174. case "|":
  38175. if (!i) {
  38176. if (u || p) {
  38177. f = !0;
  38178. break
  38179. }
  38180. u = p = !0
  38181. }
  38182. s.offset = s.limit = c,
  38183. h = !1;
  38184. break;
  38185. case "[":
  38186. if (!i) {
  38187. if (u || d) {
  38188. f = !0;
  38189. break
  38190. }
  38191. u = d = !0
  38192. }
  38193. s.offset = s.markedOffset = c,
  38194. h = !1;
  38195. break;
  38196. case "<":
  38197. if (!i) {
  38198. if (u) {
  38199. f = !0;
  38200. break
  38201. }
  38202. u = !0
  38203. }
  38204. s.offset = c,
  38205. h = !1;
  38206. break;
  38207. case "]":
  38208. if (!i) {
  38209. if (p || d) {
  38210. f = !0;
  38211. break
  38212. }
  38213. p = d = !0
  38214. }
  38215. s.limit = s.markedOffset = c,
  38216. h = !1;
  38217. break;
  38218. case ">":
  38219. if (!i) {
  38220. if (p) {
  38221. f = !0;
  38222. break
  38223. }
  38224. p = !0
  38225. }
  38226. s.limit = c,
  38227. h = !1;
  38228. break;
  38229. case "'":
  38230. if (!i) {
  38231. if (d) {
  38232. f = !0;
  38233. break
  38234. }
  38235. d = !0
  38236. }
  38237. s.markedOffset = c,
  38238. h = !1;
  38239. break;
  38240. case " ":
  38241. h = !1;
  38242. break;
  38243. default:
  38244. if (!i && h) {
  38245. f = !0;
  38246. break
  38247. }
  38248. if (r = parseInt(n + e.charAt(l++), 16),
  38249. !i && (isNaN(r) || r < 0 || r > 255))
  38250. throw TypeError("Illegal str: Not a debug encoded string");
  38251. s.view[c++] = r,
  38252. h = !0
  38253. }
  38254. if (f)
  38255. throw TypeError("Illegal str: Invalid symbol at " + l)
  38256. }
  38257. if (!i) {
  38258. if (!u || !p)
  38259. throw TypeError("Illegal str: Missing offset or limit");
  38260. if (c < s.buffer.byteLength)
  38261. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38262. }
  38263. return s
  38264. }
  38265. ,
  38266. a.toHex = function(e, t) {
  38267. if (e = "undefined" == typeof e ? this.offset : e,
  38268. t = "undefined" == typeof t ? this.limit : t,
  38269. !this.noAssert) {
  38270. if ("number" != typeof e || e % 1 !== 0)
  38271. throw TypeError("Illegal begin: Not an integer");
  38272. if (e >>>= 0,
  38273. "number" != typeof t || t % 1 !== 0)
  38274. throw TypeError("Illegal end: Not an integer");
  38275. if (t >>>= 0,
  38276. e < 0 || e > t || t > this.buffer.byteLength)
  38277. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38278. }
  38279. for (var i, n = new Array(t - e); e < t; )
  38280. i = this.view[e++],
  38281. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38282. return n.join("")
  38283. }
  38284. ,
  38285. o.fromHex = function(e, t, i) {
  38286. if (!i) {
  38287. if ("string" != typeof e)
  38288. throw TypeError("Illegal str: Not a string");
  38289. if (e.length % 2 !== 0)
  38290. throw TypeError("Illegal str: Length not a multiple of 2")
  38291. }
  38292. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38293. if (n = parseInt(e.substring(s, s + 2), 16),
  38294. !i && (!isFinite(n) || n < 0 || n > 255))
  38295. throw TypeError("Illegal str: Contains non-hex characters");
  38296. a.view[l++] = n
  38297. }
  38298. return a.limit = l,
  38299. a
  38300. }
  38301. ;
  38302. var h = function() {
  38303. var e = {};
  38304. return e.MAX_CODEPOINT = 1114111,
  38305. e.encodeUTF8 = function(e, t) {
  38306. var i = null;
  38307. for ("number" == typeof e && (i = e,
  38308. e = function() {
  38309. return null
  38310. }
  38311. ); null !== i || null !== (i = e()); )
  38312. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38313. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38314. t(i >> 6 & 63 | 128),
  38315. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38316. t(i >> 12 & 63 | 128),
  38317. t(i >> 6 & 63 | 128),
  38318. t(63 & i | 128)),
  38319. i = null
  38320. }
  38321. ,
  38322. e.decodeUTF8 = function(e, t) {
  38323. for (var i, n, r, o, a = function(e) {
  38324. e = e.slice(0, e.indexOf(null));
  38325. var t = Error(e.toString());
  38326. throw t.name = "TruncatedError",
  38327. t.bytes = e,
  38328. t
  38329. }; null !== (i = e()); )
  38330. if (0 === (128 & i))
  38331. t(i);
  38332. else if (192 === (224 & i))
  38333. null === (n = e()) && a([i, n]),
  38334. t((31 & i) << 6 | 63 & n);
  38335. else if (224 === (240 & i))
  38336. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38337. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38338. else {
  38339. if (240 !== (248 & i))
  38340. throw RangeError("Illegal starting byte: " + i);
  38341. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38342. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38343. }
  38344. }
  38345. ,
  38346. e.UTF16toUTF8 = function(e, t) {
  38347. for (var i, n = null; ; ) {
  38348. if (null === (i = null !== n ? n : e()))
  38349. break;
  38350. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38351. n = null) : t(i)
  38352. }
  38353. null !== n && t(n)
  38354. }
  38355. ,
  38356. e.UTF8toUTF16 = function(e, t) {
  38357. var i = null;
  38358. for ("number" == typeof e && (i = e,
  38359. e = function() {
  38360. return null
  38361. }
  38362. ); null !== i || null !== (i = e()); )
  38363. i <= 65535 ? t(i) : (i -= 65536,
  38364. t((i >> 10) + 55296),
  38365. t(i % 1024 + 56320)),
  38366. i = null
  38367. }
  38368. ,
  38369. e.encodeUTF16toUTF8 = function(t, i) {
  38370. e.UTF16toUTF8(t, function(t) {
  38371. e.encodeUTF8(t, i)
  38372. })
  38373. }
  38374. ,
  38375. e.decodeUTF8toUTF16 = function(t, i) {
  38376. e.decodeUTF8(t, function(t) {
  38377. e.UTF8toUTF16(t, i)
  38378. })
  38379. }
  38380. ,
  38381. e.calculateCodePoint = function(e) {
  38382. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38383. }
  38384. ,
  38385. e.calculateUTF8 = function(e) {
  38386. for (var t, i = 0; null !== (t = e()); )
  38387. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38388. return i
  38389. }
  38390. ,
  38391. e.calculateUTF16asUTF8 = function(t) {
  38392. var i = 0
  38393. , n = 0;
  38394. return e.UTF16toUTF8(t, function(e) {
  38395. ++i,
  38396. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38397. }),
  38398. [i, n]
  38399. }
  38400. ,
  38401. e
  38402. }();
  38403. return a.toUTF8 = function(e, t) {
  38404. if ("undefined" == typeof e && (e = this.offset),
  38405. "undefined" == typeof t && (t = this.limit),
  38406. !this.noAssert) {
  38407. if ("number" != typeof e || e % 1 !== 0)
  38408. throw TypeError("Illegal begin: Not an integer");
  38409. if (e >>>= 0,
  38410. "number" != typeof t || t % 1 !== 0)
  38411. throw TypeError("Illegal end: Not an integer");
  38412. if (t >>>= 0,
  38413. e < 0 || e > t || t > this.buffer.byteLength)
  38414. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38415. }
  38416. var n;
  38417. try {
  38418. h.decodeUTF8toUTF16(function() {
  38419. return e < t ? this.view[e++] : null
  38420. }
  38421. .bind(this), n = i())
  38422. } catch (i) {
  38423. if (e !== t)
  38424. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38425. }
  38426. return n()
  38427. }
  38428. ,
  38429. o.fromUTF8 = function(e, i, n) {
  38430. if (!n && "string" != typeof e)
  38431. throw TypeError("Illegal str: Not a string");
  38432. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38433. , a = 0;
  38434. return h.encodeUTF16toUTF8(t(e), function(e) {
  38435. r.view[a++] = e
  38436. }),
  38437. r.limit = a,
  38438. r
  38439. }
  38440. ,
  38441. o
  38442. })
  38443. }
  38444. , {
  38445. long: 216
  38446. }],
  38447. 216: [function(e, t, i) {
  38448. !function(i, n) {
  38449. "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()
  38450. }(this, function() {
  38451. "use strict";
  38452. function e(e, t, i) {
  38453. this.low = 0 | e,
  38454. this.high = 0 | t,
  38455. this.unsigned = !!i
  38456. }
  38457. function t(e) {
  38458. return (e && e.__isLong__) === !0
  38459. }
  38460. function i(e, t) {
  38461. var i, n, o;
  38462. return t ? (e >>>= 0,
  38463. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38464. o && (l[e] = i),
  38465. i)) : (e |= 0,
  38466. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38467. o && (s[e] = i),
  38468. i))
  38469. }
  38470. function n(e, t) {
  38471. if (isNaN(e) || !isFinite(e))
  38472. return t ? m : g;
  38473. if (t) {
  38474. if (e < 0)
  38475. return m;
  38476. if (e >= d)
  38477. return I
  38478. } else {
  38479. if (e <= -p)
  38480. return E;
  38481. if (e + 1 >= p)
  38482. return C
  38483. }
  38484. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38485. }
  38486. function r(t, i, n) {
  38487. return new e(t,i,n)
  38488. }
  38489. function o(e, t, i) {
  38490. if (0 === e.length)
  38491. throw Error("empty string");
  38492. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38493. return g;
  38494. if ("number" == typeof t ? (i = t,
  38495. t = !1) : t = !!t,
  38496. i = i || 10,
  38497. i < 2 || 36 < i)
  38498. throw RangeError("radix");
  38499. var r;
  38500. if ((r = e.indexOf("-")) > 0)
  38501. throw Error("interior hyphen");
  38502. if (0 === r)
  38503. return o(e.substring(1), t, i).neg();
  38504. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38505. var h = Math.min(8, e.length - l)
  38506. , u = parseInt(e.substring(l, l + h), i);
  38507. if (h < 8) {
  38508. var d = n(c(i, h));
  38509. s = s.mul(d).add(n(u))
  38510. } else
  38511. s = s.mul(a),
  38512. s = s.add(n(u))
  38513. }
  38514. return s.unsigned = t,
  38515. s
  38516. }
  38517. function a(t) {
  38518. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38519. }
  38520. e.prototype.__isLong__,
  38521. Object.defineProperty(e.prototype, "__isLong__", {
  38522. value: !0,
  38523. enumerable: !1,
  38524. configurable: !1
  38525. }),
  38526. e.isLong = t;
  38527. var s = {}
  38528. , l = {};
  38529. e.fromInt = i,
  38530. e.fromNumber = n,
  38531. e.fromBits = r;
  38532. var c = Math.pow;
  38533. e.fromString = o,
  38534. e.fromValue = a;
  38535. var h = 1 << 24
  38536. , u = 4294967296
  38537. , d = 0x10000000000000000
  38538. , p = d / 2
  38539. , f = i(h)
  38540. , g = i(0);
  38541. e.ZERO = g;
  38542. var m = i(0, !0);
  38543. e.UZERO = m;
  38544. var v = i(1);
  38545. e.ONE = v;
  38546. var A = i(1, !0);
  38547. e.UONE = A;
  38548. var y = i(-1);
  38549. e.NEG_ONE = y;
  38550. var C = r(-1, 2147483647, !1);
  38551. e.MAX_VALUE = C;
  38552. var I = r(-1, -1, !0);
  38553. e.MAX_UNSIGNED_VALUE = I;
  38554. var E = r(0, -2147483648, !1);
  38555. e.MIN_VALUE = E;
  38556. var b = e.prototype;
  38557. return b.toInt = function() {
  38558. return this.unsigned ? this.low >>> 0 : this.low
  38559. }
  38560. ,
  38561. b.toNumber = function() {
  38562. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38563. }
  38564. ,
  38565. b.toString = function(e) {
  38566. if (e = e || 10,
  38567. e < 2 || 36 < e)
  38568. throw RangeError("radix");
  38569. if (this.isZero())
  38570. return "0";
  38571. if (this.isNegative()) {
  38572. if (this.eq(E)) {
  38573. var t = n(e)
  38574. , i = this.div(t)
  38575. , r = i.mul(t).sub(this);
  38576. return i.toString(e) + r.toInt().toString(e)
  38577. }
  38578. return "-" + this.neg().toString(e)
  38579. }
  38580. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38581. var l = a.div(o)
  38582. , h = a.sub(l.mul(o)).toInt() >>> 0
  38583. , u = h.toString(e);
  38584. if (a = l,
  38585. a.isZero())
  38586. return u + s;
  38587. for (; u.length < 6; )
  38588. u = "0" + u;
  38589. s = "" + u + s
  38590. }
  38591. }
  38592. ,
  38593. b.getHighBits = function() {
  38594. return this.high
  38595. }
  38596. ,
  38597. b.getHighBitsUnsigned = function() {
  38598. return this.high >>> 0
  38599. }
  38600. ,
  38601. b.getLowBits = function() {
  38602. return this.low
  38603. }
  38604. ,
  38605. b.getLowBitsUnsigned = function() {
  38606. return this.low >>> 0
  38607. }
  38608. ,
  38609. b.getNumBitsAbs = function() {
  38610. if (this.isNegative())
  38611. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38612. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38613. ;
  38614. return 0 != this.high ? t + 33 : t + 1
  38615. }
  38616. ,
  38617. b.isZero = function() {
  38618. return 0 === this.high && 0 === this.low
  38619. }
  38620. ,
  38621. b.isNegative = function() {
  38622. return !this.unsigned && this.high < 0
  38623. }
  38624. ,
  38625. b.isPositive = function() {
  38626. return this.unsigned || this.high >= 0
  38627. }
  38628. ,
  38629. b.isOdd = function() {
  38630. return 1 === (1 & this.low)
  38631. }
  38632. ,
  38633. b.isEven = function() {
  38634. return 0 === (1 & this.low)
  38635. }
  38636. ,
  38637. b.equals = function(e) {
  38638. return t(e) || (e = a(e)),
  38639. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38640. }
  38641. ,
  38642. b.eq = b.equals,
  38643. b.notEquals = function(e) {
  38644. return !this.eq(e)
  38645. }
  38646. ,
  38647. b.neq = b.notEquals,
  38648. b.lessThan = function(e) {
  38649. return this.comp(e) < 0
  38650. }
  38651. ,
  38652. b.lt = b.lessThan,
  38653. b.lessThanOrEqual = function(e) {
  38654. return this.comp(e) <= 0
  38655. }
  38656. ,
  38657. b.lte = b.lessThanOrEqual,
  38658. b.greaterThan = function(e) {
  38659. return this.comp(e) > 0
  38660. }
  38661. ,
  38662. b.gt = b.greaterThan,
  38663. b.greaterThanOrEqual = function(e) {
  38664. return this.comp(e) >= 0
  38665. }
  38666. ,
  38667. b.gte = b.greaterThanOrEqual,
  38668. b.compare = function(e) {
  38669. if (t(e) || (e = a(e)),
  38670. this.eq(e))
  38671. return 0;
  38672. var i = this.isNegative()
  38673. , n = e.isNegative();
  38674. 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
  38675. }
  38676. ,
  38677. b.comp = b.compare,
  38678. b.negate = function() {
  38679. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38680. }
  38681. ,
  38682. b.neg = b.negate,
  38683. b.add = function(e) {
  38684. t(e) || (e = a(e));
  38685. var i = this.high >>> 16
  38686. , n = 65535 & this.high
  38687. , o = this.low >>> 16
  38688. , s = 65535 & this.low
  38689. , l = e.high >>> 16
  38690. , c = 65535 & e.high
  38691. , h = e.low >>> 16
  38692. , u = 65535 & e.low
  38693. , d = 0
  38694. , p = 0
  38695. , f = 0
  38696. , g = 0;
  38697. return g += s + u,
  38698. f += g >>> 16,
  38699. g &= 65535,
  38700. f += o + h,
  38701. p += f >>> 16,
  38702. f &= 65535,
  38703. p += n + c,
  38704. d += p >>> 16,
  38705. p &= 65535,
  38706. d += i + l,
  38707. d &= 65535,
  38708. r(f << 16 | g, d << 16 | p, this.unsigned)
  38709. }
  38710. ,
  38711. b.subtract = function(e) {
  38712. return t(e) || (e = a(e)),
  38713. this.add(e.neg())
  38714. }
  38715. ,
  38716. b.sub = b.subtract,
  38717. b.multiply = function(e) {
  38718. if (this.isZero())
  38719. return g;
  38720. if (t(e) || (e = a(e)),
  38721. e.isZero())
  38722. return g;
  38723. if (this.eq(E))
  38724. return e.isOdd() ? E : g;
  38725. if (e.eq(E))
  38726. return this.isOdd() ? E : g;
  38727. if (this.isNegative())
  38728. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38729. if (e.isNegative())
  38730. return this.mul(e.neg()).neg();
  38731. if (this.lt(f) && e.lt(f))
  38732. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38733. var i = this.high >>> 16
  38734. , o = 65535 & this.high
  38735. , s = this.low >>> 16
  38736. , l = 65535 & this.low
  38737. , c = e.high >>> 16
  38738. , h = 65535 & e.high
  38739. , u = e.low >>> 16
  38740. , d = 65535 & e.low
  38741. , p = 0
  38742. , m = 0
  38743. , v = 0
  38744. , A = 0;
  38745. return A += l * d,
  38746. v += A >>> 16,
  38747. A &= 65535,
  38748. v += s * d,
  38749. m += v >>> 16,
  38750. v &= 65535,
  38751. v += l * u,
  38752. m += v >>> 16,
  38753. v &= 65535,
  38754. m += o * d,
  38755. p += m >>> 16,
  38756. m &= 65535,
  38757. m += s * u,
  38758. p += m >>> 16,
  38759. m &= 65535,
  38760. m += l * h,
  38761. p += m >>> 16,
  38762. m &= 65535,
  38763. p += i * d + o * u + s * h + l * c,
  38764. p &= 65535,
  38765. r(v << 16 | A, p << 16 | m, this.unsigned)
  38766. }
  38767. ,
  38768. b.mul = b.multiply,
  38769. b.divide = function(e) {
  38770. if (t(e) || (e = a(e)),
  38771. e.isZero())
  38772. throw Error("division by zero");
  38773. if (this.isZero())
  38774. return this.unsigned ? m : g;
  38775. var i, r, o;
  38776. if (this.unsigned) {
  38777. if (e.unsigned || (e = e.toUnsigned()),
  38778. e.gt(this))
  38779. return m;
  38780. if (e.gt(this.shru(1)))
  38781. return A;
  38782. o = m
  38783. } else {
  38784. if (this.eq(E)) {
  38785. if (e.eq(v) || e.eq(y))
  38786. return E;
  38787. if (e.eq(E))
  38788. return v;
  38789. var s = this.shr(1);
  38790. return i = s.div(e).shl(1),
  38791. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  38792. o = i.add(r.div(e)))
  38793. }
  38794. if (e.eq(E))
  38795. return this.unsigned ? m : g;
  38796. if (this.isNegative())
  38797. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  38798. if (e.isNegative())
  38799. return this.div(e.neg()).neg();
  38800. o = g
  38801. }
  38802. for (r = this; r.gte(e); ) {
  38803. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  38804. 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); )
  38805. i -= h,
  38806. u = n(i, this.unsigned),
  38807. d = u.mul(e);
  38808. u.isZero() && (u = v),
  38809. o = o.add(u),
  38810. r = r.sub(d)
  38811. }
  38812. return o
  38813. }
  38814. ,
  38815. b.div = b.divide,
  38816. b.modulo = function(e) {
  38817. return t(e) || (e = a(e)),
  38818. this.sub(this.div(e).mul(e))
  38819. }
  38820. ,
  38821. b.mod = b.modulo,
  38822. b.not = function() {
  38823. return r(~this.low, ~this.high, this.unsigned)
  38824. }
  38825. ,
  38826. b.and = function(e) {
  38827. return t(e) || (e = a(e)),
  38828. r(this.low & e.low, this.high & e.high, this.unsigned)
  38829. }
  38830. ,
  38831. b.or = function(e) {
  38832. return t(e) || (e = a(e)),
  38833. r(this.low | e.low, this.high | e.high, this.unsigned)
  38834. }
  38835. ,
  38836. b.xor = function(e) {
  38837. return t(e) || (e = a(e)),
  38838. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  38839. }
  38840. ,
  38841. b.shiftLeft = function(e) {
  38842. return t(e) && (e = e.toInt()),
  38843. 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)
  38844. }
  38845. ,
  38846. b.shl = b.shiftLeft,
  38847. b.shiftRight = function(e) {
  38848. return t(e) && (e = e.toInt()),
  38849. 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)
  38850. }
  38851. ,
  38852. b.shr = b.shiftRight,
  38853. b.shiftRightUnsigned = function(e) {
  38854. if (t(e) && (e = e.toInt()),
  38855. e &= 63,
  38856. 0 === e)
  38857. return this;
  38858. var i = this.high;
  38859. if (e < 32) {
  38860. var n = this.low;
  38861. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  38862. }
  38863. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  38864. }
  38865. ,
  38866. b.shru = b.shiftRightUnsigned,
  38867. b.toSigned = function() {
  38868. return this.unsigned ? r(this.low, this.high, !1) : this
  38869. }
  38870. ,
  38871. b.toUnsigned = function() {
  38872. return this.unsigned ? this : r(this.low, this.high, !0)
  38873. }
  38874. ,
  38875. b.toBytes = function(e) {
  38876. return e ? this.toBytesLE() : this.toBytesBE()
  38877. }
  38878. ,
  38879. b.toBytesLE = function() {
  38880. var e = this.high
  38881. , t = this.low;
  38882. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  38883. }
  38884. ,
  38885. b.toBytesBE = function() {
  38886. var e = this.high
  38887. , t = this.low;
  38888. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  38889. }
  38890. ,
  38891. e
  38892. })
  38893. }
  38894. , {}],
  38895. 217: [function(e, t, i) {
  38896. var n = {
  38897. REVISION: "75"
  38898. };
  38899. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  38900. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  38901. void 0 === Math.sign && (Math.sign = function(e) {
  38902. return e < 0 ? -1 : e > 0 ? 1 : +e
  38903. }
  38904. ),
  38905. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  38906. get: function() {
  38907. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  38908. }
  38909. }),
  38910. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  38911. writable: !0,
  38912. configurable: !0,
  38913. value: function(e) {
  38914. "use strict";
  38915. if (void 0 === e || null === e)
  38916. throw new TypeError("Cannot convert first argument to object");
  38917. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  38918. var r = arguments[i];
  38919. if (void 0 !== r && null !== r) {
  38920. r = Object(r);
  38921. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  38922. var l = o[a]
  38923. , c = Object.getOwnPropertyDescriptor(r, l);
  38924. void 0 !== c && c.enumerable && (t[l] = r[l])
  38925. }
  38926. }
  38927. }
  38928. return t
  38929. }
  38930. }),
  38931. n.MOUSE = {
  38932. LEFT: 0,
  38933. MIDDLE: 1,
  38934. RIGHT: 2
  38935. },
  38936. n.CullFaceNone = 0,
  38937. n.CullFaceBack = 1,
  38938. n.CullFaceFront = 2,
  38939. n.CullFaceFrontBack = 3,
  38940. n.FrontFaceDirectionCW = 0,
  38941. n.FrontFaceDirectionCCW = 1,
  38942. n.BasicShadowMap = 0,
  38943. n.PCFShadowMap = 1,
  38944. n.PCFSoftShadowMap = 2,
  38945. n.FrontSide = 0,
  38946. n.BackSide = 1,
  38947. n.DoubleSide = 2,
  38948. n.FlatShading = 1,
  38949. n.SmoothShading = 2,
  38950. n.NoColors = 0,
  38951. n.FaceColors = 1,
  38952. n.VertexColors = 2,
  38953. n.NoBlending = 0,
  38954. n.NormalBlending = 1,
  38955. n.AdditiveBlending = 2,
  38956. n.SubtractiveBlending = 3,
  38957. n.MultiplyBlending = 4,
  38958. n.CustomBlending = 5,
  38959. n.AddEquation = 100,
  38960. n.SubtractEquation = 101,
  38961. n.ReverseSubtractEquation = 102,
  38962. n.MinEquation = 103,
  38963. n.MaxEquation = 104,
  38964. n.ZeroFactor = 200,
  38965. n.OneFactor = 201,
  38966. n.SrcColorFactor = 202,
  38967. n.OneMinusSrcColorFactor = 203,
  38968. n.SrcAlphaFactor = 204,
  38969. n.OneMinusSrcAlphaFactor = 205,
  38970. n.DstAlphaFactor = 206,
  38971. n.OneMinusDstAlphaFactor = 207,
  38972. n.DstColorFactor = 208,
  38973. n.OneMinusDstColorFactor = 209,
  38974. n.SrcAlphaSaturateFactor = 210,
  38975. n.NeverDepth = 0,
  38976. n.AlwaysDepth = 1,
  38977. n.LessDepth = 2,
  38978. n.LessEqualDepth = 3,
  38979. n.EqualDepth = 4,
  38980. n.GreaterEqualDepth = 5,
  38981. n.GreaterDepth = 6,
  38982. n.NotEqualDepth = 7,
  38983. n.MultiplyOperation = 0,
  38984. n.MixOperation = 1,
  38985. n.AddOperation = 2,
  38986. n.NoToneMapping = 0,
  38987. n.LinearToneMapping = 1,
  38988. n.ReinhardToneMapping = 2,
  38989. n.Uncharted2ToneMapping = 3,
  38990. n.CineonToneMapping = 4,
  38991. n.UVMapping = 300,
  38992. n.CubeReflectionMapping = 301,
  38993. n.CubeRefractionMapping = 302,
  38994. n.EquirectangularReflectionMapping = 303,
  38995. n.EquirectangularRefractionMapping = 304,
  38996. n.SphericalReflectionMapping = 305,
  38997. n.CubeUVReflectionMapping = 306,
  38998. n.CubeUVRefractionMapping = 307,
  38999. n.RepeatWrapping = 1e3,
  39000. n.ClampToEdgeWrapping = 1001,
  39001. n.MirroredRepeatWrapping = 1002,
  39002. n.NearestFilter = 1003,
  39003. n.NearestMipMapNearestFilter = 1004,
  39004. n.NearestMipMapLinearFilter = 1005,
  39005. n.LinearFilter = 1006,
  39006. n.LinearMipMapNearestFilter = 1007,
  39007. n.LinearMipMapLinearFilter = 1008,
  39008. n.UnsignedByteType = 1009,
  39009. n.ByteType = 1010,
  39010. n.ShortType = 1011,
  39011. n.UnsignedShortType = 1012,
  39012. n.IntType = 1013,
  39013. n.UnsignedIntType = 1014,
  39014. n.FloatType = 1015,
  39015. n.HalfFloatType = 1025,
  39016. n.UnsignedShort4444Type = 1016,
  39017. n.UnsignedShort5551Type = 1017,
  39018. n.UnsignedShort565Type = 1018,
  39019. n.AlphaFormat = 1019,
  39020. n.RGBFormat = 1020,
  39021. n.RGBAFormat = 1021,
  39022. n.LuminanceFormat = 1022,
  39023. n.LuminanceAlphaFormat = 1023,
  39024. n.RGBEFormat = n.RGBAFormat,
  39025. n.RGB_S3TC_DXT1_Format = 2001,
  39026. n.RGBA_S3TC_DXT1_Format = 2002,
  39027. n.RGBA_S3TC_DXT3_Format = 2003,
  39028. n.RGBA_S3TC_DXT5_Format = 2004,
  39029. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39030. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39031. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39032. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39033. n.RGB_ETC1_Format = 2151,
  39034. n.LoopOnce = 2200,
  39035. n.LoopRepeat = 2201,
  39036. n.LoopPingPong = 2202,
  39037. n.InterpolateDiscrete = 2300,
  39038. n.InterpolateLinear = 2301,
  39039. n.InterpolateSmooth = 2302,
  39040. n.ZeroCurvatureEnding = 2400,
  39041. n.ZeroSlopeEnding = 2401,
  39042. n.WrapAroundEnding = 2402,
  39043. n.TrianglesDrawMode = 0,
  39044. n.TriangleStripDrawMode = 1,
  39045. n.TriangleFanDrawMode = 2,
  39046. n.LinearEncoding = 3e3,
  39047. n.sRGBEncoding = 3001,
  39048. n.GammaEncoding = 3007,
  39049. n.RGBEEncoding = 3002,
  39050. n.LogLuvEncoding = 3003,
  39051. n.RGBM7Encoding = 3004,
  39052. n.RGBM16Encoding = 3005,
  39053. n.RGBDEncoding = 3006,
  39054. n.Color = function(e) {
  39055. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39056. }
  39057. ,
  39058. n.Color.prototype = {
  39059. constructor: n.Color,
  39060. r: 1,
  39061. g: 1,
  39062. b: 1,
  39063. set: function(e) {
  39064. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39065. this
  39066. },
  39067. setScalar: function(e) {
  39068. this.r = e,
  39069. this.g = e,
  39070. this.b = e
  39071. },
  39072. setHex: function(e) {
  39073. return e = Math.floor(e),
  39074. this.r = (e >> 16 & 255) / 255,
  39075. this.g = (e >> 8 & 255) / 255,
  39076. this.b = (255 & e) / 255,
  39077. this
  39078. },
  39079. setRGB: function(e, t, i) {
  39080. return this.r = e,
  39081. this.g = t,
  39082. this.b = i,
  39083. this
  39084. },
  39085. setHSL: function() {
  39086. function e(e, t, i) {
  39087. return i < 0 && (i += 1),
  39088. i > 1 && (i -= 1),
  39089. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39090. }
  39091. return function(t, i, r) {
  39092. if (t = n.Math.euclideanModulo(t, 1),
  39093. i = n.Math.clamp(i, 0, 1),
  39094. r = n.Math.clamp(r, 0, 1),
  39095. 0 === i)
  39096. this.r = this.g = this.b = r;
  39097. else {
  39098. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39099. , a = 2 * r - o;
  39100. this.r = e(a, o, t + 1 / 3),
  39101. this.g = e(a, o, t),
  39102. this.b = e(a, o, t - 1 / 3)
  39103. }
  39104. return this
  39105. }
  39106. }(),
  39107. setStyle: function(e) {
  39108. function t(t) {
  39109. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39110. }
  39111. var i;
  39112. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39113. var r, o = i[1], a = i[2];
  39114. switch (o) {
  39115. case "rgb":
  39116. case "rgba":
  39117. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39118. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39119. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39120. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39121. t(r[5]),
  39122. this;
  39123. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39124. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39125. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39126. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39127. t(r[5]),
  39128. this;
  39129. break;
  39130. case "hsl":
  39131. case "hsla":
  39132. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39133. var s = parseFloat(r[1]) / 360
  39134. , l = parseInt(r[2], 10) / 100
  39135. , c = parseInt(r[3], 10) / 100;
  39136. return t(r[5]),
  39137. this.setHSL(s, l, c)
  39138. }
  39139. }
  39140. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39141. var h = i[1]
  39142. , u = h.length;
  39143. if (3 === u)
  39144. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39145. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39146. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39147. this;
  39148. if (6 === u)
  39149. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39150. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39151. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39152. this
  39153. }
  39154. if (e && e.length > 0) {
  39155. var h = n.ColorKeywords[e];
  39156. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39157. }
  39158. return this
  39159. },
  39160. clone: function() {
  39161. return new this.constructor(this.r,this.g,this.b)
  39162. },
  39163. copy: function(e) {
  39164. return this.r = e.r,
  39165. this.g = e.g,
  39166. this.b = e.b,
  39167. this
  39168. },
  39169. copyGammaToLinear: function(e, t) {
  39170. return void 0 === t && (t = 2),
  39171. this.r = Math.pow(e.r, t),
  39172. this.g = Math.pow(e.g, t),
  39173. this.b = Math.pow(e.b, t),
  39174. this
  39175. },
  39176. copyLinearToGamma: function(e, t) {
  39177. void 0 === t && (t = 2);
  39178. var i = t > 0 ? 1 / t : 1;
  39179. return this.r = Math.pow(e.r, i),
  39180. this.g = Math.pow(e.g, i),
  39181. this.b = Math.pow(e.b, i),
  39182. this
  39183. },
  39184. convertGammaToLinear: function() {
  39185. var e = this.r
  39186. , t = this.g
  39187. , i = this.b;
  39188. return this.r = e * e,
  39189. this.g = t * t,
  39190. this.b = i * i,
  39191. this
  39192. },
  39193. convertLinearToGamma: function() {
  39194. return this.r = Math.sqrt(this.r),
  39195. this.g = Math.sqrt(this.g),
  39196. this.b = Math.sqrt(this.b),
  39197. this
  39198. },
  39199. getHex: function() {
  39200. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39201. },
  39202. getHexString: function() {
  39203. return ("000000" + this.getHex().toString(16)).slice(-6)
  39204. },
  39205. getHSL: function(e) {
  39206. var t, i, n = e || {
  39207. h: 0,
  39208. s: 0,
  39209. l: 0
  39210. }, 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;
  39211. if (l === s)
  39212. t = 0,
  39213. i = 0;
  39214. else {
  39215. var h = s - l;
  39216. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39217. s) {
  39218. case r:
  39219. t = (o - a) / h + (o < a ? 6 : 0);
  39220. break;
  39221. case o:
  39222. t = (a - r) / h + 2;
  39223. break;
  39224. case a:
  39225. t = (r - o) / h + 4
  39226. }
  39227. t /= 6
  39228. }
  39229. return n.h = t,
  39230. n.s = i,
  39231. n.l = c,
  39232. n
  39233. },
  39234. getStyle: function() {
  39235. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39236. },
  39237. offsetHSL: function(e, t, i) {
  39238. var n = this.getHSL();
  39239. return n.h += e,
  39240. n.s += t,
  39241. n.l += i,
  39242. this.setHSL(n.h, n.s, n.l),
  39243. this
  39244. },
  39245. add: function(e) {
  39246. return this.r += e.r,
  39247. this.g += e.g,
  39248. this.b += e.b,
  39249. this
  39250. },
  39251. addColors: function(e, t) {
  39252. return this.r = e.r + t.r,
  39253. this.g = e.g + t.g,
  39254. this.b = e.b + t.b,
  39255. this
  39256. },
  39257. addScalar: function(e) {
  39258. return this.r += e,
  39259. this.g += e,
  39260. this.b += e,
  39261. this
  39262. },
  39263. multiply: function(e) {
  39264. return this.r *= e.r,
  39265. this.g *= e.g,
  39266. this.b *= e.b,
  39267. this
  39268. },
  39269. multiplyScalar: function(e) {
  39270. return this.r *= e,
  39271. this.g *= e,
  39272. this.b *= e,
  39273. this
  39274. },
  39275. lerp: function(e, t) {
  39276. return this.r += (e.r - this.r) * t,
  39277. this.g += (e.g - this.g) * t,
  39278. this.b += (e.b - this.b) * t,
  39279. this
  39280. },
  39281. equals: function(e) {
  39282. return e.r === this.r && e.g === this.g && e.b === this.b
  39283. },
  39284. fromArray: function(e, t) {
  39285. return void 0 === t && (t = 0),
  39286. this.r = e[t],
  39287. this.g = e[t + 1],
  39288. this.b = e[t + 2],
  39289. this
  39290. },
  39291. toArray: function(e, t) {
  39292. return void 0 === e && (e = []),
  39293. void 0 === t && (t = 0),
  39294. e[t] = this.r,
  39295. e[t + 1] = this.g,
  39296. e[t + 2] = this.b,
  39297. e
  39298. }
  39299. },
  39300. n.ColorKeywords = {
  39301. aliceblue: 15792383,
  39302. antiquewhite: 16444375,
  39303. aqua: 65535,
  39304. aquamarine: 8388564,
  39305. azure: 15794175,
  39306. beige: 16119260,
  39307. bisque: 16770244,
  39308. black: 0,
  39309. blanchedalmond: 16772045,
  39310. blue: 255,
  39311. blueviolet: 9055202,
  39312. brown: 10824234,
  39313. burlywood: 14596231,
  39314. cadetblue: 6266528,
  39315. chartreuse: 8388352,
  39316. chocolate: 13789470,
  39317. coral: 16744272,
  39318. cornflowerblue: 6591981,
  39319. cornsilk: 16775388,
  39320. crimson: 14423100,
  39321. cyan: 65535,
  39322. darkblue: 139,
  39323. darkcyan: 35723,
  39324. darkgoldenrod: 12092939,
  39325. darkgray: 11119017,
  39326. darkgreen: 25600,
  39327. darkgrey: 11119017,
  39328. darkkhaki: 12433259,
  39329. darkmagenta: 9109643,
  39330. darkolivegreen: 5597999,
  39331. darkorange: 16747520,
  39332. darkorchid: 10040012,
  39333. darkred: 9109504,
  39334. darksalmon: 15308410,
  39335. darkseagreen: 9419919,
  39336. darkslateblue: 4734347,
  39337. darkslategray: 3100495,
  39338. darkslategrey: 3100495,
  39339. darkturquoise: 52945,
  39340. darkviolet: 9699539,
  39341. deeppink: 16716947,
  39342. deepskyblue: 49151,
  39343. dimgray: 6908265,
  39344. dimgrey: 6908265,
  39345. dodgerblue: 2003199,
  39346. firebrick: 11674146,
  39347. floralwhite: 16775920,
  39348. forestgreen: 2263842,
  39349. fuchsia: 16711935,
  39350. gainsboro: 14474460,
  39351. ghostwhite: 16316671,
  39352. gold: 16766720,
  39353. goldenrod: 14329120,
  39354. gray: 8421504,
  39355. green: 32768,
  39356. greenyellow: 11403055,
  39357. grey: 8421504,
  39358. honeydew: 15794160,
  39359. hotpink: 16738740,
  39360. indianred: 13458524,
  39361. indigo: 4915330,
  39362. ivory: 16777200,
  39363. khaki: 15787660,
  39364. lavender: 15132410,
  39365. lavenderblush: 16773365,
  39366. lawngreen: 8190976,
  39367. lemonchiffon: 16775885,
  39368. lightblue: 11393254,
  39369. lightcoral: 15761536,
  39370. lightcyan: 14745599,
  39371. lightgoldenrodyellow: 16448210,
  39372. lightgray: 13882323,
  39373. lightgreen: 9498256,
  39374. lightgrey: 13882323,
  39375. lightpink: 16758465,
  39376. lightsalmon: 16752762,
  39377. lightseagreen: 2142890,
  39378. lightskyblue: 8900346,
  39379. lightslategray: 7833753,
  39380. lightslategrey: 7833753,
  39381. lightsteelblue: 11584734,
  39382. lightyellow: 16777184,
  39383. lime: 65280,
  39384. limegreen: 3329330,
  39385. linen: 16445670,
  39386. magenta: 16711935,
  39387. maroon: 8388608,
  39388. mediumaquamarine: 6737322,
  39389. mediumblue: 205,
  39390. mediumorchid: 12211667,
  39391. mediumpurple: 9662683,
  39392. mediumseagreen: 3978097,
  39393. mediumslateblue: 8087790,
  39394. mediumspringgreen: 64154,
  39395. mediumturquoise: 4772300,
  39396. mediumvioletred: 13047173,
  39397. midnightblue: 1644912,
  39398. mintcream: 16121850,
  39399. mistyrose: 16770273,
  39400. moccasin: 16770229,
  39401. navajowhite: 16768685,
  39402. navy: 128,
  39403. oldlace: 16643558,
  39404. olive: 8421376,
  39405. olivedrab: 7048739,
  39406. orange: 16753920,
  39407. orangered: 16729344,
  39408. orchid: 14315734,
  39409. palegoldenrod: 15657130,
  39410. palegreen: 10025880,
  39411. paleturquoise: 11529966,
  39412. palevioletred: 14381203,
  39413. papayawhip: 16773077,
  39414. peachpuff: 16767673,
  39415. peru: 13468991,
  39416. pink: 16761035,
  39417. plum: 14524637,
  39418. powderblue: 11591910,
  39419. purple: 8388736,
  39420. red: 16711680,
  39421. rosybrown: 12357519,
  39422. royalblue: 4286945,
  39423. saddlebrown: 9127187,
  39424. salmon: 16416882,
  39425. sandybrown: 16032864,
  39426. seagreen: 3050327,
  39427. seashell: 16774638,
  39428. sienna: 10506797,
  39429. silver: 12632256,
  39430. skyblue: 8900331,
  39431. slateblue: 6970061,
  39432. slategray: 7372944,
  39433. slategrey: 7372944,
  39434. snow: 16775930,
  39435. springgreen: 65407,
  39436. steelblue: 4620980,
  39437. tan: 13808780,
  39438. teal: 32896,
  39439. thistle: 14204888,
  39440. tomato: 16737095,
  39441. turquoise: 4251856,
  39442. violet: 15631086,
  39443. wheat: 16113331,
  39444. white: 16777215,
  39445. whitesmoke: 16119285,
  39446. yellow: 16776960,
  39447. yellowgreen: 10145074
  39448. },
  39449. n.Quaternion = function(e, t, i, n) {
  39450. this._x = e || 0,
  39451. this._y = t || 0,
  39452. this._z = i || 0,
  39453. this._w = void 0 !== n ? n : 1
  39454. }
  39455. ,
  39456. n.Quaternion.prototype = {
  39457. constructor: n.Quaternion,
  39458. get x() {
  39459. return this._x
  39460. },
  39461. set x(e) {
  39462. this._x = e,
  39463. this.onChangeCallback()
  39464. },
  39465. get y() {
  39466. return this._y
  39467. },
  39468. set y(e) {
  39469. this._y = e,
  39470. this.onChangeCallback()
  39471. },
  39472. get z() {
  39473. return this._z
  39474. },
  39475. set z(e) {
  39476. this._z = e,
  39477. this.onChangeCallback()
  39478. },
  39479. get w() {
  39480. return this._w
  39481. },
  39482. set w(e) {
  39483. this._w = e,
  39484. this.onChangeCallback()
  39485. },
  39486. set: function(e, t, i, n) {
  39487. return this._x = e,
  39488. this._y = t,
  39489. this._z = i,
  39490. this._w = n,
  39491. this.onChangeCallback(),
  39492. this
  39493. },
  39494. clone: function() {
  39495. return new this.constructor(this._x,this._y,this._z,this._w)
  39496. },
  39497. copy: function(e) {
  39498. return this._x = e.x,
  39499. this._y = e.y,
  39500. this._z = e.z,
  39501. this._w = e.w,
  39502. this.onChangeCallback(),
  39503. this
  39504. },
  39505. setFromEuler: function(e, t) {
  39506. if (e instanceof n.Euler == !1)
  39507. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39508. var i = Math.cos(e._x / 2)
  39509. , r = Math.cos(e._y / 2)
  39510. , o = Math.cos(e._z / 2)
  39511. , a = Math.sin(e._x / 2)
  39512. , s = Math.sin(e._y / 2)
  39513. , l = Math.sin(e._z / 2)
  39514. , c = e.order;
  39515. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39516. this._y = i * s * o - a * r * l,
  39517. this._z = i * r * l + a * s * o,
  39518. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39519. this._y = i * s * o - a * r * l,
  39520. this._z = i * r * l - a * s * o,
  39521. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39522. this._y = i * s * o + a * r * l,
  39523. this._z = i * r * l + a * s * o,
  39524. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39525. this._y = i * s * o + a * r * l,
  39526. this._z = i * r * l - a * s * o,
  39527. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39528. this._y = i * s * o + a * r * l,
  39529. this._z = i * r * l - a * s * o,
  39530. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39531. this._y = i * s * o - a * r * l,
  39532. this._z = i * r * l + a * s * o,
  39533. this._w = i * r * o + a * s * l),
  39534. t !== !1 && this.onChangeCallback(),
  39535. this
  39536. },
  39537. setFromAxisAngle: function(e, t) {
  39538. var i = t / 2
  39539. , n = Math.sin(i);
  39540. return this._x = e.x * n,
  39541. this._y = e.y * n,
  39542. this._z = e.z * n,
  39543. this._w = Math.cos(i),
  39544. this.onChangeCallback(),
  39545. this
  39546. },
  39547. setFromRotationMatrix: function(e) {
  39548. 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;
  39549. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39550. this._w = .25 / t,
  39551. this._x = (h - l) * t,
  39552. this._y = (o - c) * t,
  39553. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39554. this._w = (h - l) / t,
  39555. this._x = .25 * t,
  39556. this._y = (r + a) / t,
  39557. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39558. this._w = (o - c) / t,
  39559. this._x = (r + a) / t,
  39560. this._y = .25 * t,
  39561. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39562. this._w = (a - r) / t,
  39563. this._x = (o + c) / t,
  39564. this._y = (l + h) / t,
  39565. this._z = .25 * t),
  39566. this.onChangeCallback(),
  39567. this
  39568. },
  39569. setFromUnitVectors: function() {
  39570. var e, t, i = 1e-6;
  39571. return function(r, o) {
  39572. return void 0 === e && (e = new n.Vector3),
  39573. t = r.dot(o) + 1,
  39574. t < i ? (t = 0,
  39575. 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),
  39576. this._x = e.x,
  39577. this._y = e.y,
  39578. this._z = e.z,
  39579. this._w = t,
  39580. this.normalize(),
  39581. this
  39582. }
  39583. }(),
  39584. inverse: function() {
  39585. return this.conjugate().normalize(),
  39586. this
  39587. },
  39588. conjugate: function() {
  39589. return this._x *= -1,
  39590. this._y *= -1,
  39591. this._z *= -1,
  39592. this.onChangeCallback(),
  39593. this
  39594. },
  39595. dot: function(e) {
  39596. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39597. },
  39598. lengthSq: function() {
  39599. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39600. },
  39601. length: function() {
  39602. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39603. },
  39604. normalize: function() {
  39605. var e = this.length();
  39606. return 0 === e ? (this._x = 0,
  39607. this._y = 0,
  39608. this._z = 0,
  39609. this._w = 1) : (e = 1 / e,
  39610. this._x = this._x * e,
  39611. this._y = this._y * e,
  39612. this._z = this._z * e,
  39613. this._w = this._w * e),
  39614. this.onChangeCallback(),
  39615. this
  39616. },
  39617. multiply: function(e, t) {
  39618. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39619. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39620. },
  39621. multiplyQuaternions: function(e, t) {
  39622. var i = e._x
  39623. , n = e._y
  39624. , r = e._z
  39625. , o = e._w
  39626. , a = t._x
  39627. , s = t._y
  39628. , l = t._z
  39629. , c = t._w;
  39630. return this._x = i * c + o * a + n * l - r * s,
  39631. this._y = n * c + o * s + r * a - i * l,
  39632. this._z = r * c + o * l + i * s - n * a,
  39633. this._w = o * c - i * a - n * s - r * l,
  39634. this.onChangeCallback(),
  39635. this
  39636. },
  39637. slerp: function(e, t) {
  39638. if (0 === t)
  39639. return this;
  39640. if (1 === t)
  39641. return this.copy(e);
  39642. var i = this._x
  39643. , n = this._y
  39644. , r = this._z
  39645. , o = this._w
  39646. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39647. if (a < 0 ? (this._w = -e._w,
  39648. this._x = -e._x,
  39649. this._y = -e._y,
  39650. this._z = -e._z,
  39651. a = -a) : this.copy(e),
  39652. a >= 1)
  39653. return this._w = o,
  39654. this._x = i,
  39655. this._y = n,
  39656. this._z = r,
  39657. this;
  39658. var s = Math.sqrt(1 - a * a);
  39659. if (Math.abs(s) < .001)
  39660. return this._w = .5 * (o + this._w),
  39661. this._x = .5 * (i + this._x),
  39662. this._y = .5 * (n + this._y),
  39663. this._z = .5 * (r + this._z),
  39664. this;
  39665. var l = Math.atan2(s, a)
  39666. , c = Math.sin((1 - t) * l) / s
  39667. , h = Math.sin(t * l) / s;
  39668. return this._w = o * c + this._w * h,
  39669. this._x = i * c + this._x * h,
  39670. this._y = n * c + this._y * h,
  39671. this._z = r * c + this._z * h,
  39672. this.onChangeCallback(),
  39673. this
  39674. },
  39675. equals: function(e) {
  39676. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39677. },
  39678. fromArray: function(e, t) {
  39679. return void 0 === t && (t = 0),
  39680. this._x = e[t],
  39681. this._y = e[t + 1],
  39682. this._z = e[t + 2],
  39683. this._w = e[t + 3],
  39684. this.onChangeCallback(),
  39685. this
  39686. },
  39687. toArray: function(e, t) {
  39688. return void 0 === e && (e = []),
  39689. void 0 === t && (t = 0),
  39690. e[t] = this._x,
  39691. e[t + 1] = this._y,
  39692. e[t + 2] = this._z,
  39693. e[t + 3] = this._w,
  39694. e
  39695. },
  39696. onChange: function(e) {
  39697. return this.onChangeCallback = e,
  39698. this
  39699. },
  39700. onChangeCallback: function() {}
  39701. },
  39702. Object.assign(n.Quaternion, {
  39703. slerp: function(e, t, i, n) {
  39704. return i.copy(e).slerp(t, n)
  39705. },
  39706. slerpFlat: function(e, t, i, n, r, o, a) {
  39707. var s = i[n + 0]
  39708. , l = i[n + 1]
  39709. , c = i[n + 2]
  39710. , h = i[n + 3]
  39711. , u = r[o + 0]
  39712. , d = r[o + 1]
  39713. , p = r[o + 2]
  39714. , f = r[o + 3];
  39715. if (h !== f || s !== u || l !== d || c !== p) {
  39716. var g = 1 - a
  39717. , m = s * u + l * d + c * p + h * f
  39718. , v = m >= 0 ? 1 : -1
  39719. , A = 1 - m * m;
  39720. if (A > Number.EPSILON) {
  39721. var y = Math.sqrt(A)
  39722. , C = Math.atan2(y, m * v);
  39723. g = Math.sin(g * C) / y,
  39724. a = Math.sin(a * C) / y
  39725. }
  39726. var I = a * v;
  39727. if (s = s * g + u * I,
  39728. l = l * g + d * I,
  39729. c = c * g + p * I,
  39730. h = h * g + f * I,
  39731. g === 1 - a) {
  39732. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39733. s *= E,
  39734. l *= E,
  39735. c *= E,
  39736. h *= E
  39737. }
  39738. }
  39739. e[t] = s,
  39740. e[t + 1] = l,
  39741. e[t + 2] = c,
  39742. e[t + 3] = h
  39743. }
  39744. }),
  39745. n.Vector2 = function(e, t) {
  39746. this.x = e || 0,
  39747. this.y = t || 0
  39748. }
  39749. ,
  39750. n.Vector2.prototype = {
  39751. constructor: n.Vector2,
  39752. get width() {
  39753. return this.x
  39754. },
  39755. set width(e) {
  39756. this.x = e
  39757. },
  39758. get height() {
  39759. return this.y
  39760. },
  39761. set height(e) {
  39762. this.y = e
  39763. },
  39764. set: function(e, t) {
  39765. return this.x = e,
  39766. this.y = t,
  39767. this
  39768. },
  39769. setScalar: function(e) {
  39770. return this.x = e,
  39771. this.y = e,
  39772. this
  39773. },
  39774. setX: function(e) {
  39775. return this.x = e,
  39776. this
  39777. },
  39778. setY: function(e) {
  39779. return this.y = e,
  39780. this
  39781. },
  39782. setComponent: function(e, t) {
  39783. switch (e) {
  39784. case 0:
  39785. this.x = t;
  39786. break;
  39787. case 1:
  39788. this.y = t;
  39789. break;
  39790. default:
  39791. throw new Error("index is out of range: " + e)
  39792. }
  39793. },
  39794. getComponent: function(e) {
  39795. switch (e) {
  39796. case 0:
  39797. return this.x;
  39798. case 1:
  39799. return this.y;
  39800. default:
  39801. throw new Error("index is out of range: " + e)
  39802. }
  39803. },
  39804. clone: function() {
  39805. return new this.constructor(this.x,this.y)
  39806. },
  39807. copy: function(e) {
  39808. return this.x = e.x,
  39809. this.y = e.y,
  39810. this
  39811. },
  39812. add: function(e, t) {
  39813. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39814. this.addVectors(e, t)) : (this.x += e.x,
  39815. this.y += e.y,
  39816. this)
  39817. },
  39818. addScalar: function(e) {
  39819. return this.x += e,
  39820. this.y += e,
  39821. this
  39822. },
  39823. addVectors: function(e, t) {
  39824. return this.x = e.x + t.x,
  39825. this.y = e.y + t.y,
  39826. this
  39827. },
  39828. addScaledVector: function(e, t) {
  39829. return this.x += e.x * t,
  39830. this.y += e.y * t,
  39831. this
  39832. },
  39833. sub: function(e, t) {
  39834. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39835. this.subVectors(e, t)) : (this.x -= e.x,
  39836. this.y -= e.y,
  39837. this)
  39838. },
  39839. subScalar: function(e) {
  39840. return this.x -= e,
  39841. this.y -= e,
  39842. this
  39843. },
  39844. subVectors: function(e, t) {
  39845. return this.x = e.x - t.x,
  39846. this.y = e.y - t.y,
  39847. this
  39848. },
  39849. multiply: function(e) {
  39850. return this.x *= e.x,
  39851. this.y *= e.y,
  39852. this
  39853. },
  39854. multiplyScalar: function(e) {
  39855. return isFinite(e) ? (this.x *= e,
  39856. this.y *= e) : (this.x = 0,
  39857. this.y = 0),
  39858. this
  39859. },
  39860. divide: function(e) {
  39861. return this.x /= e.x,
  39862. this.y /= e.y,
  39863. this
  39864. },
  39865. divideScalar: function(e) {
  39866. return this.multiplyScalar(1 / e)
  39867. },
  39868. min: function(e) {
  39869. return this.x = Math.min(this.x, e.x),
  39870. this.y = Math.min(this.y, e.y),
  39871. this
  39872. },
  39873. max: function(e) {
  39874. return this.x = Math.max(this.x, e.x),
  39875. this.y = Math.max(this.y, e.y),
  39876. this
  39877. },
  39878. clamp: function(e, t) {
  39879. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39880. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39881. this
  39882. },
  39883. clampScalar: function() {
  39884. var e, t;
  39885. return function(i, r) {
  39886. return void 0 === e && (e = new n.Vector2,
  39887. t = new n.Vector2),
  39888. e.set(i, i),
  39889. t.set(r, r),
  39890. this.clamp(e, t)
  39891. }
  39892. }(),
  39893. clampLength: function(e, t) {
  39894. var i = this.length();
  39895. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39896. this
  39897. },
  39898. floor: function() {
  39899. return this.x = Math.floor(this.x),
  39900. this.y = Math.floor(this.y),
  39901. this
  39902. },
  39903. ceil: function() {
  39904. return this.x = Math.ceil(this.x),
  39905. this.y = Math.ceil(this.y),
  39906. this
  39907. },
  39908. round: function() {
  39909. return this.x = Math.round(this.x),
  39910. this.y = Math.round(this.y),
  39911. this
  39912. },
  39913. roundToZero: function() {
  39914. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39915. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39916. this
  39917. },
  39918. negate: function() {
  39919. return this.x = -this.x,
  39920. this.y = -this.y,
  39921. this
  39922. },
  39923. dot: function(e) {
  39924. return this.x * e.x + this.y * e.y
  39925. },
  39926. lengthSq: function() {
  39927. return this.x * this.x + this.y * this.y
  39928. },
  39929. length: function() {
  39930. return Math.sqrt(this.x * this.x + this.y * this.y)
  39931. },
  39932. lengthManhattan: function() {
  39933. return Math.abs(this.x) + Math.abs(this.y)
  39934. },
  39935. normalize: function() {
  39936. return this.divideScalar(this.length())
  39937. },
  39938. angle: function() {
  39939. var e = Math.atan2(this.y, this.x);
  39940. return e < 0 && (e += 2 * Math.PI),
  39941. e
  39942. },
  39943. distanceTo: function(e) {
  39944. return Math.sqrt(this.distanceToSquared(e))
  39945. },
  39946. distanceToSquared: function(e) {
  39947. var t = this.x - e.x
  39948. , i = this.y - e.y;
  39949. return t * t + i * i
  39950. },
  39951. setLength: function(e) {
  39952. return this.multiplyScalar(e / this.length())
  39953. },
  39954. lerp: function(e, t) {
  39955. return this.x += (e.x - this.x) * t,
  39956. this.y += (e.y - this.y) * t,
  39957. this
  39958. },
  39959. lerpVectors: function(e, t, i) {
  39960. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39961. this
  39962. },
  39963. equals: function(e) {
  39964. return e.x === this.x && e.y === this.y
  39965. },
  39966. fromArray: function(e, t) {
  39967. return void 0 === t && (t = 0),
  39968. this.x = e[t],
  39969. this.y = e[t + 1],
  39970. this
  39971. },
  39972. toArray: function(e, t) {
  39973. return void 0 === e && (e = []),
  39974. void 0 === t && (t = 0),
  39975. e[t] = this.x,
  39976. e[t + 1] = this.y,
  39977. e
  39978. },
  39979. fromAttribute: function(e, t, i) {
  39980. return void 0 === i && (i = 0),
  39981. t = t * e.itemSize + i,
  39982. this.x = e.array[t],
  39983. this.y = e.array[t + 1],
  39984. this
  39985. },
  39986. rotateAround: function(e, t) {
  39987. var i = Math.cos(t)
  39988. , n = Math.sin(t)
  39989. , r = this.x - e.x
  39990. , o = this.y - e.y;
  39991. return this.x = r * i - o * n + e.x,
  39992. this.y = r * n + o * i + e.y,
  39993. this
  39994. }
  39995. },
  39996. n.Vector3 = function(e, t, i) {
  39997. this.x = e || 0,
  39998. this.y = t || 0,
  39999. this.z = i || 0
  40000. }
  40001. ,
  40002. n.Vector3.prototype = {
  40003. constructor: n.Vector3,
  40004. set: function(e, t, i) {
  40005. return this.x = e,
  40006. this.y = t,
  40007. this.z = i,
  40008. this
  40009. },
  40010. setScalar: function(e) {
  40011. return this.x = e,
  40012. this.y = e,
  40013. this.z = e,
  40014. this
  40015. },
  40016. setX: function(e) {
  40017. return this.x = e,
  40018. this
  40019. },
  40020. setY: function(e) {
  40021. return this.y = e,
  40022. this
  40023. },
  40024. setZ: function(e) {
  40025. return this.z = e,
  40026. this
  40027. },
  40028. setComponent: function(e, t) {
  40029. switch (e) {
  40030. case 0:
  40031. this.x = t;
  40032. break;
  40033. case 1:
  40034. this.y = t;
  40035. break;
  40036. case 2:
  40037. this.z = t;
  40038. break;
  40039. default:
  40040. throw new Error("index is out of range: " + e)
  40041. }
  40042. },
  40043. getComponent: function(e) {
  40044. switch (e) {
  40045. case 0:
  40046. return this.x;
  40047. case 1:
  40048. return this.y;
  40049. case 2:
  40050. return this.z;
  40051. default:
  40052. throw new Error("index is out of range: " + e)
  40053. }
  40054. },
  40055. clone: function() {
  40056. return new this.constructor(this.x,this.y,this.z)
  40057. },
  40058. copy: function(e) {
  40059. return this.x = e.x,
  40060. this.y = e.y,
  40061. this.z = e.z,
  40062. this
  40063. },
  40064. add: function(e, t) {
  40065. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40066. this.addVectors(e, t)) : (this.x += e.x,
  40067. this.y += e.y,
  40068. this.z += e.z,
  40069. this)
  40070. },
  40071. addScalar: function(e) {
  40072. return this.x += e,
  40073. this.y += e,
  40074. this.z += e,
  40075. this
  40076. },
  40077. addVectors: function(e, t) {
  40078. return this.x = e.x + t.x,
  40079. this.y = e.y + t.y,
  40080. this.z = e.z + t.z,
  40081. this
  40082. },
  40083. addScaledVector: function(e, t) {
  40084. return this.x += e.x * t,
  40085. this.y += e.y * t,
  40086. this.z += e.z * t,
  40087. this
  40088. },
  40089. sub: function(e, t) {
  40090. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40091. this.subVectors(e, t)) : (this.x -= e.x,
  40092. this.y -= e.y,
  40093. this.z -= e.z,
  40094. this)
  40095. },
  40096. subScalar: function(e) {
  40097. return this.x -= e,
  40098. this.y -= e,
  40099. this.z -= e,
  40100. this
  40101. },
  40102. subVectors: function(e, t) {
  40103. return this.x = e.x - t.x,
  40104. this.y = e.y - t.y,
  40105. this.z = e.z - t.z,
  40106. this
  40107. },
  40108. multiply: function(e, t) {
  40109. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40110. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40111. this.y *= e.y,
  40112. this.z *= e.z,
  40113. this)
  40114. },
  40115. multiplyScalar: function(e) {
  40116. return isFinite(e) ? (this.x *= e,
  40117. this.y *= e,
  40118. this.z *= e) : (this.x = 0,
  40119. this.y = 0,
  40120. this.z = 0),
  40121. this
  40122. },
  40123. multiplyVectors: function(e, t) {
  40124. return this.x = e.x * t.x,
  40125. this.y = e.y * t.y,
  40126. this.z = e.z * t.z,
  40127. this
  40128. },
  40129. applyEuler: function() {
  40130. var e;
  40131. return function(t) {
  40132. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40133. void 0 === e && (e = new n.Quaternion),
  40134. this.applyQuaternion(e.setFromEuler(t)),
  40135. this
  40136. }
  40137. }(),
  40138. applyAxisAngle: function() {
  40139. var e;
  40140. return function(t, i) {
  40141. return void 0 === e && (e = new n.Quaternion),
  40142. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40143. this
  40144. }
  40145. }(),
  40146. applyMatrix3: function(e) {
  40147. var t = this.x
  40148. , i = this.y
  40149. , n = this.z
  40150. , r = e.elements;
  40151. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40152. this.y = r[1] * t + r[4] * i + r[7] * n,
  40153. this.z = r[2] * t + r[5] * i + r[8] * n,
  40154. this
  40155. },
  40156. applyMatrix4: function(e) {
  40157. var t = this.x
  40158. , i = this.y
  40159. , n = this.z
  40160. , r = e.elements;
  40161. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40162. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40163. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40164. this
  40165. },
  40166. applyProjection: function(e) {
  40167. var t = this.x
  40168. , i = this.y
  40169. , n = this.z
  40170. , r = e.elements
  40171. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40172. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40173. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40174. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40175. this
  40176. },
  40177. applyQuaternion: function(e) {
  40178. var t = this.x
  40179. , i = this.y
  40180. , n = this.z
  40181. , r = e.x
  40182. , o = e.y
  40183. , a = e.z
  40184. , s = e.w
  40185. , l = s * t + o * n - a * i
  40186. , c = s * i + a * t - r * n
  40187. , h = s * n + r * i - o * t
  40188. , u = -r * t - o * i - a * n;
  40189. return this.x = l * s + u * -r + c * -a - h * -o,
  40190. this.y = c * s + u * -o + h * -r - l * -a,
  40191. this.z = h * s + u * -a + l * -o - c * -r,
  40192. this
  40193. },
  40194. project: function() {
  40195. var e;
  40196. return function(t) {
  40197. return void 0 === e && (e = new n.Matrix4),
  40198. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40199. this.applyProjection(e)
  40200. }
  40201. }(),
  40202. unproject: function() {
  40203. var e;
  40204. return function(t) {
  40205. return void 0 === e && (e = new n.Matrix4),
  40206. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40207. this.applyProjection(e)
  40208. }
  40209. }(),
  40210. transformDirection: function(e) {
  40211. var t = this.x
  40212. , i = this.y
  40213. , n = this.z
  40214. , r = e.elements;
  40215. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40216. this.y = r[1] * t + r[5] * i + r[9] * n,
  40217. this.z = r[2] * t + r[6] * i + r[10] * n,
  40218. this.normalize(),
  40219. this
  40220. },
  40221. divide: function(e) {
  40222. return this.x /= e.x,
  40223. this.y /= e.y,
  40224. this.z /= e.z,
  40225. this
  40226. },
  40227. divideScalar: function(e) {
  40228. return this.multiplyScalar(1 / e)
  40229. },
  40230. min: function(e) {
  40231. return this.x = Math.min(this.x, e.x),
  40232. this.y = Math.min(this.y, e.y),
  40233. this.z = Math.min(this.z, e.z),
  40234. this
  40235. },
  40236. max: function(e) {
  40237. return this.x = Math.max(this.x, e.x),
  40238. this.y = Math.max(this.y, e.y),
  40239. this.z = Math.max(this.z, e.z),
  40240. this
  40241. },
  40242. clamp: function(e, t) {
  40243. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40244. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40245. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40246. this
  40247. },
  40248. clampScalar: function() {
  40249. var e, t;
  40250. return function(i, r) {
  40251. return void 0 === e && (e = new n.Vector3,
  40252. t = new n.Vector3),
  40253. e.set(i, i, i),
  40254. t.set(r, r, r),
  40255. this.clamp(e, t)
  40256. }
  40257. }(),
  40258. clampLength: function(e, t) {
  40259. var i = this.length();
  40260. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40261. this
  40262. },
  40263. floor: function() {
  40264. return this.x = Math.floor(this.x),
  40265. this.y = Math.floor(this.y),
  40266. this.z = Math.floor(this.z),
  40267. this
  40268. },
  40269. ceil: function() {
  40270. return this.x = Math.ceil(this.x),
  40271. this.y = Math.ceil(this.y),
  40272. this.z = Math.ceil(this.z),
  40273. this
  40274. },
  40275. round: function() {
  40276. return this.x = Math.round(this.x),
  40277. this.y = Math.round(this.y),
  40278. this.z = Math.round(this.z),
  40279. this
  40280. },
  40281. roundToZero: function() {
  40282. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40283. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40284. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40285. this
  40286. },
  40287. negate: function() {
  40288. return this.x = -this.x,
  40289. this.y = -this.y,
  40290. this.z = -this.z,
  40291. this
  40292. },
  40293. dot: function(e) {
  40294. return this.x * e.x + this.y * e.y + this.z * e.z
  40295. },
  40296. lengthSq: function() {
  40297. return this.x * this.x + this.y * this.y + this.z * this.z
  40298. },
  40299. length: function() {
  40300. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40301. },
  40302. lengthManhattan: function() {
  40303. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40304. },
  40305. normalize: function() {
  40306. return this.divideScalar(this.length())
  40307. },
  40308. setLength: function(e) {
  40309. return this.multiplyScalar(e / this.length())
  40310. },
  40311. lerp: function(e, t) {
  40312. return this.x += (e.x - this.x) * t,
  40313. this.y += (e.y - this.y) * t,
  40314. this.z += (e.z - this.z) * t,
  40315. this
  40316. },
  40317. lerpVectors: function(e, t, i) {
  40318. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40319. this
  40320. },
  40321. cross: function(e, t) {
  40322. if (void 0 !== t)
  40323. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40324. this.crossVectors(e, t);
  40325. var i = this.x
  40326. , n = this.y
  40327. , r = this.z;
  40328. return this.x = n * e.z - r * e.y,
  40329. this.y = r * e.x - i * e.z,
  40330. this.z = i * e.y - n * e.x,
  40331. this
  40332. },
  40333. crossVectors: function(e, t) {
  40334. var i = e.x
  40335. , n = e.y
  40336. , r = e.z
  40337. , o = t.x
  40338. , a = t.y
  40339. , s = t.z;
  40340. return this.x = n * s - r * a,
  40341. this.y = r * o - i * s,
  40342. this.z = i * a - n * o,
  40343. this
  40344. },
  40345. projectOnVector: function() {
  40346. var e, t;
  40347. return function(i) {
  40348. return void 0 === e && (e = new n.Vector3),
  40349. e.copy(i).normalize(),
  40350. t = this.dot(e),
  40351. this.copy(e).multiplyScalar(t)
  40352. }
  40353. }(),
  40354. projectOnPlane: function() {
  40355. var e;
  40356. return function(t) {
  40357. return void 0 === e && (e = new n.Vector3),
  40358. e.copy(this).projectOnVector(t),
  40359. this.sub(e)
  40360. }
  40361. }(),
  40362. reflect: function() {
  40363. var e;
  40364. return function(t) {
  40365. return void 0 === e && (e = new n.Vector3),
  40366. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40367. }
  40368. }(),
  40369. angleTo: function(e) {
  40370. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40371. return Math.acos(n.Math.clamp(t, -1, 1))
  40372. },
  40373. distanceTo: function(e) {
  40374. return Math.sqrt(this.distanceToSquared(e))
  40375. },
  40376. distanceToSquared: function(e) {
  40377. var t = this.x - e.x
  40378. , i = this.y - e.y
  40379. , n = this.z - e.z;
  40380. return t * t + i * i + n * n
  40381. },
  40382. setFromSpherical: function(e) {
  40383. var t = Math.sin(e.phi) * e.radius;
  40384. return this.x = t * Math.sin(e.theta),
  40385. this.y = Math.cos(e.phi) * e.radius,
  40386. this.z = t * Math.cos(e.theta),
  40387. this
  40388. },
  40389. setFromMatrixPosition: function(e) {
  40390. return this.setFromMatrixColumn(e, 3)
  40391. },
  40392. setFromMatrixScale: function(e) {
  40393. var t = this.setFromMatrixColumn(e, 0).length()
  40394. , i = this.setFromMatrixColumn(e, 1).length()
  40395. , n = this.setFromMatrixColumn(e, 2).length();
  40396. return this.x = t,
  40397. this.y = i,
  40398. this.z = n,
  40399. this
  40400. },
  40401. setFromMatrixColumn: function(e, t) {
  40402. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40403. e = arguments[1],
  40404. t = arguments[0]),
  40405. this.fromArray(e.elements, 4 * t)
  40406. },
  40407. equals: function(e) {
  40408. return e.x === this.x && e.y === this.y && e.z === this.z
  40409. },
  40410. fromArray: function(e, t) {
  40411. return void 0 === t && (t = 0),
  40412. this.x = e[t],
  40413. this.y = e[t + 1],
  40414. this.z = e[t + 2],
  40415. this
  40416. },
  40417. toArray: function(e, t) {
  40418. return void 0 === e && (e = []),
  40419. void 0 === t && (t = 0),
  40420. e[t] = this.x,
  40421. e[t + 1] = this.y,
  40422. e[t + 2] = this.z,
  40423. e
  40424. },
  40425. fromAttribute: function(e, t, i) {
  40426. return void 0 === i && (i = 0),
  40427. t = t * e.itemSize + i,
  40428. this.x = e.array[t],
  40429. this.y = e.array[t + 1],
  40430. this.z = e.array[t + 2],
  40431. this
  40432. }
  40433. },
  40434. n.Vector4 = function(e, t, i, n) {
  40435. this.x = e || 0,
  40436. this.y = t || 0,
  40437. this.z = i || 0,
  40438. this.w = void 0 !== n ? n : 1
  40439. }
  40440. ,
  40441. n.Vector4.prototype = {
  40442. constructor: n.Vector4,
  40443. set: function(e, t, i, n) {
  40444. return this.x = e,
  40445. this.y = t,
  40446. this.z = i,
  40447. this.w = n,
  40448. this
  40449. },
  40450. setScalar: function(e) {
  40451. return this.x = e,
  40452. this.y = e,
  40453. this.z = e,
  40454. this.w = e,
  40455. this
  40456. },
  40457. setX: function(e) {
  40458. return this.x = e,
  40459. this
  40460. },
  40461. setY: function(e) {
  40462. return this.y = e,
  40463. this
  40464. },
  40465. setZ: function(e) {
  40466. return this.z = e,
  40467. this
  40468. },
  40469. setW: function(e) {
  40470. return this.w = e,
  40471. this
  40472. },
  40473. setComponent: function(e, t) {
  40474. switch (e) {
  40475. case 0:
  40476. this.x = t;
  40477. break;
  40478. case 1:
  40479. this.y = t;
  40480. break;
  40481. case 2:
  40482. this.z = t;
  40483. break;
  40484. case 3:
  40485. this.w = t;
  40486. break;
  40487. default:
  40488. throw new Error("index is out of range: " + e)
  40489. }
  40490. },
  40491. getComponent: function(e) {
  40492. switch (e) {
  40493. case 0:
  40494. return this.x;
  40495. case 1:
  40496. return this.y;
  40497. case 2:
  40498. return this.z;
  40499. case 3:
  40500. return this.w;
  40501. default:
  40502. throw new Error("index is out of range: " + e)
  40503. }
  40504. },
  40505. clone: function() {
  40506. return new this.constructor(this.x,this.y,this.z,this.w)
  40507. },
  40508. copy: function(e) {
  40509. return this.x = e.x,
  40510. this.y = e.y,
  40511. this.z = e.z,
  40512. this.w = void 0 !== e.w ? e.w : 1,
  40513. this
  40514. },
  40515. add: function(e, t) {
  40516. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40517. this.addVectors(e, t)) : (this.x += e.x,
  40518. this.y += e.y,
  40519. this.z += e.z,
  40520. this.w += e.w,
  40521. this)
  40522. },
  40523. addScalar: function(e) {
  40524. return this.x += e,
  40525. this.y += e,
  40526. this.z += e,
  40527. this.w += e,
  40528. this
  40529. },
  40530. addVectors: function(e, t) {
  40531. return this.x = e.x + t.x,
  40532. this.y = e.y + t.y,
  40533. this.z = e.z + t.z,
  40534. this.w = e.w + t.w,
  40535. this
  40536. },
  40537. addScaledVector: function(e, t) {
  40538. return this.x += e.x * t,
  40539. this.y += e.y * t,
  40540. this.z += e.z * t,
  40541. this.w += e.w * t,
  40542. this
  40543. },
  40544. sub: function(e, t) {
  40545. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40546. this.subVectors(e, t)) : (this.x -= e.x,
  40547. this.y -= e.y,
  40548. this.z -= e.z,
  40549. this.w -= e.w,
  40550. this)
  40551. },
  40552. subScalar: function(e) {
  40553. return this.x -= e,
  40554. this.y -= e,
  40555. this.z -= e,
  40556. this.w -= e,
  40557. this
  40558. },
  40559. subVectors: function(e, t) {
  40560. return this.x = e.x - t.x,
  40561. this.y = e.y - t.y,
  40562. this.z = e.z - t.z,
  40563. this.w = e.w - t.w,
  40564. this
  40565. },
  40566. multiplyScalar: function(e) {
  40567. return isFinite(e) ? (this.x *= e,
  40568. this.y *= e,
  40569. this.z *= e,
  40570. this.w *= e) : (this.x = 0,
  40571. this.y = 0,
  40572. this.z = 0,
  40573. this.w = 0),
  40574. this
  40575. },
  40576. applyMatrix4: function(e) {
  40577. var t = this.x
  40578. , i = this.y
  40579. , n = this.z
  40580. , r = this.w
  40581. , o = e.elements;
  40582. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40583. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40584. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40585. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40586. this
  40587. },
  40588. divideScalar: function(e) {
  40589. return this.multiplyScalar(1 / e)
  40590. },
  40591. setAxisAngleFromQuaternion: function(e) {
  40592. this.w = 2 * Math.acos(e.w);
  40593. var t = Math.sqrt(1 - e.w * e.w);
  40594. return t < 1e-4 ? (this.x = 1,
  40595. this.y = 0,
  40596. this.z = 0) : (this.x = e.x / t,
  40597. this.y = e.y / t,
  40598. this.z = e.z / t),
  40599. this
  40600. },
  40601. setAxisAngleFromRotationMatrix: function(e) {
  40602. 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];
  40603. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40604. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40605. return this.set(1, 0, 0, 0),
  40606. this;
  40607. t = Math.PI;
  40608. var v = (l + 1) / 2
  40609. , A = (d + 1) / 2
  40610. , y = (m + 1) / 2
  40611. , C = (c + u) / 4
  40612. , I = (h + f) / 4
  40613. , E = (p + g) / 4;
  40614. return v > A && v > y ? v < o ? (i = 0,
  40615. n = .707106781,
  40616. r = .707106781) : (i = Math.sqrt(v),
  40617. n = C / i,
  40618. r = I / i) : A > y ? A < o ? (i = .707106781,
  40619. n = 0,
  40620. r = .707106781) : (n = Math.sqrt(A),
  40621. i = C / n,
  40622. r = E / n) : y < o ? (i = .707106781,
  40623. n = .707106781,
  40624. r = 0) : (r = Math.sqrt(y),
  40625. i = I / r,
  40626. n = E / r),
  40627. this.set(i, n, r, t),
  40628. this
  40629. }
  40630. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40631. return Math.abs(b) < .001 && (b = 1),
  40632. this.x = (g - p) / b,
  40633. this.y = (h - f) / b,
  40634. this.z = (u - c) / b,
  40635. this.w = Math.acos((l + d + m - 1) / 2),
  40636. this
  40637. },
  40638. min: function(e) {
  40639. return this.x = Math.min(this.x, e.x),
  40640. this.y = Math.min(this.y, e.y),
  40641. this.z = Math.min(this.z, e.z),
  40642. this.w = Math.min(this.w, e.w),
  40643. this
  40644. },
  40645. max: function(e) {
  40646. return this.x = Math.max(this.x, e.x),
  40647. this.y = Math.max(this.y, e.y),
  40648. this.z = Math.max(this.z, e.z),
  40649. this.w = Math.max(this.w, e.w),
  40650. this
  40651. },
  40652. clamp: function(e, t) {
  40653. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40654. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40655. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40656. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40657. this
  40658. },
  40659. clampScalar: function() {
  40660. var e, t;
  40661. return function(i, r) {
  40662. return void 0 === e && (e = new n.Vector4,
  40663. t = new n.Vector4),
  40664. e.set(i, i, i, i),
  40665. t.set(r, r, r, r),
  40666. this.clamp(e, t)
  40667. }
  40668. }(),
  40669. floor: function() {
  40670. return this.x = Math.floor(this.x),
  40671. this.y = Math.floor(this.y),
  40672. this.z = Math.floor(this.z),
  40673. this.w = Math.floor(this.w),
  40674. this
  40675. },
  40676. ceil: function() {
  40677. return this.x = Math.ceil(this.x),
  40678. this.y = Math.ceil(this.y),
  40679. this.z = Math.ceil(this.z),
  40680. this.w = Math.ceil(this.w),
  40681. this
  40682. },
  40683. round: function() {
  40684. return this.x = Math.round(this.x),
  40685. this.y = Math.round(this.y),
  40686. this.z = Math.round(this.z),
  40687. this.w = Math.round(this.w),
  40688. this
  40689. },
  40690. roundToZero: function() {
  40691. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40692. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40693. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40694. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40695. this
  40696. },
  40697. negate: function() {
  40698. return this.x = -this.x,
  40699. this.y = -this.y,
  40700. this.z = -this.z,
  40701. this.w = -this.w,
  40702. this
  40703. },
  40704. dot: function(e) {
  40705. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40706. },
  40707. lengthSq: function() {
  40708. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40709. },
  40710. length: function() {
  40711. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40712. },
  40713. lengthManhattan: function() {
  40714. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40715. },
  40716. normalize: function() {
  40717. return this.divideScalar(this.length())
  40718. },
  40719. setLength: function(e) {
  40720. return this.multiplyScalar(e / this.length())
  40721. },
  40722. lerp: function(e, t) {
  40723. return this.x += (e.x - this.x) * t,
  40724. this.y += (e.y - this.y) * t,
  40725. this.z += (e.z - this.z) * t,
  40726. this.w += (e.w - this.w) * t,
  40727. this
  40728. },
  40729. lerpVectors: function(e, t, i) {
  40730. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40731. this
  40732. },
  40733. equals: function(e) {
  40734. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40735. },
  40736. fromArray: function(e, t) {
  40737. return void 0 === t && (t = 0),
  40738. this.x = e[t],
  40739. this.y = e[t + 1],
  40740. this.z = e[t + 2],
  40741. this.w = e[t + 3],
  40742. this
  40743. },
  40744. toArray: function(e, t) {
  40745. return void 0 === e && (e = []),
  40746. void 0 === t && (t = 0),
  40747. e[t] = this.x,
  40748. e[t + 1] = this.y,
  40749. e[t + 2] = this.z,
  40750. e[t + 3] = this.w,
  40751. e
  40752. },
  40753. fromAttribute: function(e, t, i) {
  40754. return void 0 === i && (i = 0),
  40755. t = t * e.itemSize + i,
  40756. this.x = e.array[t],
  40757. this.y = e.array[t + 1],
  40758. this.z = e.array[t + 2],
  40759. this.w = e.array[t + 3],
  40760. this
  40761. }
  40762. },
  40763. n.Euler = function(e, t, i, r) {
  40764. this._x = e || 0,
  40765. this._y = t || 0,
  40766. this._z = i || 0,
  40767. this._order = r || n.Euler.DefaultOrder
  40768. }
  40769. ,
  40770. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40771. n.Euler.DefaultOrder = "XYZ",
  40772. n.Euler.prototype = {
  40773. constructor: n.Euler,
  40774. get x() {
  40775. return this._x
  40776. },
  40777. set x(e) {
  40778. this._x = e,
  40779. this.onChangeCallback()
  40780. },
  40781. get y() {
  40782. return this._y
  40783. },
  40784. set y(e) {
  40785. this._y = e,
  40786. this.onChangeCallback()
  40787. },
  40788. get z() {
  40789. return this._z
  40790. },
  40791. set z(e) {
  40792. this._z = e,
  40793. this.onChangeCallback()
  40794. },
  40795. get order() {
  40796. return this._order
  40797. },
  40798. set order(e) {
  40799. this._order = e,
  40800. this.onChangeCallback()
  40801. },
  40802. set: function(e, t, i, n) {
  40803. return this._x = e,
  40804. this._y = t,
  40805. this._z = i,
  40806. this._order = n || this._order,
  40807. this.onChangeCallback(),
  40808. this
  40809. },
  40810. clone: function() {
  40811. return new this.constructor(this._x,this._y,this._z,this._order)
  40812. },
  40813. copy: function(e) {
  40814. return this._x = e._x,
  40815. this._y = e._y,
  40816. this._z = e._z,
  40817. this._order = e._order,
  40818. this.onChangeCallback(),
  40819. this
  40820. },
  40821. setFromRotationMatrix: function(e, t, i) {
  40822. var r = n.Math.clamp
  40823. , o = e.elements
  40824. , a = o[0]
  40825. , s = o[4]
  40826. , l = o[8]
  40827. , c = o[1]
  40828. , h = o[5]
  40829. , u = o[9]
  40830. , d = o[2]
  40831. , p = o[6]
  40832. , f = o[10];
  40833. return t = t || this._order,
  40834. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  40835. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  40836. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  40837. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  40838. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  40839. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  40840. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  40841. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  40842. this._z = Math.atan2(-s, h)) : (this._y = 0,
  40843. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  40844. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  40845. this._z = Math.atan2(c, a)) : (this._x = 0,
  40846. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  40847. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  40848. this._y = Math.atan2(-d, a)) : (this._x = 0,
  40849. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  40850. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  40851. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  40852. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  40853. this._order = t,
  40854. i !== !1 && this.onChangeCallback(),
  40855. this
  40856. },
  40857. setFromQuaternion: function() {
  40858. var e;
  40859. return function(t, i, r) {
  40860. return void 0 === e && (e = new n.Matrix4),
  40861. e.makeRotationFromQuaternion(t),
  40862. this.setFromRotationMatrix(e, i, r),
  40863. this
  40864. }
  40865. }(),
  40866. setFromVector3: function(e, t) {
  40867. return this.set(e.x, e.y, e.z, t || this._order)
  40868. },
  40869. reorder: function() {
  40870. var e = new n.Quaternion;
  40871. return function(t) {
  40872. e.setFromEuler(this),
  40873. this.setFromQuaternion(e, t)
  40874. }
  40875. }(),
  40876. equals: function(e) {
  40877. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  40878. },
  40879. fromArray: function(e) {
  40880. return this._x = e[0],
  40881. this._y = e[1],
  40882. this._z = e[2],
  40883. void 0 !== e[3] && (this._order = e[3]),
  40884. this.onChangeCallback(),
  40885. this
  40886. },
  40887. toArray: function(e, t) {
  40888. return void 0 === e && (e = []),
  40889. void 0 === t && (t = 0),
  40890. e[t] = this._x,
  40891. e[t + 1] = this._y,
  40892. e[t + 2] = this._z,
  40893. e[t + 3] = this._order,
  40894. e
  40895. },
  40896. toVector3: function(e) {
  40897. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  40898. },
  40899. onChange: function(e) {
  40900. return this.onChangeCallback = e,
  40901. this
  40902. },
  40903. onChangeCallback: function() {}
  40904. },
  40905. n.Line3 = function(e, t) {
  40906. this.start = void 0 !== e ? e : new n.Vector3,
  40907. this.end = void 0 !== t ? t : new n.Vector3
  40908. }
  40909. ,
  40910. n.Line3.prototype = {
  40911. constructor: n.Line3,
  40912. set: function(e, t) {
  40913. return this.start.copy(e),
  40914. this.end.copy(t),
  40915. this
  40916. },
  40917. clone: function() {
  40918. return (new this.constructor).copy(this)
  40919. },
  40920. copy: function(e) {
  40921. return this.start.copy(e.start),
  40922. this.end.copy(e.end),
  40923. this
  40924. },
  40925. center: function(e) {
  40926. var t = e || new n.Vector3;
  40927. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  40928. },
  40929. delta: function(e) {
  40930. var t = e || new n.Vector3;
  40931. return t.subVectors(this.end, this.start)
  40932. },
  40933. distanceSq: function() {
  40934. return this.start.distanceToSquared(this.end)
  40935. },
  40936. distance: function() {
  40937. return this.start.distanceTo(this.end)
  40938. },
  40939. at: function(e, t) {
  40940. var i = t || new n.Vector3;
  40941. return this.delta(i).multiplyScalar(e).add(this.start)
  40942. },
  40943. closestPointToPointParameter: function() {
  40944. var e = new n.Vector3
  40945. , t = new n.Vector3;
  40946. return function(i, r) {
  40947. e.subVectors(i, this.start),
  40948. t.subVectors(this.end, this.start);
  40949. var o = t.dot(t)
  40950. , a = t.dot(e)
  40951. , s = a / o;
  40952. return r && (s = n.Math.clamp(s, 0, 1)),
  40953. s
  40954. }
  40955. }(),
  40956. closestPointToPoint: function(e, t, i) {
  40957. var r = this.closestPointToPointParameter(e, t)
  40958. , o = i || new n.Vector3;
  40959. return this.delta(o).multiplyScalar(r).add(this.start)
  40960. },
  40961. applyMatrix4: function(e) {
  40962. return this.start.applyMatrix4(e),
  40963. this.end.applyMatrix4(e),
  40964. this
  40965. },
  40966. equals: function(e) {
  40967. return e.start.equals(this.start) && e.end.equals(this.end)
  40968. }
  40969. },
  40970. n.Box2 = function(e, t) {
  40971. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  40972. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  40973. }
  40974. ,
  40975. n.Box2.prototype = {
  40976. constructor: n.Box2,
  40977. set: function(e, t) {
  40978. return this.min.copy(e),
  40979. this.max.copy(t),
  40980. this
  40981. },
  40982. setFromPoints: function(e) {
  40983. this.makeEmpty();
  40984. for (var t = 0, i = e.length; t < i; t++)
  40985. this.expandByPoint(e[t]);
  40986. return this
  40987. },
  40988. setFromCenterAndSize: function() {
  40989. var e = new n.Vector2;
  40990. return function(t, i) {
  40991. var n = e.copy(i).multiplyScalar(.5);
  40992. return this.min.copy(t).sub(n),
  40993. this.max.copy(t).add(n),
  40994. this
  40995. }
  40996. }(),
  40997. clone: function() {
  40998. return (new this.constructor).copy(this)
  40999. },
  41000. copy: function(e) {
  41001. return this.min.copy(e.min),
  41002. this.max.copy(e.max),
  41003. this
  41004. },
  41005. makeEmpty: function() {
  41006. return this.min.x = this.min.y = +(1 / 0),
  41007. this.max.x = this.max.y = -(1 / 0),
  41008. this
  41009. },
  41010. isEmpty: function() {
  41011. return this.max.x < this.min.x || this.max.y < this.min.y
  41012. },
  41013. center: function(e) {
  41014. var t = e || new n.Vector2;
  41015. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41016. },
  41017. size: function(e) {
  41018. var t = e || new n.Vector2;
  41019. return t.subVectors(this.max, this.min)
  41020. },
  41021. expandByPoint: function(e) {
  41022. return this.min.min(e),
  41023. this.max.max(e),
  41024. this
  41025. },
  41026. expandByVector: function(e) {
  41027. return this.min.sub(e),
  41028. this.max.add(e),
  41029. this
  41030. },
  41031. expandByScalar: function(e) {
  41032. return this.min.addScalar(-e),
  41033. this.max.addScalar(e),
  41034. this
  41035. },
  41036. containsPoint: function(e) {
  41037. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41038. },
  41039. containsBox: function(e) {
  41040. 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
  41041. },
  41042. getParameter: function(e, t) {
  41043. var i = t || new n.Vector2;
  41044. 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))
  41045. },
  41046. intersectsBox: function(e) {
  41047. 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)
  41048. },
  41049. clampPoint: function(e, t) {
  41050. var i = t || new n.Vector2;
  41051. return i.copy(e).clamp(this.min, this.max)
  41052. },
  41053. distanceToPoint: function() {
  41054. var e = new n.Vector2;
  41055. return function(t) {
  41056. var i = e.copy(t).clamp(this.min, this.max);
  41057. return i.sub(t).length()
  41058. }
  41059. }(),
  41060. intersect: function(e) {
  41061. return this.min.max(e.min),
  41062. this.max.min(e.max),
  41063. this
  41064. },
  41065. union: function(e) {
  41066. return this.min.min(e.min),
  41067. this.max.max(e.max),
  41068. this
  41069. },
  41070. translate: function(e) {
  41071. return this.min.add(e),
  41072. this.max.add(e),
  41073. this
  41074. },
  41075. equals: function(e) {
  41076. return e.min.equals(this.min) && e.max.equals(this.max)
  41077. }
  41078. },
  41079. n.Box3 = function(e, t) {
  41080. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41081. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41082. }
  41083. ,
  41084. n.Box3.prototype = {
  41085. constructor: n.Box3,
  41086. set: function(e, t) {
  41087. return this.min.copy(e),
  41088. this.max.copy(t),
  41089. this
  41090. },
  41091. setFromArray: function(e) {
  41092. this.makeEmpty();
  41093. 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) {
  41094. var c = e[s]
  41095. , h = e[s + 1]
  41096. , u = e[s + 2];
  41097. c < t && (t = c),
  41098. h < i && (i = h),
  41099. u < n && (n = u),
  41100. c > r && (r = c),
  41101. h > o && (o = h),
  41102. u > a && (a = u)
  41103. }
  41104. this.min.set(t, i, n),
  41105. this.max.set(r, o, a)
  41106. },
  41107. setFromPoints: function(e) {
  41108. this.makeEmpty();
  41109. for (var t = 0, i = e.length; t < i; t++)
  41110. this.expandByPoint(e[t]);
  41111. return this
  41112. },
  41113. setFromCenterAndSize: function() {
  41114. var e = new n.Vector3;
  41115. return function(t, i) {
  41116. var n = e.copy(i).multiplyScalar(.5);
  41117. return this.min.copy(t).sub(n),
  41118. this.max.copy(t).add(n),
  41119. this
  41120. }
  41121. }(),
  41122. setFromObject: function() {
  41123. var e;
  41124. return function(t) {
  41125. void 0 === e && (e = new n.Box3);
  41126. var i = this;
  41127. return this.makeEmpty(),
  41128. t.updateMatrixWorld(!0),
  41129. t.traverse(function(t) {
  41130. var n = t.geometry;
  41131. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41132. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41133. e.applyMatrix4(t.matrixWorld),
  41134. i.union(e)))
  41135. }),
  41136. this
  41137. }
  41138. }(),
  41139. clone: function() {
  41140. return (new this.constructor).copy(this)
  41141. },
  41142. copy: function(e) {
  41143. return this.min.copy(e.min),
  41144. this.max.copy(e.max),
  41145. this
  41146. },
  41147. makeEmpty: function() {
  41148. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41149. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41150. this
  41151. },
  41152. isEmpty: function() {
  41153. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41154. },
  41155. center: function(e) {
  41156. var t = e || new n.Vector3;
  41157. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41158. },
  41159. size: function(e) {
  41160. var t = e || new n.Vector3;
  41161. return t.subVectors(this.max, this.min)
  41162. },
  41163. expandByPoint: function(e) {
  41164. return this.min.min(e),
  41165. this.max.max(e),
  41166. this
  41167. },
  41168. expandByVector: function(e) {
  41169. return this.min.sub(e),
  41170. this.max.add(e),
  41171. this
  41172. },
  41173. expandByScalar: function(e) {
  41174. return this.min.addScalar(-e),
  41175. this.max.addScalar(e),
  41176. this
  41177. },
  41178. containsPoint: function(e) {
  41179. 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)
  41180. },
  41181. containsBox: function(e) {
  41182. 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
  41183. },
  41184. getParameter: function(e, t) {
  41185. var i = t || new n.Vector3;
  41186. 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))
  41187. },
  41188. intersectsBox: function(e) {
  41189. 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)
  41190. },
  41191. intersectsSphere: function() {
  41192. var e;
  41193. return function(t) {
  41194. return void 0 === e && (e = new n.Vector3),
  41195. this.clampPoint(t.center, e),
  41196. e.distanceToSquared(t.center) <= t.radius * t.radius
  41197. }
  41198. }(),
  41199. intersectsPlane: function(e) {
  41200. var t, i;
  41201. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41202. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41203. i = e.normal.x * this.min.x),
  41204. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41205. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41206. i += e.normal.y * this.min.y),
  41207. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41208. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41209. i += e.normal.z * this.min.z),
  41210. t <= e.constant && i >= e.constant
  41211. },
  41212. clampPoint: function(e, t) {
  41213. var i = t || new n.Vector3;
  41214. return i.copy(e).clamp(this.min, this.max)
  41215. },
  41216. distanceToPoint: function() {
  41217. var e = new n.Vector3;
  41218. return function(t) {
  41219. var i = e.copy(t).clamp(this.min, this.max);
  41220. return i.sub(t).length()
  41221. }
  41222. }(),
  41223. getBoundingSphere: function() {
  41224. var e = new n.Vector3;
  41225. return function(t) {
  41226. var i = t || new n.Sphere;
  41227. return i.center = this.center(),
  41228. i.radius = .5 * this.size(e).length(),
  41229. i
  41230. }
  41231. }(),
  41232. intersect: function(e) {
  41233. return this.min.max(e.min),
  41234. this.max.min(e.max),
  41235. this
  41236. },
  41237. union: function(e) {
  41238. return this.min.min(e.min),
  41239. this.max.max(e.max),
  41240. this
  41241. },
  41242. applyMatrix4: function() {
  41243. 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];
  41244. return function(t) {
  41245. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41246. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41247. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41248. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41249. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41250. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41251. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41252. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41253. this.makeEmpty(),
  41254. this.setFromPoints(e),
  41255. this
  41256. }
  41257. }(),
  41258. translate: function(e) {
  41259. return this.min.add(e),
  41260. this.max.add(e),
  41261. this
  41262. },
  41263. equals: function(e) {
  41264. return e.min.equals(this.min) && e.max.equals(this.max)
  41265. }
  41266. },
  41267. n.Matrix3 = function() {
  41268. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41269. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41270. }
  41271. ,
  41272. n.Matrix3.prototype = {
  41273. constructor: n.Matrix3,
  41274. set: function(e, t, i, n, r, o, a, s, l) {
  41275. var c = this.elements;
  41276. return c[0] = e,
  41277. c[1] = n,
  41278. c[2] = a,
  41279. c[3] = t,
  41280. c[4] = r,
  41281. c[5] = s,
  41282. c[6] = i,
  41283. c[7] = o,
  41284. c[8] = l,
  41285. this
  41286. },
  41287. identity: function() {
  41288. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41289. this
  41290. },
  41291. clone: function() {
  41292. return (new this.constructor).fromArray(this.elements)
  41293. },
  41294. copy: function(e) {
  41295. var t = e.elements;
  41296. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41297. this
  41298. },
  41299. setFromMatrix4: function(e) {
  41300. var t = e.elements;
  41301. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41302. this
  41303. },
  41304. applyToVector3Array: function() {
  41305. var e;
  41306. return function(t, i, r) {
  41307. void 0 === e && (e = new n.Vector3),
  41308. void 0 === i && (i = 0),
  41309. void 0 === r && (r = t.length);
  41310. for (var o = 0, a = i; o < r; o += 3,
  41311. a += 3)
  41312. e.fromArray(t, a),
  41313. e.applyMatrix3(this),
  41314. e.toArray(t, a);
  41315. return t
  41316. }
  41317. }(),
  41318. applyToBuffer: function() {
  41319. var e;
  41320. return function(t, i, r) {
  41321. void 0 === e && (e = new n.Vector3),
  41322. void 0 === i && (i = 0),
  41323. void 0 === r && (r = t.length / t.itemSize);
  41324. for (var o = 0, a = i; o < r; o++,
  41325. a++)
  41326. e.x = t.getX(a),
  41327. e.y = t.getY(a),
  41328. e.z = t.getZ(a),
  41329. e.applyMatrix3(this),
  41330. t.setXYZ(e.x, e.y, e.z);
  41331. return t
  41332. }
  41333. }(),
  41334. multiplyScalar: function(e) {
  41335. var t = this.elements;
  41336. return t[0] *= e,
  41337. t[3] *= e,
  41338. t[6] *= e,
  41339. t[1] *= e,
  41340. t[4] *= e,
  41341. t[7] *= e,
  41342. t[2] *= e,
  41343. t[5] *= e,
  41344. t[8] *= e,
  41345. this
  41346. },
  41347. determinant: function() {
  41348. var e = this.elements
  41349. , t = e[0]
  41350. , i = e[1]
  41351. , n = e[2]
  41352. , r = e[3]
  41353. , o = e[4]
  41354. , a = e[5]
  41355. , s = e[6]
  41356. , l = e[7]
  41357. , c = e[8];
  41358. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41359. },
  41360. getInverse: function(e, t) {
  41361. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41362. var i = e.elements
  41363. , r = this.elements
  41364. , o = i[0]
  41365. , a = i[1]
  41366. , s = i[2]
  41367. , l = i[3]
  41368. , c = i[4]
  41369. , h = i[5]
  41370. , u = i[6]
  41371. , d = i[7]
  41372. , p = i[8]
  41373. , f = p * c - h * d
  41374. , g = h * u - p * l
  41375. , m = d * l - c * u
  41376. , v = o * f + a * g + s * m;
  41377. if (0 === v) {
  41378. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41379. if (t)
  41380. throw new Error(A);
  41381. return console.warn(A),
  41382. this.identity()
  41383. }
  41384. return r[0] = f,
  41385. r[1] = s * d - p * a,
  41386. r[2] = h * a - s * c,
  41387. r[3] = g,
  41388. r[4] = p * o - s * u,
  41389. r[5] = s * l - h * o,
  41390. r[6] = m,
  41391. r[7] = a * u - d * o,
  41392. r[8] = c * o - a * l,
  41393. this.multiplyScalar(1 / v)
  41394. },
  41395. transpose: function() {
  41396. var e, t = this.elements;
  41397. return e = t[1],
  41398. t[1] = t[3],
  41399. t[3] = e,
  41400. e = t[2],
  41401. t[2] = t[6],
  41402. t[6] = e,
  41403. e = t[5],
  41404. t[5] = t[7],
  41405. t[7] = e,
  41406. this
  41407. },
  41408. flattenToArrayOffset: function(e, t) {
  41409. var i = this.elements;
  41410. return e[t] = i[0],
  41411. e[t + 1] = i[1],
  41412. e[t + 2] = i[2],
  41413. e[t + 3] = i[3],
  41414. e[t + 4] = i[4],
  41415. e[t + 5] = i[5],
  41416. e[t + 6] = i[6],
  41417. e[t + 7] = i[7],
  41418. e[t + 8] = i[8],
  41419. e
  41420. },
  41421. getNormalMatrix: function(e) {
  41422. return this.setFromMatrix4(e).getInverse(this).transpose()
  41423. },
  41424. transposeIntoArray: function(e) {
  41425. var t = this.elements;
  41426. return e[0] = t[0],
  41427. e[1] = t[3],
  41428. e[2] = t[6],
  41429. e[3] = t[1],
  41430. e[4] = t[4],
  41431. e[5] = t[7],
  41432. e[6] = t[2],
  41433. e[7] = t[5],
  41434. e[8] = t[8],
  41435. this
  41436. },
  41437. fromArray: function(e) {
  41438. return this.elements.set(e),
  41439. this
  41440. },
  41441. toArray: function() {
  41442. var e = this.elements;
  41443. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41444. }
  41445. },
  41446. n.Matrix4 = function() {
  41447. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41448. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41449. }
  41450. ,
  41451. n.Matrix4.prototype = {
  41452. constructor: n.Matrix4,
  41453. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41454. var m = this.elements;
  41455. return m[0] = e,
  41456. m[4] = t,
  41457. m[8] = i,
  41458. m[12] = n,
  41459. m[1] = r,
  41460. m[5] = o,
  41461. m[9] = a,
  41462. m[13] = s,
  41463. m[2] = l,
  41464. m[6] = c,
  41465. m[10] = h,
  41466. m[14] = u,
  41467. m[3] = d,
  41468. m[7] = p,
  41469. m[11] = f,
  41470. m[15] = g,
  41471. this
  41472. },
  41473. identity: function() {
  41474. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41475. this
  41476. },
  41477. clone: function() {
  41478. return (new n.Matrix4).fromArray(this.elements)
  41479. },
  41480. copy: function(e) {
  41481. return this.elements.set(e.elements),
  41482. this
  41483. },
  41484. copyPosition: function(e) {
  41485. var t = this.elements
  41486. , i = e.elements;
  41487. return t[12] = i[12],
  41488. t[13] = i[13],
  41489. t[14] = i[14],
  41490. this
  41491. },
  41492. extractBasis: function(e, t, i) {
  41493. return e.setFromMatrixColumn(this, 0),
  41494. t.setFromMatrixColumn(this, 1),
  41495. i.setFromMatrixColumn(this, 2),
  41496. this
  41497. },
  41498. makeBasis: function(e, t, i) {
  41499. 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),
  41500. this
  41501. },
  41502. extractRotation: function() {
  41503. var e;
  41504. return function(t) {
  41505. void 0 === e && (e = new n.Vector3);
  41506. var i = this.elements
  41507. , r = t.elements
  41508. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41509. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41510. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41511. return i[0] = r[0] * o,
  41512. i[1] = r[1] * o,
  41513. i[2] = r[2] * o,
  41514. i[4] = r[4] * a,
  41515. i[5] = r[5] * a,
  41516. i[6] = r[6] * a,
  41517. i[8] = r[8] * s,
  41518. i[9] = r[9] * s,
  41519. i[10] = r[10] * s,
  41520. this
  41521. }
  41522. }(),
  41523. makeRotationFromEuler: function(e) {
  41524. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41525. var t = this.elements
  41526. , i = e.x
  41527. , r = e.y
  41528. , o = e.z
  41529. , a = Math.cos(i)
  41530. , s = Math.sin(i)
  41531. , l = Math.cos(r)
  41532. , c = Math.sin(r)
  41533. , h = Math.cos(o)
  41534. , u = Math.sin(o);
  41535. if ("XYZ" === e.order) {
  41536. var d = a * h
  41537. , p = a * u
  41538. , f = s * h
  41539. , g = s * u;
  41540. t[0] = l * h,
  41541. t[4] = -l * u,
  41542. t[8] = c,
  41543. t[1] = p + f * c,
  41544. t[5] = d - g * c,
  41545. t[9] = -s * l,
  41546. t[2] = g - d * c,
  41547. t[6] = f + p * c,
  41548. t[10] = a * l
  41549. } else if ("YXZ" === e.order) {
  41550. var m = l * h
  41551. , v = l * u
  41552. , A = c * h
  41553. , y = c * u;
  41554. t[0] = m + y * s,
  41555. t[4] = A * s - v,
  41556. t[8] = a * c,
  41557. t[1] = a * u,
  41558. t[5] = a * h,
  41559. t[9] = -s,
  41560. t[2] = v * s - A,
  41561. t[6] = y + m * s,
  41562. t[10] = a * l
  41563. } else if ("ZXY" === e.order) {
  41564. var m = l * h
  41565. , v = l * u
  41566. , A = c * h
  41567. , y = c * u;
  41568. t[0] = m - y * s,
  41569. t[4] = -a * u,
  41570. t[8] = A + v * s,
  41571. t[1] = v + A * s,
  41572. t[5] = a * h,
  41573. t[9] = y - m * s,
  41574. t[2] = -a * c,
  41575. t[6] = s,
  41576. t[10] = a * l
  41577. } else if ("ZYX" === e.order) {
  41578. var d = a * h
  41579. , p = a * u
  41580. , f = s * h
  41581. , g = s * u;
  41582. t[0] = l * h,
  41583. t[4] = f * c - p,
  41584. t[8] = d * c + g,
  41585. t[1] = l * u,
  41586. t[5] = g * c + d,
  41587. t[9] = p * c - f,
  41588. t[2] = -c,
  41589. t[6] = s * l,
  41590. t[10] = a * l
  41591. } else if ("YZX" === e.order) {
  41592. var C = a * l
  41593. , I = a * c
  41594. , E = s * l
  41595. , b = s * c;
  41596. t[0] = l * h,
  41597. t[4] = b - C * u,
  41598. t[8] = E * u + I,
  41599. t[1] = u,
  41600. t[5] = a * h,
  41601. t[9] = -s * h,
  41602. t[2] = -c * h,
  41603. t[6] = I * u + E,
  41604. t[10] = C - b * u
  41605. } else if ("XZY" === e.order) {
  41606. var C = a * l
  41607. , I = a * c
  41608. , E = s * l
  41609. , b = s * c;
  41610. t[0] = l * h,
  41611. t[4] = -u,
  41612. t[8] = c * h,
  41613. t[1] = C * u + b,
  41614. t[5] = a * h,
  41615. t[9] = I * u - E,
  41616. t[2] = E * u - I,
  41617. t[6] = s * h,
  41618. t[10] = b * u + C
  41619. }
  41620. return t[3] = 0,
  41621. t[7] = 0,
  41622. t[11] = 0,
  41623. t[12] = 0,
  41624. t[13] = 0,
  41625. t[14] = 0,
  41626. t[15] = 1,
  41627. this
  41628. },
  41629. makeRotationFromQuaternion: function(e) {
  41630. var t = this.elements
  41631. , i = e.x
  41632. , n = e.y
  41633. , r = e.z
  41634. , o = e.w
  41635. , a = i + i
  41636. , s = n + n
  41637. , l = r + r
  41638. , c = i * a
  41639. , h = i * s
  41640. , u = i * l
  41641. , d = n * s
  41642. , p = n * l
  41643. , f = r * l
  41644. , g = o * a
  41645. , m = o * s
  41646. , v = o * l;
  41647. return t[0] = 1 - (d + f),
  41648. t[4] = h - v,
  41649. t[8] = u + m,
  41650. t[1] = h + v,
  41651. t[5] = 1 - (c + f),
  41652. t[9] = p - g,
  41653. t[2] = u - m,
  41654. t[6] = p + g,
  41655. t[10] = 1 - (c + d),
  41656. t[3] = 0,
  41657. t[7] = 0,
  41658. t[11] = 0,
  41659. t[12] = 0,
  41660. t[13] = 0,
  41661. t[14] = 0,
  41662. t[15] = 1,
  41663. this
  41664. },
  41665. lookAt: function() {
  41666. var e, t, i;
  41667. return function(r, o, a) {
  41668. void 0 === e && (e = new n.Vector3),
  41669. void 0 === t && (t = new n.Vector3),
  41670. void 0 === i && (i = new n.Vector3);
  41671. var s = this.elements;
  41672. return i.subVectors(r, o).normalize(),
  41673. 0 === i.lengthSq() && (i.z = 1),
  41674. e.crossVectors(a, i).normalize(),
  41675. 0 === e.lengthSq() && (i.x += 1e-4,
  41676. e.crossVectors(a, i).normalize()),
  41677. t.crossVectors(i, e),
  41678. s[0] = e.x,
  41679. s[4] = t.x,
  41680. s[8] = i.x,
  41681. s[1] = e.y,
  41682. s[5] = t.y,
  41683. s[9] = i.y,
  41684. s[2] = e.z,
  41685. s[6] = t.z,
  41686. s[10] = i.z,
  41687. this
  41688. }
  41689. }(),
  41690. multiply: function(e, t) {
  41691. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41692. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41693. },
  41694. multiplyMatrices: function(e, t) {
  41695. var i = e.elements
  41696. , n = t.elements
  41697. , r = this.elements
  41698. , o = i[0]
  41699. , a = i[4]
  41700. , s = i[8]
  41701. , l = i[12]
  41702. , c = i[1]
  41703. , h = i[5]
  41704. , u = i[9]
  41705. , d = i[13]
  41706. , p = i[2]
  41707. , f = i[6]
  41708. , g = i[10]
  41709. , m = i[14]
  41710. , v = i[3]
  41711. , A = i[7]
  41712. , y = i[11]
  41713. , C = i[15]
  41714. , I = n[0]
  41715. , E = n[4]
  41716. , b = n[8]
  41717. , w = n[12]
  41718. , _ = n[1]
  41719. , T = n[5]
  41720. , x = n[9]
  41721. , S = n[13]
  41722. , M = n[2]
  41723. , R = n[6]
  41724. , P = n[10]
  41725. , O = n[14]
  41726. , L = n[3]
  41727. , D = n[7]
  41728. , N = n[11]
  41729. , B = n[15];
  41730. return r[0] = o * I + a * _ + s * M + l * L,
  41731. r[4] = o * E + a * T + s * R + l * D,
  41732. r[8] = o * b + a * x + s * P + l * N,
  41733. r[12] = o * w + a * S + s * O + l * B,
  41734. r[1] = c * I + h * _ + u * M + d * L,
  41735. r[5] = c * E + h * T + u * R + d * D,
  41736. r[9] = c * b + h * x + u * P + d * N,
  41737. r[13] = c * w + h * S + u * O + d * B,
  41738. r[2] = p * I + f * _ + g * M + m * L,
  41739. r[6] = p * E + f * T + g * R + m * D,
  41740. r[10] = p * b + f * x + g * P + m * N,
  41741. r[14] = p * w + f * S + g * O + m * B,
  41742. r[3] = v * I + A * _ + y * M + C * L,
  41743. r[7] = v * E + A * T + y * R + C * D,
  41744. r[11] = v * b + A * x + y * P + C * N,
  41745. r[15] = v * w + A * S + y * O + C * B,
  41746. this
  41747. },
  41748. multiplyToArray: function(e, t, i) {
  41749. var n = this.elements;
  41750. return this.multiplyMatrices(e, t),
  41751. i[0] = n[0],
  41752. i[1] = n[1],
  41753. i[2] = n[2],
  41754. i[3] = n[3],
  41755. i[4] = n[4],
  41756. i[5] = n[5],
  41757. i[6] = n[6],
  41758. i[7] = n[7],
  41759. i[8] = n[8],
  41760. i[9] = n[9],
  41761. i[10] = n[10],
  41762. i[11] = n[11],
  41763. i[12] = n[12],
  41764. i[13] = n[13],
  41765. i[14] = n[14],
  41766. i[15] = n[15],
  41767. this
  41768. },
  41769. multiplyScalar: function(e) {
  41770. var t = this.elements;
  41771. return t[0] *= e,
  41772. t[4] *= e,
  41773. t[8] *= e,
  41774. t[12] *= e,
  41775. t[1] *= e,
  41776. t[5] *= e,
  41777. t[9] *= e,
  41778. t[13] *= e,
  41779. t[2] *= e,
  41780. t[6] *= e,
  41781. t[10] *= e,
  41782. t[14] *= e,
  41783. t[3] *= e,
  41784. t[7] *= e,
  41785. t[11] *= e,
  41786. t[15] *= e,
  41787. this
  41788. },
  41789. applyToVector3Array: function() {
  41790. var e;
  41791. return function(t, i, r) {
  41792. void 0 === e && (e = new n.Vector3),
  41793. void 0 === i && (i = 0),
  41794. void 0 === r && (r = t.length);
  41795. for (var o = 0, a = i; o < r; o += 3,
  41796. a += 3)
  41797. e.fromArray(t, a),
  41798. e.applyMatrix4(this),
  41799. e.toArray(t, a);
  41800. return t
  41801. }
  41802. }(),
  41803. applyToBuffer: function() {
  41804. var e;
  41805. return function(t, i, r) {
  41806. void 0 === e && (e = new n.Vector3),
  41807. void 0 === i && (i = 0),
  41808. void 0 === r && (r = t.length / t.itemSize);
  41809. for (var o = 0, a = i; o < r; o++,
  41810. a++)
  41811. e.x = t.getX(a),
  41812. e.y = t.getY(a),
  41813. e.z = t.getZ(a),
  41814. e.applyMatrix4(this),
  41815. t.setXYZ(e.x, e.y, e.z);
  41816. return t
  41817. }
  41818. }(),
  41819. determinant: function() {
  41820. var e = this.elements
  41821. , t = e[0]
  41822. , i = e[4]
  41823. , n = e[8]
  41824. , r = e[12]
  41825. , o = e[1]
  41826. , a = e[5]
  41827. , s = e[9]
  41828. , l = e[13]
  41829. , c = e[2]
  41830. , h = e[6]
  41831. , u = e[10]
  41832. , d = e[14]
  41833. , p = e[3]
  41834. , f = e[7]
  41835. , g = e[11]
  41836. , m = e[15];
  41837. 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)
  41838. },
  41839. transpose: function() {
  41840. var e, t = this.elements;
  41841. return e = t[1],
  41842. t[1] = t[4],
  41843. t[4] = e,
  41844. e = t[2],
  41845. t[2] = t[8],
  41846. t[8] = e,
  41847. e = t[6],
  41848. t[6] = t[9],
  41849. t[9] = e,
  41850. e = t[3],
  41851. t[3] = t[12],
  41852. t[12] = e,
  41853. e = t[7],
  41854. t[7] = t[13],
  41855. t[13] = e,
  41856. e = t[11],
  41857. t[11] = t[14],
  41858. t[14] = e,
  41859. this
  41860. },
  41861. flattenToArrayOffset: function(e, t) {
  41862. var i = this.elements;
  41863. return e[t] = i[0],
  41864. e[t + 1] = i[1],
  41865. e[t + 2] = i[2],
  41866. e[t + 3] = i[3],
  41867. e[t + 4] = i[4],
  41868. e[t + 5] = i[5],
  41869. e[t + 6] = i[6],
  41870. e[t + 7] = i[7],
  41871. e[t + 8] = i[8],
  41872. e[t + 9] = i[9],
  41873. e[t + 10] = i[10],
  41874. e[t + 11] = i[11],
  41875. e[t + 12] = i[12],
  41876. e[t + 13] = i[13],
  41877. e[t + 14] = i[14],
  41878. e[t + 15] = i[15],
  41879. e
  41880. },
  41881. getPosition: function() {
  41882. var e;
  41883. return function() {
  41884. return void 0 === e && (e = new n.Vector3),
  41885. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  41886. e.setFromMatrixColumn(this, 3)
  41887. }
  41888. }(),
  41889. setPosition: function(e) {
  41890. var t = this.elements;
  41891. return t[12] = e.x,
  41892. t[13] = e.y,
  41893. t[14] = e.z,
  41894. this
  41895. },
  41896. getInverse: function(e, t) {
  41897. var i = this.elements
  41898. , n = e.elements
  41899. , r = n[0]
  41900. , o = n[1]
  41901. , a = n[2]
  41902. , s = n[3]
  41903. , l = n[4]
  41904. , c = n[5]
  41905. , h = n[6]
  41906. , u = n[7]
  41907. , d = n[8]
  41908. , p = n[9]
  41909. , f = n[10]
  41910. , g = n[11]
  41911. , m = n[12]
  41912. , v = n[13]
  41913. , A = n[14]
  41914. , y = n[15]
  41915. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  41916. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  41917. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  41918. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  41919. , w = r * C + o * I + a * E + s * b;
  41920. if (0 === w) {
  41921. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  41922. if (t)
  41923. throw new Error(_);
  41924. return console.warn(_),
  41925. this.identity()
  41926. }
  41927. return i[0] = C,
  41928. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  41929. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  41930. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  41931. i[4] = I,
  41932. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  41933. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  41934. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  41935. i[8] = E,
  41936. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  41937. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  41938. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  41939. i[12] = b,
  41940. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  41941. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  41942. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  41943. this.multiplyScalar(1 / w)
  41944. },
  41945. scale: function(e) {
  41946. var t = this.elements
  41947. , i = e.x
  41948. , n = e.y
  41949. , r = e.z;
  41950. return t[0] *= i,
  41951. t[4] *= n,
  41952. t[8] *= r,
  41953. t[1] *= i,
  41954. t[5] *= n,
  41955. t[9] *= r,
  41956. t[2] *= i,
  41957. t[6] *= n,
  41958. t[10] *= r,
  41959. t[3] *= i,
  41960. t[7] *= n,
  41961. t[11] *= r,
  41962. this
  41963. },
  41964. getMaxScaleOnAxis: function() {
  41965. var e = this.elements
  41966. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  41967. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  41968. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  41969. return Math.sqrt(Math.max(t, i, n))
  41970. },
  41971. makeTranslation: function(e, t, i) {
  41972. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  41973. this
  41974. },
  41975. makeRotationX: function(e) {
  41976. var t = Math.cos(e)
  41977. , i = Math.sin(e);
  41978. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  41979. this
  41980. },
  41981. makeRotationY: function(e) {
  41982. var t = Math.cos(e)
  41983. , i = Math.sin(e);
  41984. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  41985. this
  41986. },
  41987. makeRotationZ: function(e) {
  41988. var t = Math.cos(e)
  41989. , i = Math.sin(e);
  41990. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41991. this
  41992. },
  41993. makeRotationAxis: function(e, t) {
  41994. var i = Math.cos(t)
  41995. , n = Math.sin(t)
  41996. , r = 1 - i
  41997. , o = e.x
  41998. , a = e.y
  41999. , s = e.z
  42000. , l = r * o
  42001. , c = r * a;
  42002. 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),
  42003. this
  42004. },
  42005. makeScale: function(e, t, i) {
  42006. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42007. this
  42008. },
  42009. compose: function(e, t, i) {
  42010. return this.makeRotationFromQuaternion(t),
  42011. this.scale(i),
  42012. this.setPosition(e),
  42013. this
  42014. },
  42015. decompose: function() {
  42016. var e, t;
  42017. return function(i, r, o) {
  42018. void 0 === e && (e = new n.Vector3),
  42019. void 0 === t && (t = new n.Matrix4);
  42020. var a = this.elements
  42021. , s = e.set(a[0], a[1], a[2]).length()
  42022. , l = e.set(a[4], a[5], a[6]).length()
  42023. , c = e.set(a[8], a[9], a[10]).length()
  42024. , h = this.determinant();
  42025. h < 0 && (s = -s),
  42026. i.x = a[12],
  42027. i.y = a[13],
  42028. i.z = a[14],
  42029. t.elements.set(this.elements);
  42030. var u = 1 / s
  42031. , d = 1 / l
  42032. , p = 1 / c;
  42033. return t.elements[0] *= u,
  42034. t.elements[1] *= u,
  42035. t.elements[2] *= u,
  42036. t.elements[4] *= d,
  42037. t.elements[5] *= d,
  42038. t.elements[6] *= d,
  42039. t.elements[8] *= p,
  42040. t.elements[9] *= p,
  42041. t.elements[10] *= p,
  42042. r.setFromRotationMatrix(t),
  42043. o.x = s,
  42044. o.y = l,
  42045. o.z = c,
  42046. this
  42047. }
  42048. }(),
  42049. makeFrustum: function(e, t, i, n, r, o) {
  42050. var a = this.elements
  42051. , s = 2 * r / (t - e)
  42052. , l = 2 * r / (n - i)
  42053. , c = (t + e) / (t - e)
  42054. , h = (n + i) / (n - i)
  42055. , u = -(o + r) / (o - r)
  42056. , d = -2 * o * r / (o - r);
  42057. return a[0] = s,
  42058. a[4] = 0,
  42059. a[8] = c,
  42060. a[12] = 0,
  42061. a[1] = 0,
  42062. a[5] = l,
  42063. a[9] = h,
  42064. a[13] = 0,
  42065. a[2] = 0,
  42066. a[6] = 0,
  42067. a[10] = u,
  42068. a[14] = d,
  42069. a[3] = 0,
  42070. a[7] = 0,
  42071. a[11] = -1,
  42072. a[15] = 0,
  42073. this
  42074. },
  42075. makePerspective: function(e, t, i, r) {
  42076. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42077. , a = -o
  42078. , s = a * t
  42079. , l = o * t;
  42080. return this.makeFrustum(s, l, a, o, i, r)
  42081. },
  42082. makeOrthographic: function(e, t, i, n, r, o) {
  42083. var a = this.elements
  42084. , s = 1 / (t - e)
  42085. , l = 1 / (i - n)
  42086. , c = 1 / (o - r)
  42087. , h = (t + e) * s
  42088. , u = (i + n) * l
  42089. , d = (o + r) * c;
  42090. return a[0] = 2 * s,
  42091. a[4] = 0,
  42092. a[8] = 0,
  42093. a[12] = -h,
  42094. a[1] = 0,
  42095. a[5] = 2 * l,
  42096. a[9] = 0,
  42097. a[13] = -u,
  42098. a[2] = 0,
  42099. a[6] = 0,
  42100. a[10] = -2 * c,
  42101. a[14] = -d,
  42102. a[3] = 0,
  42103. a[7] = 0,
  42104. a[11] = 0,
  42105. a[15] = 1,
  42106. this
  42107. },
  42108. equals: function(e) {
  42109. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42110. if (t[n] !== i[n])
  42111. return !1;
  42112. return !0
  42113. },
  42114. fromArray: function(e) {
  42115. return this.elements.set(e),
  42116. this
  42117. },
  42118. toArray: function() {
  42119. var e = this.elements;
  42120. 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]]
  42121. }
  42122. },
  42123. n.Ray = function(e, t) {
  42124. this.origin = void 0 !== e ? e : new n.Vector3,
  42125. this.direction = void 0 !== t ? t : new n.Vector3
  42126. }
  42127. ,
  42128. n.Ray.prototype = {
  42129. constructor: n.Ray,
  42130. set: function(e, t) {
  42131. return this.origin.copy(e),
  42132. this.direction.copy(t),
  42133. this
  42134. },
  42135. clone: function() {
  42136. return (new this.constructor).copy(this)
  42137. },
  42138. copy: function(e) {
  42139. return this.origin.copy(e.origin),
  42140. this.direction.copy(e.direction),
  42141. this
  42142. },
  42143. at: function(e, t) {
  42144. var i = t || new n.Vector3;
  42145. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42146. },
  42147. lookAt: function(e) {
  42148. this.direction.copy(e).sub(this.origin).normalize()
  42149. },
  42150. recast: function() {
  42151. var e = new n.Vector3;
  42152. return function(t) {
  42153. return this.origin.copy(this.at(t, e)),
  42154. this
  42155. }
  42156. }(),
  42157. closestPointToPoint: function(e, t) {
  42158. var i = t || new n.Vector3;
  42159. i.subVectors(e, this.origin);
  42160. var r = i.dot(this.direction);
  42161. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42162. },
  42163. distanceToPoint: function(e) {
  42164. return Math.sqrt(this.distanceSqToPoint(e))
  42165. },
  42166. distanceSqToPoint: function() {
  42167. var e = new n.Vector3;
  42168. return function(t) {
  42169. var i = e.subVectors(t, this.origin).dot(this.direction);
  42170. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42171. e.distanceToSquared(t))
  42172. }
  42173. }(),
  42174. distanceSqToSegment: function() {
  42175. var e = new n.Vector3
  42176. , t = new n.Vector3
  42177. , i = new n.Vector3;
  42178. return function(n, r, o, a) {
  42179. e.copy(n).add(r).multiplyScalar(.5),
  42180. t.copy(r).sub(n).normalize(),
  42181. i.copy(this.origin).sub(e);
  42182. 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);
  42183. if (m > 0)
  42184. if (s = d * f - p,
  42185. l = d * p - f,
  42186. h = u * m,
  42187. s >= 0)
  42188. if (l >= -h)
  42189. if (l <= h) {
  42190. var v = 1 / m;
  42191. s *= v,
  42192. l *= v,
  42193. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42194. } else
  42195. l = u,
  42196. s = Math.max(0, -(d * l + p)),
  42197. c = -s * s + l * (l + 2 * f) + g;
  42198. else
  42199. l = -u,
  42200. s = Math.max(0, -(d * l + p)),
  42201. c = -s * s + l * (l + 2 * f) + g;
  42202. else
  42203. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42204. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42205. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42206. l = Math.min(Math.max(-u, -f), u),
  42207. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42208. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42209. c = -s * s + l * (l + 2 * f) + g);
  42210. else
  42211. l = d > 0 ? -u : u,
  42212. s = Math.max(0, -(d * l + p)),
  42213. c = -s * s + l * (l + 2 * f) + g;
  42214. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42215. a && a.copy(t).multiplyScalar(l).add(e),
  42216. c
  42217. }
  42218. }(),
  42219. intersectSphere: function() {
  42220. var e = new n.Vector3;
  42221. return function(t, i) {
  42222. e.subVectors(t.center, this.origin);
  42223. var n = e.dot(this.direction)
  42224. , r = e.dot(e) - n * n
  42225. , o = t.radius * t.radius;
  42226. if (r > o)
  42227. return null;
  42228. var a = Math.sqrt(o - r)
  42229. , s = n - a
  42230. , l = n + a;
  42231. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42232. }
  42233. }(),
  42234. intersectsSphere: function(e) {
  42235. return this.distanceToPoint(e.center) <= e.radius
  42236. },
  42237. distanceToPlane: function(e) {
  42238. var t = e.normal.dot(this.direction);
  42239. if (0 === t)
  42240. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42241. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42242. return i >= 0 ? i : null
  42243. },
  42244. intersectPlane: function(e, t) {
  42245. var i = this.distanceToPlane(e);
  42246. return null === i ? null : this.at(i, t)
  42247. },
  42248. intersectsPlane: function(e) {
  42249. var t = e.distanceToPoint(this.origin);
  42250. if (0 === t)
  42251. return !0;
  42252. var i = e.normal.dot(this.direction);
  42253. return i * t < 0
  42254. },
  42255. intersectBox: function(e, t) {
  42256. 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;
  42257. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42258. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42259. n = (e.min.x - u.x) * l),
  42260. c >= 0 ? (r = (e.min.y - u.y) * c,
  42261. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42262. o = (e.min.y - u.y) * c),
  42263. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42264. (o < n || n !== n) && (n = o),
  42265. h >= 0 ? (a = (e.min.z - u.z) * h,
  42266. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42267. s = (e.min.z - u.z) * h),
  42268. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42269. (s < n || n !== n) && (n = s),
  42270. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42271. },
  42272. intersectsBox: function() {
  42273. var e = new n.Vector3;
  42274. return function(t) {
  42275. return null !== this.intersectBox(t, e)
  42276. }
  42277. }(),
  42278. intersectTriangle: function() {
  42279. var e = new n.Vector3
  42280. , t = new n.Vector3
  42281. , i = new n.Vector3
  42282. , r = new n.Vector3;
  42283. return function(n, o, a, s, l) {
  42284. t.subVectors(o, n),
  42285. i.subVectors(a, n),
  42286. r.crossVectors(t, i);
  42287. var c, h = this.direction.dot(r);
  42288. if (h > 0) {
  42289. if (s)
  42290. return null;
  42291. c = 1
  42292. } else {
  42293. if (!(h < 0))
  42294. return null;
  42295. c = -1,
  42296. h = -h
  42297. }
  42298. e.subVectors(this.origin, n);
  42299. var u = c * this.direction.dot(i.crossVectors(e, i));
  42300. if (u < 0)
  42301. return null;
  42302. var d = c * this.direction.dot(t.cross(e));
  42303. if (d < 0)
  42304. return null;
  42305. if (u + d > h)
  42306. return null;
  42307. var p = -c * e.dot(r);
  42308. return p < 0 ? null : this.at(p / h, l)
  42309. }
  42310. }(),
  42311. applyMatrix4: function(e) {
  42312. return this.direction.add(this.origin).applyMatrix4(e),
  42313. this.origin.applyMatrix4(e),
  42314. this.direction.sub(this.origin),
  42315. this.direction.normalize(),
  42316. this
  42317. },
  42318. equals: function(e) {
  42319. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42320. }
  42321. },
  42322. n.Sphere = function(e, t) {
  42323. this.center = void 0 !== e ? e : new n.Vector3,
  42324. this.radius = void 0 !== t ? t : 0
  42325. }
  42326. ,
  42327. n.Sphere.prototype = {
  42328. constructor: n.Sphere,
  42329. set: function(e, t) {
  42330. return this.center.copy(e),
  42331. this.radius = t,
  42332. this
  42333. },
  42334. setFromPoints: function() {
  42335. var e = new n.Box3;
  42336. return function(t, i) {
  42337. var n = this.center;
  42338. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42339. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42340. r = Math.max(r, n.distanceToSquared(t[o]));
  42341. return this.radius = Math.sqrt(r),
  42342. this
  42343. }
  42344. }(),
  42345. clone: function() {
  42346. return (new this.constructor).copy(this)
  42347. },
  42348. copy: function(e) {
  42349. return this.center.copy(e.center),
  42350. this.radius = e.radius,
  42351. this
  42352. },
  42353. empty: function() {
  42354. return this.radius <= 0
  42355. },
  42356. containsPoint: function(e) {
  42357. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42358. },
  42359. distanceToPoint: function(e) {
  42360. return e.distanceTo(this.center) - this.radius
  42361. },
  42362. intersectsSphere: function(e) {
  42363. var t = this.radius + e.radius;
  42364. return e.center.distanceToSquared(this.center) <= t * t
  42365. },
  42366. intersectsBox: function(e) {
  42367. return e.intersectsSphere(this)
  42368. },
  42369. intersectsPlane: function(e) {
  42370. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42371. },
  42372. clampPoint: function(e, t) {
  42373. var i = this.center.distanceToSquared(e)
  42374. , r = t || new n.Vector3;
  42375. return r.copy(e),
  42376. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42377. r.multiplyScalar(this.radius).add(this.center)),
  42378. r
  42379. },
  42380. getBoundingBox: function(e) {
  42381. var t = e || new n.Box3;
  42382. return t.set(this.center, this.center),
  42383. t.expandByScalar(this.radius),
  42384. t
  42385. },
  42386. applyMatrix4: function(e) {
  42387. return this.center.applyMatrix4(e),
  42388. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42389. this
  42390. },
  42391. translate: function(e) {
  42392. return this.center.add(e),
  42393. this
  42394. },
  42395. equals: function(e) {
  42396. return e.center.equals(this.center) && e.radius === this.radius
  42397. }
  42398. },
  42399. n.Frustum = function(e, t, i, r, o, a) {
  42400. 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]
  42401. }
  42402. ,
  42403. n.Frustum.prototype = {
  42404. constructor: n.Frustum,
  42405. set: function(e, t, i, n, r, o) {
  42406. var a = this.planes;
  42407. return a[0].copy(e),
  42408. a[1].copy(t),
  42409. a[2].copy(i),
  42410. a[3].copy(n),
  42411. a[4].copy(r),
  42412. a[5].copy(o),
  42413. this
  42414. },
  42415. clone: function() {
  42416. return (new this.constructor).copy(this)
  42417. },
  42418. copy: function(e) {
  42419. for (var t = this.planes, i = 0; i < 6; i++)
  42420. t[i].copy(e.planes[i]);
  42421. return this
  42422. },
  42423. setFromMatrix: function(e) {
  42424. var t = this.planes
  42425. , i = e.elements
  42426. , n = i[0]
  42427. , r = i[1]
  42428. , o = i[2]
  42429. , a = i[3]
  42430. , s = i[4]
  42431. , l = i[5]
  42432. , c = i[6]
  42433. , h = i[7]
  42434. , u = i[8]
  42435. , d = i[9]
  42436. , p = i[10]
  42437. , f = i[11]
  42438. , g = i[12]
  42439. , m = i[13]
  42440. , v = i[14]
  42441. , A = i[15];
  42442. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42443. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42444. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42445. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42446. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42447. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42448. this
  42449. },
  42450. intersectsObject: function() {
  42451. var e = new n.Sphere;
  42452. return function(t) {
  42453. var i = t.geometry;
  42454. return null === i.boundingSphere && i.computeBoundingSphere(),
  42455. e.copy(i.boundingSphere),
  42456. e.applyMatrix4(t.matrixWorld),
  42457. this.intersectsSphere(e)
  42458. }
  42459. }(),
  42460. intersectsSphere: function(e) {
  42461. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42462. var o = t[r].distanceToPoint(i);
  42463. if (o < n)
  42464. return !1
  42465. }
  42466. return !0
  42467. },
  42468. intersectsBox: function() {
  42469. var e = new n.Vector3
  42470. , t = new n.Vector3;
  42471. return function(i) {
  42472. for (var n = this.planes, r = 0; r < 6; r++) {
  42473. var o = n[r];
  42474. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42475. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42476. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42477. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42478. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42479. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42480. var a = o.distanceToPoint(e)
  42481. , s = o.distanceToPoint(t);
  42482. if (a < 0 && s < 0)
  42483. return !1
  42484. }
  42485. return !0
  42486. }
  42487. }(),
  42488. containsPoint: function(e) {
  42489. for (var t = this.planes, i = 0; i < 6; i++)
  42490. if (t[i].distanceToPoint(e) < 0)
  42491. return !1;
  42492. return !0
  42493. }
  42494. },
  42495. n.Plane = function(e, t) {
  42496. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42497. this.constant = void 0 !== t ? t : 0
  42498. }
  42499. ,
  42500. n.Plane.prototype = {
  42501. constructor: n.Plane,
  42502. set: function(e, t) {
  42503. return this.normal.copy(e),
  42504. this.constant = t,
  42505. this
  42506. },
  42507. setComponents: function(e, t, i, n) {
  42508. return this.normal.set(e, t, i),
  42509. this.constant = n,
  42510. this
  42511. },
  42512. setFromNormalAndCoplanarPoint: function(e, t) {
  42513. return this.normal.copy(e),
  42514. this.constant = -t.dot(this.normal),
  42515. this
  42516. },
  42517. setFromCoplanarPoints: function() {
  42518. var e = new n.Vector3
  42519. , t = new n.Vector3;
  42520. return function(i, n, r) {
  42521. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42522. return this.setFromNormalAndCoplanarPoint(o, i),
  42523. this
  42524. }
  42525. }(),
  42526. clone: function() {
  42527. return (new this.constructor).copy(this)
  42528. },
  42529. copy: function(e) {
  42530. return this.normal.copy(e.normal),
  42531. this.constant = e.constant,
  42532. this
  42533. },
  42534. normalize: function() {
  42535. var e = 1 / this.normal.length();
  42536. return this.normal.multiplyScalar(e),
  42537. this.constant *= e,
  42538. this
  42539. },
  42540. negate: function() {
  42541. return this.constant *= -1,
  42542. this.normal.negate(),
  42543. this
  42544. },
  42545. distanceToPoint: function(e) {
  42546. return this.normal.dot(e) + this.constant
  42547. },
  42548. distanceToSphere: function(e) {
  42549. return this.distanceToPoint(e.center) - e.radius
  42550. },
  42551. projectPoint: function(e, t) {
  42552. return this.orthoPoint(e, t).sub(e).negate()
  42553. },
  42554. orthoPoint: function(e, t) {
  42555. var i = this.distanceToPoint(e)
  42556. , r = t || new n.Vector3;
  42557. return r.copy(this.normal).multiplyScalar(i)
  42558. },
  42559. intersectLine: function() {
  42560. var e = new n.Vector3;
  42561. return function(t, i) {
  42562. var r = i || new n.Vector3
  42563. , o = t.delta(e)
  42564. , a = this.normal.dot(o);
  42565. if (0 !== a) {
  42566. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42567. if (!(s < 0 || s > 1))
  42568. return r.copy(o).multiplyScalar(s).add(t.start)
  42569. } else if (0 === this.distanceToPoint(t.start))
  42570. return r.copy(t.start)
  42571. }
  42572. }(),
  42573. intersectsLine: function(e) {
  42574. var t = this.distanceToPoint(e.start)
  42575. , i = this.distanceToPoint(e.end);
  42576. return t < 0 && i > 0 || i < 0 && t > 0
  42577. },
  42578. intersectsBox: function(e) {
  42579. return e.intersectsPlane(this)
  42580. },
  42581. intersectsSphere: function(e) {
  42582. return e.intersectsPlane(this)
  42583. },
  42584. coplanarPoint: function(e) {
  42585. var t = e || new n.Vector3;
  42586. return t.copy(this.normal).multiplyScalar(-this.constant)
  42587. },
  42588. applyMatrix4: function() {
  42589. var e = new n.Vector3
  42590. , t = new n.Vector3
  42591. , i = new n.Matrix3;
  42592. return function(n, r) {
  42593. var o = r || i.getNormalMatrix(n)
  42594. , a = e.copy(this.normal).applyMatrix3(o)
  42595. , s = this.coplanarPoint(t);
  42596. return s.applyMatrix4(n),
  42597. this.setFromNormalAndCoplanarPoint(a, s),
  42598. this
  42599. }
  42600. }(),
  42601. translate: function(e) {
  42602. return this.constant = this.constant - e.dot(this.normal),
  42603. this
  42604. },
  42605. equals: function(e) {
  42606. return e.normal.equals(this.normal) && e.constant === this.constant
  42607. }
  42608. },
  42609. n.Spherical = function(e, t, i) {
  42610. return this.radius = void 0 !== e ? e : 1,
  42611. this.phi = void 0 !== t ? t : 0,
  42612. this.theta = void 0 !== i ? i : 0,
  42613. this
  42614. }
  42615. ,
  42616. n.Spherical.prototype = {
  42617. constructor: n.Spherical,
  42618. set: function(e, t, i) {
  42619. this.radius = e,
  42620. this.phi = t,
  42621. this.theta = i
  42622. },
  42623. clone: function() {
  42624. return (new this.constructor).copy(this)
  42625. },
  42626. copy: function(e) {
  42627. return this.radius.copy(e.radius),
  42628. this.phi.copy(e.phi),
  42629. this.theta.copy(e.theta),
  42630. this
  42631. },
  42632. makeSafe: function() {
  42633. var e = 1e-6;
  42634. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42635. },
  42636. setFromVector3: function(e) {
  42637. return this.radius = e.length(),
  42638. 0 === this.radius ? (this.theta = 0,
  42639. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42640. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42641. this
  42642. }
  42643. },
  42644. n.Math = {
  42645. generateUUID: function() {
  42646. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42647. return function() {
  42648. for (var r = 0; r < 36; r++)
  42649. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42650. e = 15 & n,
  42651. n >>= 4,
  42652. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42653. return i.join("")
  42654. }
  42655. }(),
  42656. clamp: function(e, t, i) {
  42657. return Math.max(t, Math.min(i, e))
  42658. },
  42659. euclideanModulo: function(e, t) {
  42660. return (e % t + t) % t
  42661. },
  42662. mapLinear: function(e, t, i, n, r) {
  42663. return n + (e - t) * (r - n) / (i - t)
  42664. },
  42665. smoothstep: function(e, t, i) {
  42666. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42667. e * e * (3 - 2 * e))
  42668. },
  42669. smootherstep: function(e, t, i) {
  42670. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42671. e * e * e * (e * (6 * e - 15) + 10))
  42672. },
  42673. random16: function() {
  42674. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42675. Math.random()
  42676. },
  42677. randInt: function(e, t) {
  42678. return e + Math.floor(Math.random() * (t - e + 1))
  42679. },
  42680. randFloat: function(e, t) {
  42681. return e + Math.random() * (t - e)
  42682. },
  42683. randFloatSpread: function(e) {
  42684. return e * (.5 - Math.random())
  42685. },
  42686. degToRad: function() {
  42687. var e = Math.PI / 180;
  42688. return function(t) {
  42689. return t * e
  42690. }
  42691. }(),
  42692. radToDeg: function() {
  42693. var e = 180 / Math.PI;
  42694. return function(t) {
  42695. return t * e
  42696. }
  42697. }(),
  42698. isPowerOfTwo: function(e) {
  42699. return 0 === (e & e - 1) && 0 !== e
  42700. },
  42701. nearestPowerOfTwo: function(e) {
  42702. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42703. },
  42704. nextPowerOfTwo: function(e) {
  42705. return e--,
  42706. e |= e >> 1,
  42707. e |= e >> 2,
  42708. e |= e >> 4,
  42709. e |= e >> 8,
  42710. e |= e >> 16,
  42711. e++,
  42712. e
  42713. }
  42714. },
  42715. n.Spline = function(e) {
  42716. function t(e, t, i, n, r, o, a) {
  42717. var s = .5 * (i - e)
  42718. , l = .5 * (n - t);
  42719. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42720. }
  42721. this.points = e;
  42722. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42723. x: 0,
  42724. y: 0,
  42725. z: 0
  42726. };
  42727. this.initFromArray = function(e) {
  42728. this.points = [];
  42729. for (var t = 0; t < e.length; t++)
  42730. this.points[t] = {
  42731. x: e[t][0],
  42732. y: e[t][1],
  42733. z: e[t][2]
  42734. }
  42735. }
  42736. ,
  42737. this.getPoint = function(e) {
  42738. return i = (this.points.length - 1) * e,
  42739. r = Math.floor(i),
  42740. o = i - r,
  42741. d[0] = 0 === r ? r : r - 1,
  42742. d[1] = r,
  42743. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42744. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42745. l = this.points[d[0]],
  42746. c = this.points[d[1]],
  42747. h = this.points[d[2]],
  42748. u = this.points[d[3]],
  42749. a = o * o,
  42750. s = o * a,
  42751. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42752. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42753. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42754. p
  42755. }
  42756. ,
  42757. this.getControlPointsArray = function() {
  42758. var e, t, i = this.points.length, n = [];
  42759. for (e = 0; e < i; e++)
  42760. t = this.points[e],
  42761. n[e] = [t.x, t.y, t.z];
  42762. return n
  42763. }
  42764. ,
  42765. this.getLength = function(e) {
  42766. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42767. for (u[0] = 0,
  42768. e || (e = 100),
  42769. r = this.points.length * e,
  42770. c.copy(this.points[0]),
  42771. t = 1; t < r; t++)
  42772. i = t / r,
  42773. o = this.getPoint(i),
  42774. h.copy(o),
  42775. d += h.distanceTo(c),
  42776. c.copy(o),
  42777. a = (this.points.length - 1) * i,
  42778. s = Math.floor(a),
  42779. s !== l && (u[s] = d,
  42780. l = s);
  42781. return u[u.length] = d,
  42782. {
  42783. chunks: u,
  42784. total: d
  42785. }
  42786. }
  42787. ,
  42788. this.reparametrizeByArcLength = function(e) {
  42789. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  42790. for (h.push(u.copy(this.points[0]).clone()),
  42791. t = 1; t < this.points.length; t++) {
  42792. for (s = d.chunks[t] - d.chunks[t - 1],
  42793. l = Math.ceil(e * s / d.total),
  42794. o = (t - 1) / (this.points.length - 1),
  42795. a = t / (this.points.length - 1),
  42796. i = 1; i < l - 1; i++)
  42797. r = o + i * (1 / l) * (a - o),
  42798. c = this.getPoint(r),
  42799. h.push(u.copy(c).clone());
  42800. h.push(u.copy(this.points[t]).clone())
  42801. }
  42802. this.points = h
  42803. }
  42804. }
  42805. ,
  42806. n.Triangle = function(e, t, i) {
  42807. this.a = void 0 !== e ? e : new n.Vector3,
  42808. this.b = void 0 !== t ? t : new n.Vector3,
  42809. this.c = void 0 !== i ? i : new n.Vector3
  42810. }
  42811. ,
  42812. n.Triangle.normal = function() {
  42813. var e = new n.Vector3;
  42814. return function(t, i, r, o) {
  42815. var a = o || new n.Vector3;
  42816. a.subVectors(r, i),
  42817. e.subVectors(t, i),
  42818. a.cross(e);
  42819. var s = a.lengthSq();
  42820. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  42821. }
  42822. }(),
  42823. n.Triangle.barycoordFromPoint = function() {
  42824. var e = new n.Vector3
  42825. , t = new n.Vector3
  42826. , i = new n.Vector3;
  42827. return function(r, o, a, s, l) {
  42828. e.subVectors(s, o),
  42829. t.subVectors(a, o),
  42830. i.subVectors(r, o);
  42831. var c = e.dot(e)
  42832. , h = e.dot(t)
  42833. , u = e.dot(i)
  42834. , d = t.dot(t)
  42835. , p = t.dot(i)
  42836. , f = c * d - h * h
  42837. , g = l || new n.Vector3;
  42838. if (0 === f)
  42839. return g.set(-2, -1, -1);
  42840. var m = 1 / f
  42841. , v = (d * u - h * p) * m
  42842. , A = (c * p - h * u) * m;
  42843. return g.set(1 - v - A, A, v)
  42844. }
  42845. }(),
  42846. n.Triangle.containsPoint = function() {
  42847. var e = new n.Vector3;
  42848. return function(t, i, r, o) {
  42849. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  42850. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  42851. }
  42852. }(),
  42853. n.Triangle.prototype = {
  42854. constructor: n.Triangle,
  42855. set: function(e, t, i) {
  42856. return this.a.copy(e),
  42857. this.b.copy(t),
  42858. this.c.copy(i),
  42859. this
  42860. },
  42861. setFromPointsAndIndices: function(e, t, i, n) {
  42862. return this.a.copy(e[t]),
  42863. this.b.copy(e[i]),
  42864. this.c.copy(e[n]),
  42865. this
  42866. },
  42867. clone: function() {
  42868. return (new this.constructor).copy(this)
  42869. },
  42870. copy: function(e) {
  42871. return this.a.copy(e.a),
  42872. this.b.copy(e.b),
  42873. this.c.copy(e.c),
  42874. this
  42875. },
  42876. area: function() {
  42877. var e = new n.Vector3
  42878. , t = new n.Vector3;
  42879. return function() {
  42880. return e.subVectors(this.c, this.b),
  42881. t.subVectors(this.a, this.b),
  42882. .5 * e.cross(t).length()
  42883. }
  42884. }(),
  42885. midpoint: function(e) {
  42886. var t = e || new n.Vector3;
  42887. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  42888. },
  42889. normal: function(e) {
  42890. return n.Triangle.normal(this.a, this.b, this.c, e)
  42891. },
  42892. plane: function(e) {
  42893. var t = e || new n.Plane;
  42894. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  42895. },
  42896. barycoordFromPoint: function(e, t) {
  42897. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  42898. },
  42899. containsPoint: function(e) {
  42900. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  42901. },
  42902. equals: function(e) {
  42903. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  42904. }
  42905. },
  42906. n.Interpolant = function(e, t, i, n) {
  42907. this.parameterPositions = e,
  42908. this._cachedIndex = 0,
  42909. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  42910. this.sampleValues = t,
  42911. this.valueSize = i
  42912. }
  42913. ,
  42914. n.Interpolant.prototype = {
  42915. constructor: n.Interpolant,
  42916. evaluate: function(e) {
  42917. var t = this.parameterPositions
  42918. , i = this._cachedIndex
  42919. , n = t[i]
  42920. , r = t[i - 1];
  42921. e: {
  42922. t: {
  42923. var o;
  42924. i: {
  42925. n: if (!(e < n)) {
  42926. for (var a = i + 2; ; ) {
  42927. if (void 0 === n) {
  42928. if (e < r)
  42929. break n;
  42930. return i = t.length,
  42931. this._cachedIndex = i,
  42932. this.afterEnd_(i - 1, e, r)
  42933. }
  42934. if (i === a)
  42935. break;
  42936. if (r = n,
  42937. n = t[++i],
  42938. e < n)
  42939. break t
  42940. }
  42941. o = t.length;
  42942. break i
  42943. }
  42944. {
  42945. if (e >= r)
  42946. break e;
  42947. var s = t[1];
  42948. e < s && (i = 2,
  42949. r = s);
  42950. for (var a = i - 2; ; ) {
  42951. if (void 0 === r)
  42952. return this._cachedIndex = 0,
  42953. this.beforeStart_(0, e, n);
  42954. if (i === a)
  42955. break;
  42956. if (n = r,
  42957. r = t[--i - 1],
  42958. e >= r)
  42959. break t
  42960. }
  42961. o = i,
  42962. i = 0
  42963. }
  42964. }
  42965. for (; i < o; ) {
  42966. var l = i + o >>> 1;
  42967. e < t[l] ? o = l : i = l + 1
  42968. }
  42969. if (n = t[i],
  42970. r = t[i - 1],
  42971. void 0 === r)
  42972. return this._cachedIndex = 0,
  42973. this.beforeStart_(0, e, n);
  42974. if (void 0 === n)
  42975. return i = t.length,
  42976. this._cachedIndex = i,
  42977. this.afterEnd_(i - 1, r, e)
  42978. }
  42979. this._cachedIndex = i,
  42980. this.intervalChanged_(i, r, n)
  42981. }
  42982. return this.interpolate_(i, r, e, n)
  42983. },
  42984. settings: null,
  42985. DefaultSettings_: {},
  42986. getSettings_: function() {
  42987. return this.settings || this.DefaultSettings_
  42988. },
  42989. copySampleValue_: function(e) {
  42990. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  42991. t[o] = i[r + o];
  42992. return t
  42993. },
  42994. interpolate_: function(e, t, i, n) {
  42995. throw new Error("call to abstract method")
  42996. },
  42997. intervalChanged_: function(e, t, i) {}
  42998. },
  42999. Object.assign(n.Interpolant.prototype, {
  43000. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43001. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43002. }),
  43003. n.CubicInterpolant = function(e, t, i, r) {
  43004. n.Interpolant.call(this, e, t, i, r),
  43005. this._weightPrev = -0,
  43006. this._offsetPrev = -0,
  43007. this._weightNext = -0,
  43008. this._offsetNext = -0
  43009. }
  43010. ,
  43011. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43012. constructor: n.CubicInterpolant,
  43013. DefaultSettings_: {
  43014. endingStart: n.ZeroCurvatureEnding,
  43015. endingEnd: n.ZeroCurvatureEnding
  43016. },
  43017. intervalChanged_: function(e, t, i) {
  43018. var r = this.parameterPositions
  43019. , o = e - 2
  43020. , a = e + 1
  43021. , s = r[o]
  43022. , l = r[a];
  43023. if (void 0 === s)
  43024. switch (this.getSettings_().endingStart) {
  43025. case n.ZeroSlopeEnding:
  43026. o = e,
  43027. s = 2 * t - i;
  43028. break;
  43029. case n.WrapAroundEnding:
  43030. o = r.length - 2,
  43031. s = t + r[o] - r[o + 1];
  43032. break;
  43033. default:
  43034. o = e,
  43035. s = i
  43036. }
  43037. if (void 0 === l)
  43038. switch (this.getSettings_().endingEnd) {
  43039. case n.ZeroSlopeEnding:
  43040. a = e,
  43041. l = 2 * i - t;
  43042. break;
  43043. case n.WrapAroundEnding:
  43044. a = 1,
  43045. l = i + r[1] - r[0];
  43046. break;
  43047. default:
  43048. a = e - 1,
  43049. l = t
  43050. }
  43051. var c = .5 * (i - t)
  43052. , h = this.valueSize;
  43053. this._weightPrev = c / (t - s),
  43054. this._weightNext = c / (l - i),
  43055. this._offsetPrev = o * h,
  43056. this._offsetNext = a * h
  43057. },
  43058. interpolate_: function(e, t, i, n) {
  43059. 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)
  43060. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43061. return r
  43062. }
  43063. }),
  43064. n.DiscreteInterpolant = function(e, t, i, r) {
  43065. n.Interpolant.call(this, e, t, i, r)
  43066. }
  43067. ,
  43068. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43069. constructor: n.DiscreteInterpolant,
  43070. interpolate_: function(e, t, i, n) {
  43071. return this.copySampleValue_(e - 1)
  43072. }
  43073. }),
  43074. n.LinearInterpolant = function(e, t, i, r) {
  43075. n.Interpolant.call(this, e, t, i, r)
  43076. }
  43077. ,
  43078. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43079. constructor: n.LinearInterpolant,
  43080. interpolate_: function(e, t, i, n) {
  43081. 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)
  43082. r[u] = o[l + u] * h + o[s + u] * c;
  43083. return r
  43084. }
  43085. }),
  43086. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43087. n.Interpolant.call(this, e, t, i, r)
  43088. }
  43089. ,
  43090. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43091. constructor: n.QuaternionLinearInterpolant,
  43092. interpolate_: function(e, t, i, r) {
  43093. 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)
  43094. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43095. return o
  43096. }
  43097. }),
  43098. n.Clock = function(e) {
  43099. this.autoStart = void 0 === e || e,
  43100. this.startTime = 0,
  43101. this.oldTime = 0,
  43102. this.elapsedTime = 0,
  43103. this.running = !1
  43104. }
  43105. ,
  43106. n.Clock.prototype = {
  43107. constructor: n.Clock,
  43108. start: function() {
  43109. this.startTime = performance.now(),
  43110. this.oldTime = this.startTime,
  43111. this.running = !0
  43112. },
  43113. stop: function() {
  43114. this.getElapsedTime(),
  43115. this.running = !1
  43116. },
  43117. getElapsedTime: function() {
  43118. return this.getDelta(),
  43119. this.elapsedTime
  43120. },
  43121. getDelta: function() {
  43122. var e = 0;
  43123. if (this.autoStart && !this.running && this.start(),
  43124. this.running) {
  43125. var t = performance.now();
  43126. e = .001 * (t - this.oldTime),
  43127. this.oldTime = t,
  43128. this.elapsedTime += e
  43129. }
  43130. return e
  43131. }
  43132. },
  43133. n.EventDispatcher = function() {}
  43134. ,
  43135. n.EventDispatcher.prototype = {
  43136. constructor: n.EventDispatcher,
  43137. apply: function(e) {
  43138. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43139. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43140. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43141. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43142. },
  43143. addEventListener: function(e, t) {
  43144. void 0 === this._listeners && (this._listeners = {});
  43145. var i = this._listeners;
  43146. void 0 === i[e] && (i[e] = []),
  43147. i[e].indexOf(t) === -1 && i[e].push(t)
  43148. },
  43149. hasEventListener: function(e, t) {
  43150. if (void 0 === this._listeners)
  43151. return !1;
  43152. var i = this._listeners;
  43153. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43154. },
  43155. removeEventListener: function(e, t) {
  43156. if (void 0 !== this._listeners) {
  43157. var i = this._listeners
  43158. , n = i[e];
  43159. if (void 0 !== n) {
  43160. var r = n.indexOf(t);
  43161. r !== -1 && n.splice(r, 1)
  43162. }
  43163. }
  43164. },
  43165. dispatchEvent: function(e) {
  43166. if (void 0 !== this._listeners) {
  43167. var t = this._listeners
  43168. , i = t[e.type];
  43169. if (void 0 !== i) {
  43170. e.target = this;
  43171. for (var n = [], r = i.length, o = 0; o < r; o++)
  43172. n[o] = i[o];
  43173. for (var o = 0; o < r; o++)
  43174. n[o].call(this, e)
  43175. }
  43176. }
  43177. }
  43178. },
  43179. n.Layers = function() {
  43180. this.mask = 1
  43181. }
  43182. ,
  43183. n.Layers.prototype = {
  43184. constructor: n.Layers,
  43185. set: function(e) {
  43186. this.mask = 1 << e
  43187. },
  43188. enable: function(e) {
  43189. this.mask |= 1 << e
  43190. },
  43191. toggle: function(e) {
  43192. this.mask ^= 1 << e
  43193. },
  43194. disable: function(e) {
  43195. this.mask &= ~(1 << e)
  43196. },
  43197. test: function(e) {
  43198. return 0 !== (this.mask & e.mask)
  43199. }
  43200. },
  43201. function(e) {
  43202. function t(e, t) {
  43203. return e.distance - t.distance
  43204. }
  43205. function i(e, t, n, r) {
  43206. if (e.visible !== !1 && (e.raycast(t, n),
  43207. r === !0))
  43208. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43209. i(o[a], t, n, !0)
  43210. }
  43211. e.Raycaster = function(t, i, n, r) {
  43212. this.ray = new e.Ray(t,i),
  43213. this.near = n || 0,
  43214. this.far = r || 1 / 0,
  43215. this.params = {
  43216. Mesh: {},
  43217. Line: {},
  43218. LOD: {},
  43219. Points: {
  43220. threshold: 1
  43221. },
  43222. Sprite: {}
  43223. },
  43224. Object.defineProperties(this.params, {
  43225. PointCloud: {
  43226. get: function() {
  43227. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43228. this.Points
  43229. }
  43230. }
  43231. })
  43232. }
  43233. ,
  43234. e.Raycaster.prototype = {
  43235. constructor: e.Raycaster,
  43236. linePrecision: 1,
  43237. set: function(e, t) {
  43238. this.ray.set(e, t)
  43239. },
  43240. setFromCamera: function(t, i) {
  43241. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43242. 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),
  43243. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43244. },
  43245. intersectObject: function(e, n) {
  43246. var r = [];
  43247. return i(e, this, r, n),
  43248. r.sort(t),
  43249. r
  43250. },
  43251. intersectObjects: function(e, n) {
  43252. var r = [];
  43253. if (Array.isArray(e) === !1)
  43254. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43255. r;
  43256. for (var o = 0, a = e.length; o < a; o++)
  43257. i(e[o], this, r, n);
  43258. return r.sort(t),
  43259. r
  43260. }
  43261. }
  43262. }(n),
  43263. n.Object3D = function() {
  43264. function e() {
  43265. o.setFromEuler(r, !1)
  43266. }
  43267. function t() {
  43268. r.setFromQuaternion(o, void 0, !1)
  43269. }
  43270. Object.defineProperty(this, "id", {
  43271. value: n.Object3DIdCount++
  43272. }),
  43273. this.uuid = n.Math.generateUUID(),
  43274. this.name = "",
  43275. this.type = "Object3D",
  43276. this.parent = null,
  43277. this.children = [],
  43278. this.up = n.Object3D.DefaultUp.clone();
  43279. var i = new n.Vector3
  43280. , r = new n.Euler
  43281. , o = new n.Quaternion
  43282. , a = new n.Vector3(1,1,1);
  43283. r.onChange(e),
  43284. o.onChange(t),
  43285. Object.defineProperties(this, {
  43286. position: {
  43287. enumerable: !0,
  43288. value: i
  43289. },
  43290. rotation: {
  43291. enumerable: !0,
  43292. value: r
  43293. },
  43294. quaternion: {
  43295. enumerable: !0,
  43296. value: o
  43297. },
  43298. scale: {
  43299. enumerable: !0,
  43300. value: a
  43301. },
  43302. modelViewMatrix: {
  43303. value: new n.Matrix4
  43304. },
  43305. normalMatrix: {
  43306. value: new n.Matrix3
  43307. }
  43308. }),
  43309. this.rotationAutoUpdate = !0,
  43310. this.matrix = new n.Matrix4,
  43311. this.matrixWorld = new n.Matrix4,
  43312. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43313. this.matrixWorldNeedsUpdate = !1,
  43314. this.layers = new n.Layers,
  43315. this.visible = !0,
  43316. this.castShadow = !1,
  43317. this.receiveShadow = !1,
  43318. this.frustumCulled = !0,
  43319. this.renderOrder = 0,
  43320. this.userData = {}
  43321. }
  43322. ,
  43323. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43324. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43325. n.Object3D.prototype = {
  43326. constructor: n.Object3D,
  43327. applyMatrix: function(e) {
  43328. this.matrix.multiplyMatrices(e, this.matrix),
  43329. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43330. },
  43331. setRotationFromAxisAngle: function(e, t) {
  43332. this.quaternion.setFromAxisAngle(e, t)
  43333. },
  43334. setRotationFromEuler: function(e) {
  43335. this.quaternion.setFromEuler(e, !0)
  43336. },
  43337. setRotationFromMatrix: function(e) {
  43338. this.quaternion.setFromRotationMatrix(e)
  43339. },
  43340. setRotationFromQuaternion: function(e) {
  43341. this.quaternion.copy(e)
  43342. },
  43343. rotateOnAxis: function() {
  43344. var e = new n.Quaternion;
  43345. return function(t, i) {
  43346. return e.setFromAxisAngle(t, i),
  43347. this.quaternion.multiply(e),
  43348. this
  43349. }
  43350. }(),
  43351. rotateX: function() {
  43352. var e = new n.Vector3(1,0,0);
  43353. return function(t) {
  43354. return this.rotateOnAxis(e, t)
  43355. }
  43356. }(),
  43357. rotateY: function() {
  43358. var e = new n.Vector3(0,1,0);
  43359. return function(t) {
  43360. return this.rotateOnAxis(e, t)
  43361. }
  43362. }(),
  43363. rotateZ: function() {
  43364. var e = new n.Vector3(0,0,1);
  43365. return function(t) {
  43366. return this.rotateOnAxis(e, t)
  43367. }
  43368. }(),
  43369. translateOnAxis: function() {
  43370. var e = new n.Vector3;
  43371. return function(t, i) {
  43372. return e.copy(t).applyQuaternion(this.quaternion),
  43373. this.position.add(e.multiplyScalar(i)),
  43374. this
  43375. }
  43376. }(),
  43377. translateX: function() {
  43378. var e = new n.Vector3(1,0,0);
  43379. return function(t) {
  43380. return this.translateOnAxis(e, t)
  43381. }
  43382. }(),
  43383. translateY: function() {
  43384. var e = new n.Vector3(0,1,0);
  43385. return function(t) {
  43386. return this.translateOnAxis(e, t)
  43387. }
  43388. }(),
  43389. translateZ: function() {
  43390. var e = new n.Vector3(0,0,1);
  43391. return function(t) {
  43392. return this.translateOnAxis(e, t)
  43393. }
  43394. }(),
  43395. localToWorld: function(e) {
  43396. return e.applyMatrix4(this.matrixWorld)
  43397. },
  43398. worldToLocal: function() {
  43399. var e = new n.Matrix4;
  43400. return function(t) {
  43401. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43402. }
  43403. }(),
  43404. lookAt: function() {
  43405. var e = new n.Matrix4;
  43406. return function(t) {
  43407. e.lookAt(t, this.position, this.up),
  43408. this.quaternion.setFromRotationMatrix(e)
  43409. }
  43410. }(),
  43411. add: function(e) {
  43412. if (arguments.length > 1) {
  43413. for (var t = 0; t < arguments.length; t++)
  43414. this.add(arguments[t]);
  43415. return this
  43416. }
  43417. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43418. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43419. e.parent = this,
  43420. e.dispatchEvent({
  43421. type: "added"
  43422. }),
  43423. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43424. this)
  43425. },
  43426. remove: function(e) {
  43427. if (arguments.length > 1)
  43428. for (var t = 0; t < arguments.length; t++)
  43429. this.remove(arguments[t]);
  43430. var i = this.children.indexOf(e);
  43431. i !== -1 && (e.parent = null,
  43432. e.dispatchEvent({
  43433. type: "removed"
  43434. }),
  43435. this.children.splice(i, 1))
  43436. },
  43437. getObjectById: function(e) {
  43438. return this.getObjectByProperty("id", e)
  43439. },
  43440. getObjectByName: function(e) {
  43441. return this.getObjectByProperty("name", e)
  43442. },
  43443. getObjectByProperty: function(e, t) {
  43444. if (this[e] === t)
  43445. return this;
  43446. for (var i = 0, n = this.children.length; i < n; i++) {
  43447. var r = this.children[i]
  43448. , o = r.getObjectByProperty(e, t);
  43449. if (void 0 !== o)
  43450. return o
  43451. }
  43452. },
  43453. getWorldPosition: function(e) {
  43454. var t = e || new n.Vector3;
  43455. return this.updateMatrixWorld(!0),
  43456. t.setFromMatrixPosition(this.matrixWorld)
  43457. },
  43458. getWorldQuaternion: function() {
  43459. var e = new n.Vector3
  43460. , t = new n.Vector3;
  43461. return function(i) {
  43462. var r = i || new n.Quaternion;
  43463. return this.updateMatrixWorld(!0),
  43464. this.matrixWorld.decompose(e, r, t),
  43465. r
  43466. }
  43467. }(),
  43468. getWorldRotation: function() {
  43469. var e = new n.Quaternion;
  43470. return function(t) {
  43471. var i = t || new n.Euler;
  43472. return this.getWorldQuaternion(e),
  43473. i.setFromQuaternion(e, this.rotation.order, !1)
  43474. }
  43475. }(),
  43476. getWorldScale: function() {
  43477. var e = new n.Vector3
  43478. , t = new n.Quaternion;
  43479. return function(i) {
  43480. var r = i || new n.Vector3;
  43481. return this.updateMatrixWorld(!0),
  43482. this.matrixWorld.decompose(e, t, r),
  43483. r
  43484. }
  43485. }(),
  43486. getWorldDirection: function() {
  43487. var e = new n.Quaternion;
  43488. return function(t) {
  43489. var i = t || new n.Vector3;
  43490. return this.getWorldQuaternion(e),
  43491. i.set(0, 0, 1).applyQuaternion(e)
  43492. }
  43493. }(),
  43494. raycast: function() {},
  43495. traverse: function(e) {
  43496. e(this);
  43497. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43498. t[i].traverse(e)
  43499. },
  43500. traverseVisible: function(e) {
  43501. if (this.visible !== !1) {
  43502. e(this);
  43503. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43504. t[i].traverseVisible(e)
  43505. }
  43506. },
  43507. traverseAncestors: function(e) {
  43508. var t = this.parent;
  43509. null !== t && (e(t),
  43510. t.traverseAncestors(e))
  43511. },
  43512. updateMatrix: function() {
  43513. this.matrix.compose(this.position, this.quaternion, this.scale),
  43514. this.matrixWorldNeedsUpdate = !0
  43515. },
  43516. updateMatrixWorld: function(e) {
  43517. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43518. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43519. this.matrixWorldNeedsUpdate = !1,
  43520. e = !0);
  43521. for (var t = 0, i = this.children.length; t < i; t++)
  43522. this.children[t].updateMatrixWorld(e)
  43523. },
  43524. toJSON: function(e) {
  43525. function t(e) {
  43526. var t = [];
  43527. for (var i in e) {
  43528. var n = e[i];
  43529. delete n.metadata,
  43530. t.push(n)
  43531. }
  43532. return t
  43533. }
  43534. var i = void 0 === e
  43535. , n = {};
  43536. i && (e = {
  43537. geometries: {},
  43538. materials: {},
  43539. textures: {},
  43540. images: {}
  43541. },
  43542. n.metadata = {
  43543. version: 4.4,
  43544. type: "Object",
  43545. generator: "Object3D.toJSON"
  43546. });
  43547. var r = {};
  43548. if (r.uuid = this.uuid,
  43549. r.type = this.type,
  43550. "" !== this.name && (r.name = this.name),
  43551. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43552. this.castShadow === !0 && (r.castShadow = !0),
  43553. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43554. this.visible === !1 && (r.visible = !1),
  43555. r.matrix = this.matrix.toArray(),
  43556. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43557. r.geometry = this.geometry.uuid),
  43558. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43559. r.material = this.material.uuid),
  43560. this.children.length > 0) {
  43561. r.children = [];
  43562. for (var o = 0; o < this.children.length; o++)
  43563. r.children.push(this.children[o].toJSON(e).object)
  43564. }
  43565. if (i) {
  43566. var a = t(e.geometries)
  43567. , s = t(e.materials)
  43568. , l = t(e.textures)
  43569. , c = t(e.images);
  43570. a.length > 0 && (n.geometries = a),
  43571. s.length > 0 && (n.materials = s),
  43572. l.length > 0 && (n.textures = l),
  43573. c.length > 0 && (n.images = c)
  43574. }
  43575. return n.object = r,
  43576. n
  43577. },
  43578. clone: function(e) {
  43579. return (new this.constructor).copy(this, e)
  43580. },
  43581. copy: function(e, t) {
  43582. if (void 0 === t && (t = !0),
  43583. this.name = e.name,
  43584. this.up.copy(e.up),
  43585. this.position.copy(e.position),
  43586. this.quaternion.copy(e.quaternion),
  43587. this.scale.copy(e.scale),
  43588. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43589. this.matrix.copy(e.matrix),
  43590. this.matrixWorld.copy(e.matrixWorld),
  43591. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43592. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43593. this.visible = e.visible,
  43594. this.castShadow = e.castShadow,
  43595. this.receiveShadow = e.receiveShadow,
  43596. this.frustumCulled = e.frustumCulled,
  43597. this.renderOrder = e.renderOrder,
  43598. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43599. t === !0)
  43600. for (var i = 0; i < e.children.length; i++) {
  43601. var n = e.children[i];
  43602. this.add(n.clone())
  43603. }
  43604. return this
  43605. }
  43606. },
  43607. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43608. n.Object3DIdCount = 0,
  43609. n.Face3 = function(e, t, i, r, o, a) {
  43610. this.a = e,
  43611. this.b = t,
  43612. this.c = i,
  43613. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43614. this.vertexNormals = Array.isArray(r) ? r : [],
  43615. this.color = o instanceof n.Color ? o : new n.Color,
  43616. this.vertexColors = Array.isArray(o) ? o : [],
  43617. this.materialIndex = void 0 !== a ? a : 0
  43618. }
  43619. ,
  43620. n.Face3.prototype = {
  43621. constructor: n.Face3,
  43622. clone: function() {
  43623. return (new this.constructor).copy(this)
  43624. },
  43625. copy: function(e) {
  43626. this.a = e.a,
  43627. this.b = e.b,
  43628. this.c = e.c,
  43629. this.normal.copy(e.normal),
  43630. this.color.copy(e.color),
  43631. this.materialIndex = e.materialIndex;
  43632. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43633. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43634. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43635. this.vertexColors[t] = e.vertexColors[t].clone();
  43636. return this
  43637. }
  43638. },
  43639. n.BufferAttribute = function(e, t) {
  43640. this.uuid = n.Math.generateUUID(),
  43641. this.array = e,
  43642. this.itemSize = t,
  43643. this.dynamic = !1,
  43644. this.updateRange = {
  43645. offset: 0,
  43646. count: -1
  43647. },
  43648. this.version = 0
  43649. }
  43650. ,
  43651. n.BufferAttribute.prototype = {
  43652. constructor: n.BufferAttribute,
  43653. get count() {
  43654. return this.array.length / this.itemSize
  43655. },
  43656. set needsUpdate(e) {
  43657. e === !0 && this.version++
  43658. },
  43659. setDynamic: function(e) {
  43660. return this.dynamic = e,
  43661. this
  43662. },
  43663. copy: function(e) {
  43664. return this.array = new e.array.constructor(e.array),
  43665. this.itemSize = e.itemSize,
  43666. this.dynamic = e.dynamic,
  43667. this
  43668. },
  43669. copyAt: function(e, t, i) {
  43670. e *= this.itemSize,
  43671. i *= t.itemSize;
  43672. for (var n = 0, r = this.itemSize; n < r; n++)
  43673. this.array[e + n] = t.array[i + n];
  43674. return this
  43675. },
  43676. copyArray: function(e) {
  43677. return this.array.set(e),
  43678. this
  43679. },
  43680. copyColorsArray: function(e) {
  43681. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43682. var a = e[r];
  43683. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  43684. a = new n.Color),
  43685. t[i++] = a.r,
  43686. t[i++] = a.g,
  43687. t[i++] = a.b
  43688. }
  43689. return this
  43690. },
  43691. copyIndicesArray: function(e) {
  43692. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43693. var o = e[n];
  43694. t[i++] = o.a,
  43695. t[i++] = o.b,
  43696. t[i++] = o.c
  43697. }
  43698. return this
  43699. },
  43700. copyVector2sArray: function(e) {
  43701. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43702. var a = e[r];
  43703. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43704. a = new n.Vector2),
  43705. t[i++] = a.x,
  43706. t[i++] = a.y
  43707. }
  43708. return this
  43709. },
  43710. copyVector3sArray: function(e) {
  43711. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43712. var a = e[r];
  43713. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43714. a = new n.Vector3),
  43715. t[i++] = a.x,
  43716. t[i++] = a.y,
  43717. t[i++] = a.z
  43718. }
  43719. return this
  43720. },
  43721. copyVector4sArray: function(e) {
  43722. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43723. var a = e[r];
  43724. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43725. a = new n.Vector4),
  43726. t[i++] = a.x,
  43727. t[i++] = a.y,
  43728. t[i++] = a.z,
  43729. t[i++] = a.w
  43730. }
  43731. return this
  43732. },
  43733. set: function(e, t) {
  43734. return void 0 === t && (t = 0),
  43735. this.array.set(e, t),
  43736. this
  43737. },
  43738. getX: function(e) {
  43739. return this.array[e * this.itemSize]
  43740. },
  43741. setX: function(e, t) {
  43742. return this.array[e * this.itemSize] = t,
  43743. this
  43744. },
  43745. getY: function(e) {
  43746. return this.array[e * this.itemSize + 1]
  43747. },
  43748. setY: function(e, t) {
  43749. return this.array[e * this.itemSize + 1] = t,
  43750. this
  43751. },
  43752. getZ: function(e) {
  43753. return this.array[e * this.itemSize + 2]
  43754. },
  43755. setZ: function(e, t) {
  43756. return this.array[e * this.itemSize + 2] = t,
  43757. this
  43758. },
  43759. getW: function(e) {
  43760. return this.array[e * this.itemSize + 3]
  43761. },
  43762. setW: function(e, t) {
  43763. return this.array[e * this.itemSize + 3] = t,
  43764. this
  43765. },
  43766. setXY: function(e, t, i) {
  43767. return e *= this.itemSize,
  43768. this.array[e + 0] = t,
  43769. this.array[e + 1] = i,
  43770. this
  43771. },
  43772. setXYZ: function(e, t, i, n) {
  43773. return e *= this.itemSize,
  43774. this.array[e + 0] = t,
  43775. this.array[e + 1] = i,
  43776. this.array[e + 2] = n,
  43777. this
  43778. },
  43779. setXYZW: function(e, t, i, n, r) {
  43780. return e *= this.itemSize,
  43781. this.array[e + 0] = t,
  43782. this.array[e + 1] = i,
  43783. this.array[e + 2] = n,
  43784. this.array[e + 3] = r,
  43785. this
  43786. },
  43787. clone: function() {
  43788. return (new this.constructor).copy(this)
  43789. }
  43790. },
  43791. n.Int8Attribute = function(e, t) {
  43792. return new n.BufferAttribute(new Int8Array(e),t)
  43793. }
  43794. ,
  43795. n.Uint8Attribute = function(e, t) {
  43796. return new n.BufferAttribute(new Uint8Array(e),t)
  43797. }
  43798. ,
  43799. n.Uint8ClampedAttribute = function(e, t) {
  43800. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  43801. }
  43802. ,
  43803. n.Int16Attribute = function(e, t) {
  43804. return new n.BufferAttribute(new Int16Array(e),t)
  43805. }
  43806. ,
  43807. n.Uint16Attribute = function(e, t) {
  43808. return new n.BufferAttribute(new Uint16Array(e),t)
  43809. }
  43810. ;
  43811. n.Int32Attribute = function(e, t) {
  43812. return new n.BufferAttribute(new Int32Array(e),t)
  43813. }
  43814. ;
  43815. n.Uint32Attribute = function(e, t) {
  43816. return new n.BufferAttribute(new Uint32Array(e),t)
  43817. }
  43818. ,
  43819. n.Float32Attribute = function(e, t) {
  43820. return new n.BufferAttribute(new Float32Array(e),t)
  43821. }
  43822. ,
  43823. n.Float64Attribute = function(e, t) {
  43824. return new n.BufferAttribute(new Float64Array(e),t)
  43825. }
  43826. ,
  43827. n.DynamicBufferAttribute = function(e, t) {
  43828. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  43829. new n.BufferAttribute(e,t).setDynamic(!0)
  43830. }
  43831. ,
  43832. n.InstancedBufferAttribute = function(e, t, i) {
  43833. n.BufferAttribute.call(this, e, t),
  43834. this.meshPerAttribute = i || 1
  43835. }
  43836. ,
  43837. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  43838. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  43839. n.InstancedBufferAttribute.prototype.copy = function(e) {
  43840. return n.BufferAttribute.prototype.copy.call(this, e),
  43841. this.meshPerAttribute = e.meshPerAttribute,
  43842. this
  43843. }
  43844. ,
  43845. n.InterleavedBuffer = function(e, t) {
  43846. this.uuid = n.Math.generateUUID(),
  43847. this.array = e,
  43848. this.stride = t,
  43849. this.dynamic = !1,
  43850. this.updateRange = {
  43851. offset: 0,
  43852. count: -1
  43853. },
  43854. this.version = 0
  43855. }
  43856. ,
  43857. n.InterleavedBuffer.prototype = {
  43858. constructor: n.InterleavedBuffer,
  43859. get length() {
  43860. return this.array.length
  43861. },
  43862. get count() {
  43863. return this.array.length / this.stride
  43864. },
  43865. set needsUpdate(e) {
  43866. e === !0 && this.version++
  43867. },
  43868. setDynamic: function(e) {
  43869. return this.dynamic = e,
  43870. this
  43871. },
  43872. copy: function(e) {
  43873. return this.array = new e.array.constructor(e.array),
  43874. this.stride = e.stride,
  43875. this.dynamic = e.dynamic,
  43876. this
  43877. },
  43878. copyAt: function(e, t, i) {
  43879. e *= this.stride,
  43880. i *= t.stride;
  43881. for (var n = 0, r = this.stride; n < r; n++)
  43882. this.array[e + n] = t.array[i + n];
  43883. return this
  43884. },
  43885. set: function(e, t) {
  43886. return void 0 === t && (t = 0),
  43887. this.array.set(e, t),
  43888. this
  43889. },
  43890. clone: function() {
  43891. return (new this.constructor).copy(this)
  43892. }
  43893. },
  43894. n.InstancedInterleavedBuffer = function(e, t, i) {
  43895. n.InterleavedBuffer.call(this, e, t),
  43896. this.meshPerAttribute = i || 1
  43897. }
  43898. ,
  43899. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  43900. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  43901. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  43902. return n.InterleavedBuffer.prototype.copy.call(this, e),
  43903. this.meshPerAttribute = e.meshPerAttribute,
  43904. this
  43905. }
  43906. ,
  43907. n.InterleavedBufferAttribute = function(e, t, i) {
  43908. this.uuid = n.Math.generateUUID(),
  43909. this.data = e,
  43910. this.itemSize = t,
  43911. this.offset = i
  43912. }
  43913. ,
  43914. n.InterleavedBufferAttribute.prototype = {
  43915. constructor: n.InterleavedBufferAttribute,
  43916. get length() {
  43917. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  43918. this.array.length
  43919. },
  43920. get count() {
  43921. return this.data.count
  43922. },
  43923. setX: function(e, t) {
  43924. return this.data.array[e * this.data.stride + this.offset] = t,
  43925. this
  43926. },
  43927. setY: function(e, t) {
  43928. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  43929. this
  43930. },
  43931. setZ: function(e, t) {
  43932. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  43933. this
  43934. },
  43935. setW: function(e, t) {
  43936. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  43937. this
  43938. },
  43939. getX: function(e) {
  43940. return this.data.array[e * this.data.stride + this.offset]
  43941. },
  43942. getY: function(e) {
  43943. return this.data.array[e * this.data.stride + this.offset + 1]
  43944. },
  43945. getZ: function(e) {
  43946. return this.data.array[e * this.data.stride + this.offset + 2]
  43947. },
  43948. getW: function(e) {
  43949. return this.data.array[e * this.data.stride + this.offset + 3]
  43950. },
  43951. setXY: function(e, t, i) {
  43952. return e = e * this.data.stride + this.offset,
  43953. this.data.array[e + 0] = t,
  43954. this.data.array[e + 1] = i,
  43955. this
  43956. },
  43957. setXYZ: function(e, t, i, n) {
  43958. return e = e * this.data.stride + this.offset,
  43959. this.data.array[e + 0] = t,
  43960. this.data.array[e + 1] = i,
  43961. this.data.array[e + 2] = n,
  43962. this
  43963. },
  43964. setXYZW: function(e, t, i, n, r) {
  43965. return e = e * this.data.stride + this.offset,
  43966. this.data.array[e + 0] = t,
  43967. this.data.array[e + 1] = i,
  43968. this.data.array[e + 2] = n,
  43969. this.data.array[e + 3] = r,
  43970. this
  43971. }
  43972. },
  43973. n.Geometry = function() {
  43974. Object.defineProperty(this, "id", {
  43975. value: n.GeometryIdCount++
  43976. }),
  43977. this.uuid = n.Math.generateUUID(),
  43978. this.name = "",
  43979. this.type = "Geometry",
  43980. this.vertices = [],
  43981. this.colors = [],
  43982. this.faces = [],
  43983. this.faceVertexUvs = [[]],
  43984. this.morphTargets = [],
  43985. this.morphNormals = [],
  43986. this.skinWeights = [],
  43987. this.skinIndices = [],
  43988. this.lineDistances = [],
  43989. this.boundingBox = null,
  43990. this.boundingSphere = null,
  43991. this.verticesNeedUpdate = !1,
  43992. this.elementsNeedUpdate = !1,
  43993. this.uvsNeedUpdate = !1,
  43994. this.normalsNeedUpdate = !1,
  43995. this.colorsNeedUpdate = !1,
  43996. this.lineDistancesNeedUpdate = !1,
  43997. this.groupsNeedUpdate = !1
  43998. }
  43999. ,
  44000. n.Geometry.prototype = {
  44001. constructor: n.Geometry,
  44002. applyMatrix: function(e) {
  44003. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44004. var o = this.vertices[i];
  44005. o.applyMatrix4(e)
  44006. }
  44007. for (var i = 0, r = this.faces.length; i < r; i++) {
  44008. var a = this.faces[i];
  44009. a.normal.applyMatrix3(t).normalize();
  44010. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44011. a.vertexNormals[s].applyMatrix3(t).normalize()
  44012. }
  44013. return null !== this.boundingBox && this.computeBoundingBox(),
  44014. null !== this.boundingSphere && this.computeBoundingSphere(),
  44015. this.verticesNeedUpdate = !0,
  44016. this.normalsNeedUpdate = !0,
  44017. this
  44018. },
  44019. rotateX: function() {
  44020. var e;
  44021. return function(t) {
  44022. return void 0 === e && (e = new n.Matrix4),
  44023. e.makeRotationX(t),
  44024. this.applyMatrix(e),
  44025. this
  44026. }
  44027. }(),
  44028. rotateY: function() {
  44029. var e;
  44030. return function(t) {
  44031. return void 0 === e && (e = new n.Matrix4),
  44032. e.makeRotationY(t),
  44033. this.applyMatrix(e),
  44034. this
  44035. }
  44036. }(),
  44037. rotateZ: function() {
  44038. var e;
  44039. return function(t) {
  44040. return void 0 === e && (e = new n.Matrix4),
  44041. e.makeRotationZ(t),
  44042. this.applyMatrix(e),
  44043. this
  44044. }
  44045. }(),
  44046. translate: function() {
  44047. var e;
  44048. return function(t, i, r) {
  44049. return void 0 === e && (e = new n.Matrix4),
  44050. e.makeTranslation(t, i, r),
  44051. this.applyMatrix(e),
  44052. this
  44053. }
  44054. }(),
  44055. scale: function() {
  44056. var e;
  44057. return function(t, i, r) {
  44058. return void 0 === e && (e = new n.Matrix4),
  44059. e.makeScale(t, i, r),
  44060. this.applyMatrix(e),
  44061. this
  44062. }
  44063. }(),
  44064. lookAt: function() {
  44065. var e;
  44066. return function(t) {
  44067. void 0 === e && (e = new n.Object3D),
  44068. e.lookAt(t),
  44069. e.updateMatrix(),
  44070. this.applyMatrix(e.matrix)
  44071. }
  44072. }(),
  44073. fromBufferGeometry: function(e) {
  44074. function t(e, t, r, o) {
  44075. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44076. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44077. , g = new n.Face3(e,t,r,a,f,o);
  44078. i.faces.push(g),
  44079. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44080. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44081. }
  44082. var i = this
  44083. , r = null !== e.index ? e.index.array : void 0
  44084. , o = e.attributes
  44085. , a = o.position.array
  44086. , s = void 0 !== o.normal ? o.normal.array : void 0
  44087. , l = void 0 !== o.color ? o.color.array : void 0
  44088. , c = void 0 !== o.uv ? o.uv.array : void 0
  44089. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44090. void 0 !== h && (this.faceVertexUvs[1] = []);
  44091. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44092. g += 2)
  44093. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44094. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44095. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44096. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44097. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44098. if (void 0 !== r) {
  44099. var m = e.groups;
  44100. if (m.length > 0)
  44101. for (var f = 0; f < m.length; f++)
  44102. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44103. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44104. else
  44105. for (var f = 0; f < r.length; f += 3)
  44106. t(r[f], r[f + 1], r[f + 2])
  44107. } else
  44108. for (var f = 0; f < a.length / 3; f += 3)
  44109. t(f, f + 1, f + 2);
  44110. return this.computeFaceNormals(),
  44111. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44112. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44113. this
  44114. },
  44115. center: function() {
  44116. this.computeBoundingBox();
  44117. var e = this.boundingBox.center().negate();
  44118. return this.translate(e.x, e.y, e.z),
  44119. e
  44120. },
  44121. normalize: function() {
  44122. this.computeBoundingSphere();
  44123. var e = this.boundingSphere.center
  44124. , t = this.boundingSphere.radius
  44125. , i = 0 === t ? 1 : 1 / t
  44126. , r = new n.Matrix4;
  44127. 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),
  44128. this.applyMatrix(r),
  44129. this
  44130. },
  44131. computeFaceNormals: function() {
  44132. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44133. var o = this.faces[i]
  44134. , a = this.vertices[o.a]
  44135. , s = this.vertices[o.b]
  44136. , l = this.vertices[o.c];
  44137. e.subVectors(l, s),
  44138. t.subVectors(a, s),
  44139. e.cross(t),
  44140. e.normalize(),
  44141. o.normal.copy(e)
  44142. }
  44143. },
  44144. computeVertexNormals: function(e) {
  44145. void 0 === e && (e = !0);
  44146. var t, i, r, o, a, s;
  44147. for (s = new Array(this.vertices.length),
  44148. t = 0,
  44149. i = this.vertices.length; t < i; t++)
  44150. s[t] = new n.Vector3;
  44151. if (e) {
  44152. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44153. for (r = 0,
  44154. o = this.faces.length; r < o; r++)
  44155. a = this.faces[r],
  44156. l = this.vertices[a.a],
  44157. c = this.vertices[a.b],
  44158. h = this.vertices[a.c],
  44159. u.subVectors(h, c),
  44160. d.subVectors(l, c),
  44161. u.cross(d),
  44162. s[a.a].add(u),
  44163. s[a.b].add(u),
  44164. s[a.c].add(u)
  44165. } else
  44166. for (r = 0,
  44167. o = this.faces.length; r < o; r++)
  44168. a = this.faces[r],
  44169. s[a.a].add(a.normal),
  44170. s[a.b].add(a.normal),
  44171. s[a.c].add(a.normal);
  44172. for (t = 0,
  44173. i = this.vertices.length; t < i; t++)
  44174. s[t].normalize();
  44175. for (r = 0,
  44176. o = this.faces.length; r < o; r++) {
  44177. a = this.faces[r];
  44178. var p = a.vertexNormals;
  44179. 3 === p.length ? (p[0].copy(s[a.a]),
  44180. p[1].copy(s[a.b]),
  44181. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44182. p[1] = s[a.b].clone(),
  44183. p[2] = s[a.c].clone())
  44184. }
  44185. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44186. },
  44187. computeMorphNormals: function() {
  44188. var e, t, i, r, o;
  44189. for (i = 0,
  44190. r = this.faces.length; i < r; i++)
  44191. for (o = this.faces[i],
  44192. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44193. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44194. e = 0,
  44195. t = o.vertexNormals.length; e < t; e++)
  44196. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44197. var a = new n.Geometry;
  44198. for (a.faces = this.faces,
  44199. e = 0,
  44200. t = this.morphTargets.length; e < t; e++) {
  44201. if (!this.morphNormals[e]) {
  44202. this.morphNormals[e] = {},
  44203. this.morphNormals[e].faceNormals = [],
  44204. this.morphNormals[e].vertexNormals = [];
  44205. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44206. for (i = 0,
  44207. r = this.faces.length; i < r; i++)
  44208. s = new n.Vector3,
  44209. l = {
  44210. a: new n.Vector3,
  44211. b: new n.Vector3,
  44212. c: new n.Vector3
  44213. },
  44214. c.push(s),
  44215. h.push(l)
  44216. }
  44217. var u = this.morphNormals[e];
  44218. a.vertices = this.morphTargets[e].vertices,
  44219. a.computeFaceNormals(),
  44220. a.computeVertexNormals();
  44221. var s, l;
  44222. for (i = 0,
  44223. r = this.faces.length; i < r; i++)
  44224. o = this.faces[i],
  44225. s = u.faceNormals[i],
  44226. l = u.vertexNormals[i],
  44227. s.copy(o.normal),
  44228. l.a.copy(o.vertexNormals[0]),
  44229. l.b.copy(o.vertexNormals[1]),
  44230. l.c.copy(o.vertexNormals[2])
  44231. }
  44232. for (i = 0,
  44233. r = this.faces.length; i < r; i++)
  44234. o = this.faces[i],
  44235. o.normal = o.__originalFaceNormal,
  44236. o.vertexNormals = o.__originalVertexNormals
  44237. },
  44238. computeTangents: function() {
  44239. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44240. },
  44241. computeLineDistances: function() {
  44242. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44243. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44244. this.lineDistances[i] = e
  44245. },
  44246. computeBoundingBox: function() {
  44247. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44248. this.boundingBox.setFromPoints(this.vertices)
  44249. },
  44250. computeBoundingSphere: function() {
  44251. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44252. this.boundingSphere.setFromPoints(this.vertices)
  44253. },
  44254. merge: function(e, t, i) {
  44255. if (e instanceof n.Geometry == !1)
  44256. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44257. 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];
  44258. void 0 === i && (i = 0),
  44259. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44260. for (var d = 0, p = s.length; d < p; d++) {
  44261. var f = s[d]
  44262. , g = f.clone();
  44263. void 0 !== t && g.applyMatrix4(t),
  44264. a.push(g)
  44265. }
  44266. for (d = 0,
  44267. p = c.length; d < p; d++) {
  44268. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44269. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44270. m.normal.copy(y.normal),
  44271. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44272. for (var E = 0, b = C.length; E < b; E++)
  44273. v = C[E].clone(),
  44274. void 0 !== r && v.applyMatrix3(r).normalize(),
  44275. m.vertexNormals.push(v);
  44276. m.color.copy(y.color);
  44277. for (var E = 0, b = I.length; E < b; E++)
  44278. A = I[E],
  44279. m.vertexColors.push(A.clone());
  44280. m.materialIndex = y.materialIndex + i,
  44281. l.push(m)
  44282. }
  44283. for (d = 0,
  44284. p = u.length; d < p; d++) {
  44285. var w = u[d]
  44286. , _ = [];
  44287. if (void 0 !== w) {
  44288. for (var E = 0, b = w.length; E < b; E++)
  44289. _.push(w[E].clone());
  44290. h.push(_)
  44291. }
  44292. }
  44293. },
  44294. mergeMesh: function(e) {
  44295. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44296. void this.merge(e.geometry, e.matrix))
  44297. },
  44298. mergeVertices: function() {
  44299. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44300. for (i = 0,
  44301. n = this.vertices.length; i < n; i++)
  44302. e = this.vertices[i],
  44303. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44304. void 0 === l[t] ? (l[t] = i,
  44305. c.push(this.vertices[i]),
  44306. h[i] = c.length - 1) : h[i] = h[l[t]];
  44307. var p = [];
  44308. for (i = 0,
  44309. n = this.faces.length; i < n; i++) {
  44310. r = this.faces[i],
  44311. r.a = h[r.a],
  44312. r.b = h[r.b],
  44313. r.c = h[r.c],
  44314. o = [r.a, r.b, r.c];
  44315. for (var f = -1, g = 0; g < 3; g++)
  44316. if (o[g] === o[(g + 1) % 3]) {
  44317. f = g,
  44318. p.push(i);
  44319. break
  44320. }
  44321. }
  44322. for (i = p.length - 1; i >= 0; i--) {
  44323. var m = p[i];
  44324. for (this.faces.splice(m, 1),
  44325. a = 0,
  44326. s = this.faceVertexUvs.length; a < s; a++)
  44327. this.faceVertexUvs[a].splice(m, 1)
  44328. }
  44329. var v = this.vertices.length - c.length;
  44330. return this.vertices = c,
  44331. v
  44332. },
  44333. sortFacesByMaterialIndex: function() {
  44334. function e(e, t) {
  44335. return e.materialIndex - t.materialIndex
  44336. }
  44337. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44338. t[n]._id = n;
  44339. t.sort(e);
  44340. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44341. a && a.length === i && (r = []),
  44342. s && s.length === i && (o = []);
  44343. for (var n = 0; n < i; n++) {
  44344. var l = t[n]._id;
  44345. r && r.push(a[l]),
  44346. o && o.push(s[l])
  44347. }
  44348. r && (this.faceVertexUvs[0] = r),
  44349. o && (this.faceVertexUvs[1] = o)
  44350. },
  44351. toJSON: function() {
  44352. function e(e, t, i) {
  44353. return i ? e | 1 << t : e & ~(1 << t)
  44354. }
  44355. function t(e) {
  44356. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44357. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44358. u.push(e.x, e.y, e.z),
  44359. d[t])
  44360. }
  44361. function i(e) {
  44362. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44363. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44364. p.push(e.getHex()),
  44365. f[t])
  44366. }
  44367. function n(e) {
  44368. var t = e.x.toString() + e.y.toString();
  44369. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44370. g.push(e.x, e.y),
  44371. m[t])
  44372. }
  44373. var r = {
  44374. metadata: {
  44375. version: 4.4,
  44376. type: "Geometry",
  44377. generator: "Geometry.toJSON"
  44378. }
  44379. };
  44380. if (r.uuid = this.uuid,
  44381. r.type = this.type,
  44382. "" !== this.name && (r.name = this.name),
  44383. void 0 !== this.parameters) {
  44384. var o = this.parameters;
  44385. for (var a in o)
  44386. void 0 !== o[a] && (r[a] = o[a]);
  44387. return r
  44388. }
  44389. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44390. var c = this.vertices[l];
  44391. s.push(c.x, c.y, c.z)
  44392. }
  44393. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44394. var v = this.faces[l]
  44395. , A = !0
  44396. , y = !1
  44397. , C = void 0 !== this.faceVertexUvs[0][l]
  44398. , I = v.normal.length() > 0
  44399. , E = v.vertexNormals.length > 0
  44400. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44401. , w = v.vertexColors.length > 0
  44402. , _ = 0;
  44403. if (_ = e(_, 0, 0),
  44404. _ = e(_, 1, A),
  44405. _ = e(_, 2, y),
  44406. _ = e(_, 3, C),
  44407. _ = e(_, 4, I),
  44408. _ = e(_, 5, E),
  44409. _ = e(_, 6, b),
  44410. _ = e(_, 7, w),
  44411. h.push(_),
  44412. h.push(v.a, v.b, v.c),
  44413. h.push(v.materialIndex),
  44414. C) {
  44415. var T = this.faceVertexUvs[0][l];
  44416. h.push(n(T[0]), n(T[1]), n(T[2]))
  44417. }
  44418. if (I && h.push(t(v.normal)),
  44419. E) {
  44420. var x = v.vertexNormals;
  44421. h.push(t(x[0]), t(x[1]), t(x[2]))
  44422. }
  44423. if (b && h.push(i(v.color)),
  44424. w) {
  44425. var S = v.vertexColors;
  44426. h.push(i(S[0]), i(S[1]), i(S[2]))
  44427. }
  44428. }
  44429. return r.data = {},
  44430. r.data.vertices = s,
  44431. r.data.normals = u,
  44432. p.length > 0 && (r.data.colors = p),
  44433. g.length > 0 && (r.data.uvs = [g]),
  44434. r.data.faces = h,
  44435. r
  44436. },
  44437. clone: function() {
  44438. return (new n.Geometry).copy(this)
  44439. },
  44440. copy: function(e) {
  44441. this.vertices = [],
  44442. this.faces = [],
  44443. this.faceVertexUvs = [[]];
  44444. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44445. this.vertices.push(t[i].clone());
  44446. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44447. this.faces.push(r[i].clone());
  44448. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44449. var o = e.faceVertexUvs[i];
  44450. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44451. for (var a = 0, s = o.length; a < s; a++) {
  44452. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44453. var d = l[h];
  44454. c.push(d.clone())
  44455. }
  44456. this.faceVertexUvs[i].push(c)
  44457. }
  44458. }
  44459. return this
  44460. },
  44461. dispose: function() {
  44462. this.dispatchEvent({
  44463. type: "dispose"
  44464. })
  44465. }
  44466. },
  44467. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44468. n.GeometryIdCount = 0,
  44469. n.DirectGeometry = function() {
  44470. Object.defineProperty(this, "id", {
  44471. value: n.GeometryIdCount++
  44472. }),
  44473. this.uuid = n.Math.generateUUID(),
  44474. this.name = "",
  44475. this.type = "DirectGeometry",
  44476. this.indices = [],
  44477. this.vertices = [],
  44478. this.normals = [],
  44479. this.colors = [],
  44480. this.uvs = [],
  44481. this.uvs2 = [],
  44482. this.groups = [],
  44483. this.morphTargets = {},
  44484. this.skinWeights = [],
  44485. this.skinIndices = [],
  44486. this.boundingBox = null,
  44487. this.boundingSphere = null,
  44488. this.verticesNeedUpdate = !1,
  44489. this.normalsNeedUpdate = !1,
  44490. this.colorsNeedUpdate = !1,
  44491. this.uvsNeedUpdate = !1,
  44492. this.groupsNeedUpdate = !1
  44493. }
  44494. ,
  44495. n.DirectGeometry.prototype = {
  44496. constructor: n.DirectGeometry,
  44497. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44498. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44499. computeFaceNormals: function() {
  44500. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44501. },
  44502. computeVertexNormals: function() {
  44503. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44504. },
  44505. computeGroups: function(e) {
  44506. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44507. var a = r[o];
  44508. a.materialIndex !== i && (i = a.materialIndex,
  44509. void 0 !== t && (t.count = 3 * o - t.start,
  44510. n.push(t)),
  44511. t = {
  44512. start: 3 * o,
  44513. materialIndex: i
  44514. })
  44515. }
  44516. void 0 !== t && (t.count = 3 * o - t.start,
  44517. n.push(t)),
  44518. this.groups = n
  44519. },
  44520. fromGeometry: function(e) {
  44521. 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;
  44522. if (c > 0) {
  44523. t = [];
  44524. for (var h = 0; h < c; h++)
  44525. t[h] = [];
  44526. this.morphTargets.position = t
  44527. }
  44528. var u, d = e.morphNormals, p = d.length;
  44529. if (p > 0) {
  44530. u = [];
  44531. for (var h = 0; h < p; h++)
  44532. u[h] = [];
  44533. this.morphTargets.normal = u
  44534. }
  44535. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44536. var A = i[h];
  44537. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44538. var y = A.vertexNormals;
  44539. if (3 === y.length)
  44540. this.normals.push(y[0], y[1], y[2]);
  44541. else {
  44542. var C = A.normal;
  44543. this.normals.push(C, C, C)
  44544. }
  44545. var I = A.vertexColors;
  44546. if (3 === I.length)
  44547. this.colors.push(I[0], I[1], I[2]);
  44548. else {
  44549. var E = A.color;
  44550. this.colors.push(E, E, E)
  44551. }
  44552. if (a === !0) {
  44553. var b = o[0][h];
  44554. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44555. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44556. }
  44557. if (s === !0) {
  44558. var b = o[1][h];
  44559. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44560. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44561. }
  44562. for (var w = 0; w < c; w++) {
  44563. var _ = l[w].vertices;
  44564. t[w].push(_[A.a], _[A.b], _[A.c])
  44565. }
  44566. for (var w = 0; w < p; w++) {
  44567. var T = d[w].vertexNormals[h];
  44568. u[w].push(T.a, T.b, T.c)
  44569. }
  44570. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44571. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44572. }
  44573. return this.computeGroups(e),
  44574. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44575. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44576. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44577. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44578. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44579. this
  44580. },
  44581. dispose: function() {
  44582. this.dispatchEvent({
  44583. type: "dispose"
  44584. })
  44585. }
  44586. },
  44587. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44588. n.BufferGeometry = function() {
  44589. Object.defineProperty(this, "id", {
  44590. value: n.GeometryIdCount++
  44591. }),
  44592. this.uuid = n.Math.generateUUID(),
  44593. this.name = "",
  44594. this.type = "BufferGeometry",
  44595. this.index = null,
  44596. this.attributes = {},
  44597. this.morphAttributes = {},
  44598. this.groups = [],
  44599. this.boundingBox = null,
  44600. this.boundingSphere = null,
  44601. this.drawRange = {
  44602. start: 0,
  44603. count: 1 / 0
  44604. }
  44605. }
  44606. ,
  44607. n.BufferGeometry.prototype = {
  44608. constructor: n.BufferGeometry,
  44609. getIndex: function() {
  44610. return this.index
  44611. },
  44612. setIndex: function(e) {
  44613. this.index = e
  44614. },
  44615. addAttribute: function(e, t) {
  44616. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44617. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44618. void this.setIndex(t)) : (this.attributes[e] = t,
  44619. this)
  44620. },
  44621. getAttribute: function(e) {
  44622. return this.attributes[e]
  44623. },
  44624. removeAttribute: function(e) {
  44625. return delete this.attributes[e],
  44626. this
  44627. },
  44628. addGroup: function(e, t, i) {
  44629. this.groups.push({
  44630. start: e,
  44631. count: t,
  44632. materialIndex: void 0 !== i ? i : 0
  44633. })
  44634. },
  44635. clearGroups: function() {
  44636. this.groups = []
  44637. },
  44638. setDrawRange: function(e, t) {
  44639. this.drawRange.start = e,
  44640. this.drawRange.count = t
  44641. },
  44642. applyMatrix: function(e) {
  44643. var t = this.attributes.position;
  44644. void 0 !== t && (e.applyToVector3Array(t.array),
  44645. t.needsUpdate = !0);
  44646. var i = this.attributes.normal;
  44647. if (void 0 !== i) {
  44648. var r = (new n.Matrix3).getNormalMatrix(e);
  44649. r.applyToVector3Array(i.array),
  44650. i.needsUpdate = !0
  44651. }
  44652. return null !== this.boundingBox && this.computeBoundingBox(),
  44653. null !== this.boundingSphere && this.computeBoundingSphere(),
  44654. this
  44655. },
  44656. rotateX: function() {
  44657. var e;
  44658. return function(t) {
  44659. return void 0 === e && (e = new n.Matrix4),
  44660. e.makeRotationX(t),
  44661. this.applyMatrix(e),
  44662. this
  44663. }
  44664. }(),
  44665. rotateY: function() {
  44666. var e;
  44667. return function(t) {
  44668. return void 0 === e && (e = new n.Matrix4),
  44669. e.makeRotationY(t),
  44670. this.applyMatrix(e),
  44671. this
  44672. }
  44673. }(),
  44674. rotateZ: function() {
  44675. var e;
  44676. return function(t) {
  44677. return void 0 === e && (e = new n.Matrix4),
  44678. e.makeRotationZ(t),
  44679. this.applyMatrix(e),
  44680. this
  44681. }
  44682. }(),
  44683. translate: function() {
  44684. var e;
  44685. return function(t, i, r) {
  44686. return void 0 === e && (e = new n.Matrix4),
  44687. e.makeTranslation(t, i, r),
  44688. this.applyMatrix(e),
  44689. this
  44690. }
  44691. }(),
  44692. scale: function() {
  44693. var e;
  44694. return function(t, i, r) {
  44695. return void 0 === e && (e = new n.Matrix4),
  44696. e.makeScale(t, i, r),
  44697. this.applyMatrix(e),
  44698. this
  44699. }
  44700. }(),
  44701. lookAt: function() {
  44702. var e;
  44703. return function(t) {
  44704. void 0 === e && (e = new n.Object3D),
  44705. e.lookAt(t),
  44706. e.updateMatrix(),
  44707. this.applyMatrix(e.matrix)
  44708. }
  44709. }(),
  44710. center: function() {
  44711. this.computeBoundingBox();
  44712. var e = this.boundingBox.center().negate();
  44713. return this.translate(e.x, e.y, e.z),
  44714. e
  44715. },
  44716. setFromObject: function(e) {
  44717. var t = e.geometry;
  44718. if (e instanceof n.Points || e instanceof n.Line) {
  44719. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44720. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44721. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44722. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44723. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44724. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44725. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44726. }
  44727. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44728. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44729. } else
  44730. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44731. return this
  44732. },
  44733. updateFromObject: function(e) {
  44734. var t = e.geometry;
  44735. if (e instanceof n.Mesh) {
  44736. var i = t.__directGeometry;
  44737. if (void 0 === i)
  44738. return this.fromGeometry(t);
  44739. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44740. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44741. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44742. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44743. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44744. t.verticesNeedUpdate = !1,
  44745. t.normalsNeedUpdate = !1,
  44746. t.colorsNeedUpdate = !1,
  44747. t.uvsNeedUpdate = !1,
  44748. t.groupsNeedUpdate = !1,
  44749. t = i
  44750. }
  44751. if (t.verticesNeedUpdate === !0) {
  44752. var r = this.attributes.position;
  44753. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44754. r.needsUpdate = !0),
  44755. t.verticesNeedUpdate = !1
  44756. }
  44757. if (t.normalsNeedUpdate === !0) {
  44758. var r = this.attributes.normal;
  44759. void 0 !== r && (r.copyVector3sArray(t.normals),
  44760. r.needsUpdate = !0),
  44761. t.normalsNeedUpdate = !1
  44762. }
  44763. if (t.colorsNeedUpdate === !0) {
  44764. var r = this.attributes.color;
  44765. void 0 !== r && (r.copyColorsArray(t.colors),
  44766. r.needsUpdate = !0),
  44767. t.colorsNeedUpdate = !1
  44768. }
  44769. if (t.uvsNeedUpdate) {
  44770. var r = this.attributes.uv;
  44771. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44772. r.needsUpdate = !0),
  44773. t.uvsNeedUpdate = !1
  44774. }
  44775. if (t.lineDistancesNeedUpdate) {
  44776. var r = this.attributes.lineDistance;
  44777. void 0 !== r && (r.copyArray(t.lineDistances),
  44778. r.needsUpdate = !0),
  44779. t.lineDistancesNeedUpdate = !1
  44780. }
  44781. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  44782. this.groups = t.groups,
  44783. t.groupsNeedUpdate = !1),
  44784. this
  44785. },
  44786. fromGeometry: function(e) {
  44787. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  44788. this.fromDirectGeometry(e.__directGeometry)
  44789. },
  44790. fromDirectGeometry: function(e) {
  44791. var t = new Float32Array(3 * e.vertices.length);
  44792. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  44793. e.normals.length > 0) {
  44794. var i = new Float32Array(3 * e.normals.length);
  44795. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  44796. }
  44797. if (e.colors.length > 0) {
  44798. var r = new Float32Array(3 * e.colors.length);
  44799. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  44800. }
  44801. if (e.uvs.length > 0) {
  44802. var o = new Float32Array(2 * e.uvs.length);
  44803. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  44804. }
  44805. if (e.uvs2.length > 0) {
  44806. var a = new Float32Array(2 * e.uvs2.length);
  44807. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  44808. }
  44809. if (e.indices.length > 0) {
  44810. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  44811. , l = new s(3 * e.indices.length);
  44812. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  44813. }
  44814. this.groups = e.groups;
  44815. for (var c in e.morphTargets) {
  44816. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  44817. var f = u[d]
  44818. , g = new n.Float32Attribute(3 * f.length,3);
  44819. h.push(g.copyVector3sArray(f))
  44820. }
  44821. this.morphAttributes[c] = h
  44822. }
  44823. if (e.skinIndices.length > 0) {
  44824. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  44825. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  44826. }
  44827. if (e.skinWeights.length > 0) {
  44828. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  44829. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  44830. }
  44831. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44832. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44833. this
  44834. },
  44835. computeBoundingBox: function() {
  44836. new n.Vector3;
  44837. return function() {
  44838. null === this.boundingBox && (this.boundingBox = new n.Box3);
  44839. var e = this.attributes.position.array;
  44840. e && this.boundingBox.setFromArray(e),
  44841. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  44842. this.boundingBox.max.set(0, 0, 0)),
  44843. (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)
  44844. }
  44845. }(),
  44846. computeBoundingSphere: function() {
  44847. var e = new n.Box3
  44848. , t = new n.Vector3;
  44849. return function() {
  44850. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  44851. var i = this.attributes.position.array;
  44852. if (i) {
  44853. var r = this.boundingSphere.center;
  44854. e.setFromArray(i),
  44855. e.center(r);
  44856. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  44857. t.fromArray(i, a),
  44858. o = Math.max(o, r.distanceToSquared(t));
  44859. this.boundingSphere.radius = Math.sqrt(o),
  44860. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  44861. }
  44862. }
  44863. }(),
  44864. computeFaceNormals: function() {},
  44865. computeVertexNormals: function() {
  44866. var e = this.index
  44867. , t = this.attributes
  44868. , i = this.groups;
  44869. if (t.position) {
  44870. var r = t.position.array;
  44871. if (void 0 === t.normal)
  44872. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  44873. else
  44874. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  44875. o[a] = 0;
  44876. 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;
  44877. if (e) {
  44878. var v = e.array;
  44879. 0 === i.length && this.addGroup(0, v.length);
  44880. for (var A = 0, y = i.length; A < y; ++A)
  44881. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  44882. l = 3 * v[a + 0],
  44883. c = 3 * v[a + 1],
  44884. h = 3 * v[a + 2],
  44885. d.fromArray(r, l),
  44886. p.fromArray(r, c),
  44887. f.fromArray(r, h),
  44888. g.subVectors(f, p),
  44889. m.subVectors(d, p),
  44890. g.cross(m),
  44891. u[l] += g.x,
  44892. u[l + 1] += g.y,
  44893. u[l + 2] += g.z,
  44894. u[c] += g.x,
  44895. u[c + 1] += g.y,
  44896. u[c + 2] += g.z,
  44897. u[h] += g.x,
  44898. u[h + 1] += g.y,
  44899. u[h + 2] += g.z
  44900. } else
  44901. for (var a = 0, s = r.length; a < s; a += 9)
  44902. d.fromArray(r, a),
  44903. p.fromArray(r, a + 3),
  44904. f.fromArray(r, a + 6),
  44905. g.subVectors(f, p),
  44906. m.subVectors(d, p),
  44907. g.cross(m),
  44908. u[a] = g.x,
  44909. u[a + 1] = g.y,
  44910. u[a + 2] = g.z,
  44911. u[a + 3] = g.x,
  44912. u[a + 4] = g.y,
  44913. u[a + 5] = g.z,
  44914. u[a + 6] = g.x,
  44915. u[a + 7] = g.y,
  44916. u[a + 8] = g.z;
  44917. this.normalizeNormals(),
  44918. t.normal.needsUpdate = !0
  44919. }
  44920. },
  44921. merge: function(e, t) {
  44922. if (e instanceof n.BufferGeometry == !1)
  44923. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  44924. void 0 === t && (t = 0);
  44925. var i = this.attributes;
  44926. for (var r in i)
  44927. if (void 0 !== e.attributes[r])
  44928. 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++,
  44929. u++)
  44930. a[u] = l[h];
  44931. return this
  44932. },
  44933. normalizeNormals: function() {
  44934. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  44935. e = r[o],
  44936. t = r[o + 1],
  44937. i = r[o + 2],
  44938. n = 1 / Math.sqrt(e * e + t * t + i * i),
  44939. r[o] *= n,
  44940. r[o + 1] *= n,
  44941. r[o + 2] *= n
  44942. },
  44943. toNonIndexed: function() {
  44944. if (null === this.index)
  44945. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  44946. this;
  44947. var e = new n.BufferGeometry
  44948. , t = this.index.array
  44949. , i = this.attributes;
  44950. for (var r in i) {
  44951. 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++) {
  44952. c = t[u] * s;
  44953. for (var p = 0; p < s; p++)
  44954. l[h++] = a[c++]
  44955. }
  44956. e.addAttribute(r, new n.BufferAttribute(l,s))
  44957. }
  44958. return e
  44959. },
  44960. toJSON: function() {
  44961. var e = {
  44962. metadata: {
  44963. version: 4.4,
  44964. type: "BufferGeometry",
  44965. generator: "BufferGeometry.toJSON"
  44966. }
  44967. };
  44968. if (e.uuid = this.uuid,
  44969. e.type = this.type,
  44970. "" !== this.name && (e.name = this.name),
  44971. void 0 !== this.parameters) {
  44972. var t = this.parameters;
  44973. for (var i in t)
  44974. void 0 !== t[i] && (e[i] = t[i]);
  44975. return e
  44976. }
  44977. e.data = {
  44978. attributes: {}
  44979. };
  44980. var n = this.index;
  44981. if (null !== n) {
  44982. var r = Array.prototype.slice.call(n.array);
  44983. e.data.index = {
  44984. type: n.array.constructor.name,
  44985. array: r
  44986. }
  44987. }
  44988. var o = this.attributes;
  44989. for (var i in o) {
  44990. var a = o[i]
  44991. , r = Array.prototype.slice.call(a.array);
  44992. e.data.attributes[i] = {
  44993. itemSize: a.itemSize,
  44994. type: a.array.constructor.name,
  44995. array: r
  44996. }
  44997. }
  44998. var s = this.groups;
  44999. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45000. var l = this.boundingSphere;
  45001. return null !== l && (e.data.boundingSphere = {
  45002. center: l.center.toArray(),
  45003. radius: l.radius
  45004. }),
  45005. e
  45006. },
  45007. clone: function() {
  45008. return (new n.BufferGeometry).copy(this)
  45009. },
  45010. copy: function(e) {
  45011. var t = e.index;
  45012. null !== t && this.setIndex(t.clone());
  45013. var i = e.attributes;
  45014. for (var n in i) {
  45015. var r = i[n];
  45016. this.addAttribute(n, r.clone())
  45017. }
  45018. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45019. var l = o[a];
  45020. this.addGroup(l.start, l.count)
  45021. }
  45022. return this
  45023. },
  45024. dispose: function() {
  45025. this.dispatchEvent({
  45026. type: "dispose"
  45027. })
  45028. }
  45029. },
  45030. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45031. n.BufferGeometry.MaxIndex = 65535,
  45032. n.InstancedBufferGeometry = function() {
  45033. n.BufferGeometry.call(this),
  45034. this.type = "InstancedBufferGeometry",
  45035. this.maxInstancedCount = void 0
  45036. }
  45037. ,
  45038. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45039. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45040. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45041. this.groups.push({
  45042. start: e,
  45043. count: t,
  45044. instances: i
  45045. })
  45046. }
  45047. ,
  45048. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45049. var t = e.index;
  45050. null !== t && this.setIndex(t.clone());
  45051. var i = e.attributes;
  45052. for (var n in i) {
  45053. var r = i[n];
  45054. this.addAttribute(n, r.clone())
  45055. }
  45056. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45057. var l = o[a];
  45058. this.addGroup(l.start, l.count, l.instances)
  45059. }
  45060. return this
  45061. }
  45062. ,
  45063. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45064. n.Uniform = function(e, t) {
  45065. this.type = e,
  45066. this.value = t,
  45067. this.dynamic = !1
  45068. }
  45069. ,
  45070. n.Uniform.prototype = {
  45071. constructor: n.Uniform,
  45072. onUpdate: function(e) {
  45073. return this.dynamic = !0,
  45074. this.onUpdateCallback = e,
  45075. this
  45076. }
  45077. },
  45078. n.AnimationClip = function(e, t, i) {
  45079. this.name = e || n.Math.generateUUID(),
  45080. this.tracks = i,
  45081. this.duration = void 0 !== t ? t : -1,
  45082. this.duration < 0 && this.resetDuration(),
  45083. this.trim(),
  45084. this.optimize()
  45085. }
  45086. ,
  45087. n.AnimationClip.prototype = {
  45088. constructor: n.AnimationClip,
  45089. resetDuration: function() {
  45090. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45091. var r = this.tracks[i];
  45092. t = Math.max(t, r.times[r.times.length - 1])
  45093. }
  45094. this.duration = t
  45095. },
  45096. trim: function() {
  45097. for (var e = 0; e < this.tracks.length; e++)
  45098. this.tracks[e].trim(0, this.duration);
  45099. return this
  45100. },
  45101. optimize: function() {
  45102. for (var e = 0; e < this.tracks.length; e++)
  45103. this.tracks[e].optimize();
  45104. return this
  45105. }
  45106. },
  45107. Object.assign(n.AnimationClip, {
  45108. parse: function(e) {
  45109. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45110. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45111. return new n.AnimationClip(e.name,e.duration,t)
  45112. },
  45113. toJSON: function(e) {
  45114. for (var t = [], i = e.tracks, r = {
  45115. name: e.name,
  45116. duration: e.duration,
  45117. tracks: t
  45118. }, o = 0, a = i.length; o !== a; ++o)
  45119. t.push(n.KeyframeTrack.toJSON(i[o]));
  45120. return r
  45121. },
  45122. CreateFromMorphTargetSequence: function(e, t, i) {
  45123. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45124. var s = []
  45125. , l = [];
  45126. s.push((a + r - 1) % r, a, (a + 1) % r),
  45127. l.push(0, 1, 0);
  45128. var c = n.AnimationUtils.getKeyframeOrder(s);
  45129. s = n.AnimationUtils.sortedArray(s, 1, c),
  45130. l = n.AnimationUtils.sortedArray(l, 1, c),
  45131. 0 === s[0] && (s.push(r),
  45132. l.push(l[0])),
  45133. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45134. }
  45135. return new n.AnimationClip(e,-1,o)
  45136. },
  45137. findByName: function(e, t) {
  45138. for (var i = 0; i < e.length; i++)
  45139. if (e[i].name === t)
  45140. return e[i];
  45141. return null
  45142. },
  45143. CreateClipsFromMorphTargetSequences: function(e, t) {
  45144. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45145. var s = e[o]
  45146. , l = s.name.match(r);
  45147. if (l && l.length > 1) {
  45148. var c = l[1]
  45149. , h = i[c];
  45150. h || (i[c] = h = []),
  45151. h.push(s)
  45152. }
  45153. }
  45154. var u = [];
  45155. for (var c in i)
  45156. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45157. return u
  45158. },
  45159. parseAnimation: function(e, t, i) {
  45160. if (!e)
  45161. return console.error(" no animation in JSONLoader data"),
  45162. null;
  45163. for (var r = function(e, t, i, r, o) {
  45164. if (0 !== i.length) {
  45165. var a = []
  45166. , s = [];
  45167. n.AnimationUtils.flattenJSON(i, a, s, r),
  45168. 0 !== a.length && o.push(new e(t,a,s))
  45169. }
  45170. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45171. var u = c[h].keys;
  45172. if (u && 0 != u.length)
  45173. if (u[0].morphTargets) {
  45174. for (var d = {}, p = 0; p < u.length; p++)
  45175. if (u[p].morphTargets)
  45176. for (var f = 0; f < u[p].morphTargets.length; f++)
  45177. d[u[p].morphTargets[f]] = -1;
  45178. for (var g in d) {
  45179. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45180. var A = u[p];
  45181. m.push(A.time),
  45182. v.push(A.morphTarget === g ? 1 : 0)
  45183. }
  45184. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45185. }
  45186. s = d.length * (l || 1)
  45187. } else {
  45188. var y = ".bones[" + t[h].name + "]";
  45189. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45190. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45191. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45192. }
  45193. }
  45194. if (0 === o.length)
  45195. return null;
  45196. var C = new n.AnimationClip(a,s,o);
  45197. return C
  45198. }
  45199. }),
  45200. n.AnimationMixer = function(e) {
  45201. this._root = e,
  45202. this._initMemoryManager(),
  45203. this._accuIndex = 0,
  45204. this.time = 0,
  45205. this.timeScale = 1
  45206. }
  45207. ,
  45208. n.AnimationMixer.prototype = {
  45209. constructor: n.AnimationMixer,
  45210. clipAction: function(e, t) {
  45211. 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];
  45212. if (void 0 !== l) {
  45213. var c = l.actionByRoot[o];
  45214. if (void 0 !== c)
  45215. return c;
  45216. if (i = l.knownActions[0],
  45217. s = i._clip,
  45218. e !== a && e !== s)
  45219. throw new Error("Different clips with the same name detected!")
  45220. }
  45221. if (null === s)
  45222. return null;
  45223. var h = new n.AnimationMixer._Action(this,s,t);
  45224. return this._bindAction(h, i),
  45225. this._addInactiveAction(h, a, o),
  45226. h
  45227. },
  45228. existingAction: function(e, t) {
  45229. var i = t || this._root
  45230. , n = i.uuid
  45231. , r = "string" == typeof e ? e : e.name
  45232. , o = this._actionsByClip[r];
  45233. return void 0 !== o ? o.actionByRoot[n] || null : null
  45234. },
  45235. stopAllAction: function() {
  45236. var e = this._actions
  45237. , t = this._nActiveActions
  45238. , i = this._bindings
  45239. , n = this._nActiveBindings;
  45240. this._nActiveActions = 0,
  45241. this._nActiveBindings = 0;
  45242. for (var r = 0; r !== t; ++r)
  45243. e[r].reset();
  45244. for (var r = 0; r !== n; ++r)
  45245. i[r].useCount = 0;
  45246. return this
  45247. },
  45248. update: function(e) {
  45249. e *= this.timeScale;
  45250. 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) {
  45251. var s = t[a];
  45252. s.enabled && s._update(n, e, r, o)
  45253. }
  45254. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45255. l[a].apply(o);
  45256. return this
  45257. },
  45258. getRoot: function() {
  45259. return this._root
  45260. },
  45261. uncacheClip: function(e) {
  45262. var t = this._actions
  45263. , i = e.name
  45264. , n = this._actionsByClip
  45265. , r = n[i];
  45266. if (void 0 !== r) {
  45267. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45268. var l = o[a];
  45269. this._deactivateAction(l);
  45270. var c = l._cacheIndex
  45271. , h = t[t.length - 1];
  45272. l._cacheIndex = null,
  45273. l._byClipCacheIndex = null,
  45274. h._cacheIndex = c,
  45275. t[c] = h,
  45276. t.pop(),
  45277. this._removeInactiveBindingsForAction(l)
  45278. }
  45279. delete n[i]
  45280. }
  45281. },
  45282. uncacheRoot: function(e) {
  45283. var t = e.uuid
  45284. , i = this._actionsByClip;
  45285. for (var n in i) {
  45286. var r = i[n].actionByRoot
  45287. , o = r[t];
  45288. void 0 !== o && (this._deactivateAction(o),
  45289. this._removeInactiveAction(o))
  45290. }
  45291. var a = this._bindingsByRootAndName
  45292. , s = a[t];
  45293. if (void 0 !== s)
  45294. for (var l in s) {
  45295. var c = s[l];
  45296. c.restoreOriginalState(),
  45297. this._removeInactiveBinding(c)
  45298. }
  45299. },
  45300. uncacheAction: function(e, t) {
  45301. var i = this.existingAction(e, t);
  45302. null !== i && (this._deactivateAction(i),
  45303. this._removeInactiveAction(i))
  45304. }
  45305. },
  45306. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45307. n.AnimationMixer._Action = function(e, t, i) {
  45308. this._mixer = e,
  45309. this._clip = t,
  45310. this._localRoot = i || null;
  45311. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45312. endingStart: n.ZeroCurvatureEnding,
  45313. endingEnd: n.ZeroCurvatureEnding
  45314. }, l = 0; l !== o; ++l) {
  45315. var c = r[l].createInterpolant(null);
  45316. a[l] = c,
  45317. c.settings = s
  45318. }
  45319. this._interpolantSettings = s,
  45320. this._interpolants = a,
  45321. this._propertyBindings = new Array(o),
  45322. this._cacheIndex = null,
  45323. this._byClipCacheIndex = null,
  45324. this._timeScaleInterpolant = null,
  45325. this._weightInterpolant = null,
  45326. this.loop = n.LoopRepeat,
  45327. this._loopCount = -1,
  45328. this._startTime = null,
  45329. this.time = 0,
  45330. this.timeScale = 1,
  45331. this._effectiveTimeScale = 1,
  45332. this.weight = 1,
  45333. this._effectiveWeight = 1,
  45334. this.repetitions = 1 / 0,
  45335. this.paused = !1,
  45336. this.enabled = !0,
  45337. this.clampWhenFinished = !1,
  45338. this.zeroSlopeAtStart = !0,
  45339. this.zeroSlopeAtEnd = !0
  45340. }
  45341. ,
  45342. n.AnimationMixer._Action.prototype = {
  45343. constructor: n.AnimationMixer._Action,
  45344. play: function() {
  45345. return this._mixer._activateAction(this),
  45346. this
  45347. },
  45348. stop: function() {
  45349. return this._mixer._deactivateAction(this),
  45350. this.reset()
  45351. },
  45352. reset: function() {
  45353. return this.paused = !1,
  45354. this.enabled = !0,
  45355. this.time = 0,
  45356. this._loopCount = -1,
  45357. this._startTime = null,
  45358. this.stopFading().stopWarping()
  45359. },
  45360. isRunning: function() {
  45361. this._startTime;
  45362. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45363. },
  45364. isScheduled: function() {
  45365. return this._mixer._isActiveAction(this)
  45366. },
  45367. startAt: function(e) {
  45368. return this._startTime = e,
  45369. this
  45370. },
  45371. setLoop: function(e, t) {
  45372. return this.loop = e,
  45373. this.repetitions = t,
  45374. this
  45375. },
  45376. setEffectiveWeight: function(e) {
  45377. return this.weight = e,
  45378. this._effectiveWeight = this.enabled ? e : 0,
  45379. this.stopFading()
  45380. },
  45381. getEffectiveWeight: function() {
  45382. return this._effectiveWeight
  45383. },
  45384. fadeIn: function(e) {
  45385. return this._scheduleFading(e, 0, 1)
  45386. },
  45387. fadeOut: function(e) {
  45388. return this._scheduleFading(e, 1, 0)
  45389. },
  45390. crossFadeFrom: function(e, t, i) {
  45391. this._mixer;
  45392. if (e.fadeOut(t),
  45393. this.fadeIn(t),
  45394. i) {
  45395. var n = this._clip.duration
  45396. , r = e._clip.duration
  45397. , o = r / n
  45398. , a = n / r;
  45399. e.warp(1, o, t),
  45400. this.warp(a, 1, t)
  45401. }
  45402. return this
  45403. },
  45404. crossFadeTo: function(e, t, i) {
  45405. return e.crossFadeFrom(this, t, i)
  45406. },
  45407. stopFading: function() {
  45408. var e = this._weightInterpolant;
  45409. return null !== e && (this._weightInterpolant = null,
  45410. this._mixer._takeBackControlInterpolant(e)),
  45411. this
  45412. },
  45413. setEffectiveTimeScale: function(e) {
  45414. return this.timeScale = e,
  45415. this._effectiveTimeScale = this.paused ? 0 : e,
  45416. this.stopWarping()
  45417. },
  45418. getEffectiveTimeScale: function() {
  45419. return this._effectiveTimeScale
  45420. },
  45421. setDuration: function(e) {
  45422. return this.timeScale = this._clip.duration / e,
  45423. this.stopWarping()
  45424. },
  45425. syncWith: function(e) {
  45426. return this.time = e.time,
  45427. this.timeScale = e.timeScale,
  45428. this.stopWarping()
  45429. },
  45430. halt: function(e) {
  45431. return this.warp(this._currentTimeScale, 0, e)
  45432. },
  45433. warp: function(e, t, i) {
  45434. var n = this._mixer
  45435. , r = n.time
  45436. , o = this._timeScaleInterpolant
  45437. , a = this.timeScale;
  45438. null === o && (o = n._lendControlInterpolant(),
  45439. this._timeScaleInterpolant = o);
  45440. var s = o.parameterPositions
  45441. , l = o.sampleValues;
  45442. return s[0] = r,
  45443. s[1] = r + i,
  45444. l[0] = e / a,
  45445. l[1] = t / a,
  45446. this
  45447. },
  45448. stopWarping: function() {
  45449. var e = this._timeScaleInterpolant;
  45450. return null !== e && (this._timeScaleInterpolant = null,
  45451. this._mixer._takeBackControlInterpolant(e)),
  45452. this
  45453. },
  45454. getMixer: function() {
  45455. return this._mixer
  45456. },
  45457. getClip: function() {
  45458. return this._clip
  45459. },
  45460. getRoot: function() {
  45461. return this._localRoot || this._mixer._root
  45462. },
  45463. _update: function(e, t, i, n) {
  45464. var r = this._startTime;
  45465. if (null !== r) {
  45466. var o = (e - r) * i;
  45467. if (o < 0 || 0 === i)
  45468. return;
  45469. this._startTime = null,
  45470. t = i * o
  45471. }
  45472. t *= this._updateTimeScale(e);
  45473. var a = this._updateTime(t)
  45474. , s = this._updateWeight(e);
  45475. if (s > 0)
  45476. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45477. l[h].evaluate(a),
  45478. c[h].accumulate(n, s)
  45479. },
  45480. _updateWeight: function(e) {
  45481. var t = 0;
  45482. if (this.enabled) {
  45483. t = this.weight;
  45484. var i = this._weightInterpolant;
  45485. if (null !== i) {
  45486. var n = i.evaluate(e)[0];
  45487. t *= n,
  45488. e > i.parameterPositions[1] && (this.stopFading(),
  45489. 0 === n && (this.enabled = !1))
  45490. }
  45491. }
  45492. return this._effectiveWeight = t,
  45493. t
  45494. },
  45495. _updateTimeScale: function(e) {
  45496. var t = 0;
  45497. if (!this.paused) {
  45498. t = this.timeScale;
  45499. var i = this._timeScaleInterpolant;
  45500. if (null !== i) {
  45501. var n = i.evaluate(e)[0];
  45502. t *= n,
  45503. e > i.parameterPositions[1] && (this.stopWarping(),
  45504. 0 === t ? this.pause = !0 : this.timeScale = t)
  45505. }
  45506. }
  45507. return this._effectiveTimeScale = t,
  45508. t
  45509. },
  45510. _updateTime: function(e) {
  45511. var t = this.time + e;
  45512. if (0 === e)
  45513. return t;
  45514. var i = this._clip.duration
  45515. , r = this.loop
  45516. , o = this._loopCount
  45517. , a = !1;
  45518. switch (r) {
  45519. case n.LoopOnce:
  45520. if (o === -1 && (this.loopCount = 0,
  45521. this._setEndings(!0, !0, !1)),
  45522. t >= i)
  45523. t = i;
  45524. else {
  45525. if (!(t < 0))
  45526. break;
  45527. t = 0
  45528. }
  45529. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45530. this._mixer.dispatchEvent({
  45531. type: "finished",
  45532. action: this,
  45533. direction: e < 0 ? -1 : 1
  45534. });
  45535. break;
  45536. case n.LoopPingPong:
  45537. a = !0;
  45538. case n.LoopRepeat:
  45539. if (o === -1 && (e > 0 ? (o = 0,
  45540. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45541. t >= i || t < 0) {
  45542. var s = Math.floor(t / i);
  45543. t -= i * s,
  45544. o += Math.abs(s);
  45545. var l = this.repetitions - o;
  45546. if (l < 0) {
  45547. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45548. t = e > 0 ? i : 0,
  45549. this._mixer.dispatchEvent({
  45550. type: "finished",
  45551. action: this,
  45552. direction: e > 0 ? 1 : -1
  45553. });
  45554. break
  45555. }
  45556. if (0 === l) {
  45557. var c = e < 0;
  45558. this._setEndings(c, !c, a)
  45559. } else
  45560. this._setEndings(!1, !1, a);
  45561. this._loopCount = o,
  45562. this._mixer.dispatchEvent({
  45563. type: "loop",
  45564. action: this,
  45565. loopDelta: s
  45566. })
  45567. }
  45568. if (r === n.LoopPingPong && 1 === (1 & o))
  45569. return this.time = t,
  45570. i - t
  45571. }
  45572. return this.time = t,
  45573. t
  45574. },
  45575. _setEndings: function(e, t, i) {
  45576. var r = this._interpolantSettings;
  45577. i ? (r.endingStart = n.ZeroSlopeEnding,
  45578. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45579. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45580. },
  45581. _scheduleFading: function(e, t, i) {
  45582. var n = this._mixer
  45583. , r = n.time
  45584. , o = this._weightInterpolant;
  45585. null === o && (o = n._lendControlInterpolant(),
  45586. this._weightInterpolant = o);
  45587. var a = o.parameterPositions
  45588. , s = o.sampleValues;
  45589. return a[0] = r,
  45590. s[0] = t,
  45591. a[1] = r + e,
  45592. s[1] = i,
  45593. this
  45594. }
  45595. },
  45596. Object.assign(n.AnimationMixer.prototype, {
  45597. _bindAction: function(e, t) {
  45598. var i = e._localRoot || this._root
  45599. , r = e._clip.tracks
  45600. , o = r.length
  45601. , a = e._propertyBindings
  45602. , s = e._interpolants
  45603. , l = i.uuid
  45604. , c = this._bindingsByRootAndName
  45605. , h = c[l];
  45606. void 0 === h && (h = {},
  45607. c[l] = h);
  45608. for (var u = 0; u !== o; ++u) {
  45609. var d = r[u]
  45610. , p = d.name
  45611. , f = h[p];
  45612. if (void 0 !== f)
  45613. a[u] = f;
  45614. else {
  45615. if (f = a[u],
  45616. void 0 !== f) {
  45617. null === f._cacheIndex && (++f.referenceCount,
  45618. this._addInactiveBinding(f, l, p));
  45619. continue
  45620. }
  45621. var g = t && t._propertyBindings[u].binding.parsedPath;
  45622. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45623. ++f.referenceCount,
  45624. this._addInactiveBinding(f, l, p),
  45625. a[u] = f
  45626. }
  45627. s[u].resultBuffer = f.buffer
  45628. }
  45629. },
  45630. _activateAction: function(e) {
  45631. if (!this._isActiveAction(e)) {
  45632. if (null === e._cacheIndex) {
  45633. var t = (e._localRoot || this._root).uuid
  45634. , i = e._clip.name
  45635. , n = this._actionsByClip[i];
  45636. this._bindAction(e, n && n.knownActions[0]),
  45637. this._addInactiveAction(e, i, t)
  45638. }
  45639. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45640. var s = r[o];
  45641. 0 === s.useCount++ && (this._lendBinding(s),
  45642. s.saveOriginalState())
  45643. }
  45644. this._lendAction(e)
  45645. }
  45646. },
  45647. _deactivateAction: function(e) {
  45648. if (this._isActiveAction(e)) {
  45649. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45650. var r = t[i];
  45651. 0 === --r.useCount && (r.restoreOriginalState(),
  45652. this._takeBackBinding(r))
  45653. }
  45654. this._takeBackAction(e)
  45655. }
  45656. },
  45657. _initMemoryManager: function() {
  45658. this._actions = [],
  45659. this._nActiveActions = 0,
  45660. this._actionsByClip = {},
  45661. this._bindings = [],
  45662. this._nActiveBindings = 0,
  45663. this._bindingsByRootAndName = {},
  45664. this._controlInterpolants = [],
  45665. this._nActiveControlInterpolants = 0;
  45666. var e = this;
  45667. this.stats = {
  45668. actions: {
  45669. get total() {
  45670. return e._actions.length
  45671. },
  45672. get inUse() {
  45673. return e._nActiveActions
  45674. }
  45675. },
  45676. bindings: {
  45677. get total() {
  45678. return e._bindings.length
  45679. },
  45680. get inUse() {
  45681. return e._nActiveBindings
  45682. }
  45683. },
  45684. controlInterpolants: {
  45685. get total() {
  45686. return e._controlInterpolants.length
  45687. },
  45688. get inUse() {
  45689. return e._nActiveControlInterpolants
  45690. }
  45691. }
  45692. }
  45693. },
  45694. _isActiveAction: function(e) {
  45695. var t = e._cacheIndex;
  45696. return null !== t && t < this._nActiveActions
  45697. },
  45698. _addInactiveAction: function(e, t, i) {
  45699. var n = this._actions
  45700. , r = this._actionsByClip
  45701. , o = r[t];
  45702. if (void 0 === o)
  45703. o = {
  45704. knownActions: [e],
  45705. actionByRoot: {}
  45706. },
  45707. e._byClipCacheIndex = 0,
  45708. r[t] = o;
  45709. else {
  45710. var a = o.knownActions;
  45711. e._byClipCacheIndex = a.length,
  45712. a.push(e)
  45713. }
  45714. e._cacheIndex = n.length,
  45715. n.push(e),
  45716. o.actionByRoot[i] = e
  45717. },
  45718. _removeInactiveAction: function(e) {
  45719. var t = this._actions
  45720. , i = t[t.length - 1]
  45721. , n = e._cacheIndex;
  45722. i._cacheIndex = n,
  45723. t[n] = i,
  45724. t.pop(),
  45725. e._cacheIndex = null;
  45726. var r = e._clip.name
  45727. , o = this._actionsByClip
  45728. , a = o[r]
  45729. , s = a.knownActions
  45730. , l = s[s.length - 1]
  45731. , c = e._byClipCacheIndex;
  45732. l._byClipCacheIndex = c,
  45733. s[c] = l,
  45734. s.pop(),
  45735. e._byClipCacheIndex = null;
  45736. var h = a.actionByRoot
  45737. , u = (t._localRoot || this._root).uuid;
  45738. delete h[u],
  45739. 0 === s.length && delete o[r],
  45740. this._removeInactiveBindingsForAction(e)
  45741. },
  45742. _removeInactiveBindingsForAction: function(e) {
  45743. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45744. var r = t[i];
  45745. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45746. }
  45747. },
  45748. _lendAction: function(e) {
  45749. var t = this._actions
  45750. , i = e._cacheIndex
  45751. , n = this._nActiveActions++
  45752. , r = t[n];
  45753. e._cacheIndex = n,
  45754. t[n] = e,
  45755. r._cacheIndex = i,
  45756. t[i] = r
  45757. },
  45758. _takeBackAction: function(e) {
  45759. var t = this._actions
  45760. , i = e._cacheIndex
  45761. , n = --this._nActiveActions
  45762. , r = t[n];
  45763. e._cacheIndex = n,
  45764. t[n] = e,
  45765. r._cacheIndex = i,
  45766. t[i] = r
  45767. },
  45768. _addInactiveBinding: function(e, t, i) {
  45769. var n = this._bindingsByRootAndName
  45770. , r = n[t]
  45771. , o = this._bindings;
  45772. void 0 === r && (r = {},
  45773. n[t] = r),
  45774. r[i] = e,
  45775. e._cacheIndex = o.length,
  45776. o.push(e)
  45777. },
  45778. _removeInactiveBinding: function(e) {
  45779. var t = this._bindings
  45780. , i = e.binding
  45781. , n = i.rootNode.uuid
  45782. , r = i.path
  45783. , o = this._bindingsByRootAndName
  45784. , a = o[n]
  45785. , s = t[t.length - 1]
  45786. , l = e._cacheIndex;
  45787. s._cacheIndex = l,
  45788. t[l] = s,
  45789. t.pop(),
  45790. delete a[r];
  45791. e: {
  45792. for (var c in a)
  45793. break e;
  45794. delete o[n]
  45795. }
  45796. },
  45797. _lendBinding: function(e) {
  45798. var t = this._bindings
  45799. , i = e._cacheIndex
  45800. , n = this._nActiveBindings++
  45801. , r = t[n];
  45802. e._cacheIndex = n,
  45803. t[n] = e,
  45804. r._cacheIndex = i,
  45805. t[i] = r
  45806. },
  45807. _takeBackBinding: function(e) {
  45808. var t = this._bindings
  45809. , i = e._cacheIndex
  45810. , n = --this._nActiveBindings
  45811. , r = t[n];
  45812. e._cacheIndex = n,
  45813. t[n] = e,
  45814. r._cacheIndex = i,
  45815. t[i] = r
  45816. },
  45817. _lendControlInterpolant: function() {
  45818. var e = this._controlInterpolants
  45819. , t = this._nActiveControlInterpolants++
  45820. , i = e[t];
  45821. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  45822. i.__cacheIndex = t,
  45823. e[t] = i),
  45824. i
  45825. },
  45826. _takeBackControlInterpolant: function(e) {
  45827. var t = this._controlInterpolants
  45828. , i = e.__cacheIndex
  45829. , n = --this._nActiveControlInterpolants
  45830. , r = t[n];
  45831. e.__cacheIndex = n,
  45832. t[n] = e,
  45833. r.__cacheIndex = i,
  45834. t[i] = r
  45835. },
  45836. _controlInterpolantsResultBuffer: new Float32Array(1)
  45837. }),
  45838. n.AnimationObjectGroup = function(e) {
  45839. this.uuid = n.Math.generateUUID(),
  45840. this._objects = Array.prototype.slice.call(arguments),
  45841. this.nCachedObjects_ = 0;
  45842. var t = {};
  45843. this._indicesByUUID = t;
  45844. for (var i = 0, r = arguments.length; i !== r; ++i)
  45845. t[arguments[i].uuid] = i;
  45846. this._paths = [],
  45847. this._parsedPaths = [],
  45848. this._bindings = [],
  45849. this._bindingsIndicesByPath = {};
  45850. var o = this;
  45851. this.stats = {
  45852. objects: {
  45853. get total() {
  45854. return o._objects.length
  45855. },
  45856. get inUse() {
  45857. return this.total - o.nCachedObjects_
  45858. }
  45859. },
  45860. get bindingsPerObject() {
  45861. return o._bindings.length
  45862. }
  45863. }
  45864. }
  45865. ,
  45866. n.AnimationObjectGroup.prototype = {
  45867. constructor: n.AnimationObjectGroup,
  45868. add: function(e) {
  45869. 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) {
  45870. var d = arguments[h]
  45871. , p = d.uuid
  45872. , f = o[p];
  45873. if (void 0 === f) {
  45874. f = i++,
  45875. o[p] = f,
  45876. t.push(d);
  45877. for (var g = 0, m = c; g !== m; ++g)
  45878. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  45879. } else if (f < r) {
  45880. var v = t[f]
  45881. , A = --r
  45882. , y = t[A];
  45883. o[y.uuid] = f,
  45884. t[f] = y,
  45885. o[p] = A,
  45886. t[A] = d;
  45887. for (var g = 0, m = c; g !== m; ++g) {
  45888. var C = l[g]
  45889. , I = C[A]
  45890. , E = C[f];
  45891. C[f] = I,
  45892. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  45893. C[A] = E
  45894. }
  45895. } else
  45896. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  45897. }
  45898. this.nCachedObjects_ = r
  45899. },
  45900. remove: function(e) {
  45901. for (var t = this._objects, i = (t.length,
  45902. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  45903. var l = arguments[a]
  45904. , c = l.uuid
  45905. , h = n[c];
  45906. if (void 0 !== h && h >= i) {
  45907. var u = i++
  45908. , d = t[u];
  45909. n[d.uuid] = h,
  45910. t[h] = d,
  45911. n[c] = u,
  45912. t[u] = l;
  45913. for (var p = 0, f = o; p !== f; ++p) {
  45914. var g = r[p]
  45915. , m = g[u]
  45916. , v = g[h];
  45917. g[h] = m,
  45918. g[u] = v
  45919. }
  45920. }
  45921. }
  45922. this.nCachedObjects_ = i
  45923. },
  45924. uncache: function(e) {
  45925. 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) {
  45926. var c = arguments[s]
  45927. , h = c.uuid
  45928. , u = r[h];
  45929. if (void 0 !== u)
  45930. if (delete r[h],
  45931. u < n) {
  45932. var d = --n
  45933. , p = t[d]
  45934. , f = --i
  45935. , g = t[f];
  45936. r[p.uuid] = u,
  45937. t[u] = p,
  45938. r[g.uuid] = d,
  45939. t[d] = g,
  45940. t.pop();
  45941. for (var m = 0, v = a; m !== v; ++m) {
  45942. var A = o[m]
  45943. , y = A[d]
  45944. , C = A[f];
  45945. A[u] = y,
  45946. A[d] = C,
  45947. A.pop()
  45948. }
  45949. } else {
  45950. var f = --i
  45951. , g = t[f];
  45952. r[g.uuid] = u,
  45953. t[u] = g,
  45954. t.pop();
  45955. for (var m = 0, v = a; m !== v; ++m) {
  45956. var A = o[m];
  45957. A[u] = A[f],
  45958. A.pop()
  45959. }
  45960. }
  45961. }
  45962. this.nCachedObjects_ = n
  45963. },
  45964. subscribe_: function(e, t) {
  45965. var i = this._bindingsIndicesByPath
  45966. , r = i[e]
  45967. , o = this._bindings;
  45968. if (void 0 !== r)
  45969. return o[r];
  45970. var a = this._paths
  45971. , s = this._parsedPaths
  45972. , l = this._objects
  45973. , c = l.length
  45974. , h = this.nCachedObjects_
  45975. , u = new Array(c);
  45976. r = o.length,
  45977. i[e] = r,
  45978. a.push(e),
  45979. s.push(t),
  45980. o.push(u);
  45981. for (var d = h, p = l.length; d !== p; ++d) {
  45982. var f = l[d];
  45983. u[d] = new n.PropertyBinding(f,e,t)
  45984. }
  45985. return u
  45986. },
  45987. unsubscribe_: function(e) {
  45988. var t = this._bindingsIndicesByPath
  45989. , i = t[e];
  45990. if (void 0 !== i) {
  45991. var n = this._paths
  45992. , r = this._parsedPaths
  45993. , o = this._bindings
  45994. , a = o.length - 1
  45995. , s = o[a]
  45996. , l = e[a];
  45997. t[l] = i,
  45998. o[i] = s,
  45999. o.pop(),
  46000. r[i] = r[a],
  46001. r.pop(),
  46002. n[i] = n[a],
  46003. n.pop()
  46004. }
  46005. }
  46006. },
  46007. n.AnimationUtils = {
  46008. arraySlice: function(e, t, i) {
  46009. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46010. },
  46011. convertArray: function(e, t, i) {
  46012. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46013. },
  46014. isTypedArray: function(e) {
  46015. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46016. },
  46017. getKeyframeOrder: function(e) {
  46018. function t(t, i) {
  46019. return e[t] - e[i]
  46020. }
  46021. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46022. n[r] = r;
  46023. return n.sort(t),
  46024. n
  46025. },
  46026. sortedArray: function(e, t, i) {
  46027. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46028. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46029. r[a++] = e[s + l];
  46030. return r
  46031. },
  46032. flattenJSON: function(e, t, i, n) {
  46033. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46034. o = e[r++];
  46035. if (void 0 !== o) {
  46036. var a = o[n];
  46037. if (void 0 !== a)
  46038. if (Array.isArray(a)) {
  46039. do
  46040. a = o[n],
  46041. void 0 !== a && (t.push(o.time),
  46042. i.push.apply(i, a)),
  46043. o = e[r++];
  46044. while (void 0 !== o)
  46045. } else if (void 0 !== a.toArray) {
  46046. do
  46047. a = o[n],
  46048. void 0 !== a && (t.push(o.time),
  46049. a.toArray(i, i.length)),
  46050. o = e[r++];
  46051. while (void 0 !== o)
  46052. } else
  46053. do
  46054. a = o[n],
  46055. void 0 !== a && (t.push(o.time),
  46056. i.push(a)),
  46057. o = e[r++];
  46058. while (void 0 !== o)
  46059. }
  46060. }
  46061. },
  46062. n.KeyframeTrack = function(e, t, i, r) {
  46063. if (void 0 === e)
  46064. throw new Error("track name is undefined");
  46065. if (void 0 === t || 0 === t.length)
  46066. throw new Error("no keyframes in track named " + e);
  46067. this.name = e,
  46068. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46069. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46070. this.setInterpolation(r || this.DefaultInterpolation),
  46071. this.validate(),
  46072. this.optimize()
  46073. }
  46074. ,
  46075. n.KeyframeTrack.prototype = {
  46076. constructor: n.KeyframeTrack,
  46077. TimeBufferType: Float32Array,
  46078. ValueBufferType: Float32Array,
  46079. DefaultInterpolation: n.InterpolateLinear,
  46080. InterpolantFactoryMethodDiscrete: function(e) {
  46081. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46082. },
  46083. InterpolantFactoryMethodLinear: function(e) {
  46084. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46085. },
  46086. InterpolantFactoryMethodSmooth: function(e) {
  46087. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46088. },
  46089. setInterpolation: function(e) {
  46090. var t = void 0;
  46091. switch (e) {
  46092. case n.InterpolateDiscrete:
  46093. t = this.InterpolantFactoryMethodDiscrete;
  46094. break;
  46095. case n.InterpolateLinear:
  46096. t = this.InterpolantFactoryMethodLinear;
  46097. break;
  46098. case n.InterpolateSmooth:
  46099. t = this.InterpolantFactoryMethodSmooth
  46100. }
  46101. if (void 0 === t) {
  46102. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46103. if (void 0 === this.createInterpolant) {
  46104. if (e === this.DefaultInterpolation)
  46105. throw new Error(i);
  46106. this.setInterpolation(this.DefaultInterpolation)
  46107. }
  46108. return void console.warn(i)
  46109. }
  46110. this.createInterpolant = t
  46111. },
  46112. getInterpolation: function() {
  46113. switch (this.createInterpolant) {
  46114. case this.InterpolantFactoryMethodDiscrete:
  46115. return n.InterpolateDiscrete;
  46116. case this.InterpolantFactoryMethodLinear:
  46117. return n.InterpolateLinear;
  46118. case this.InterpolantFactoryMethodSmooth:
  46119. return n.InterpolateSmooth
  46120. }
  46121. },
  46122. getValueSize: function() {
  46123. return this.values.length / this.times.length
  46124. },
  46125. shift: function(e) {
  46126. if (0 !== e)
  46127. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46128. t[i] += e;
  46129. return this
  46130. },
  46131. scale: function(e) {
  46132. if (1 !== e)
  46133. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46134. t[i] *= e;
  46135. return this
  46136. },
  46137. trim: function(e, t) {
  46138. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46139. ++o;
  46140. for (; a !== -1 && i[a] > t; )
  46141. --a;
  46142. if (++a,
  46143. 0 !== o || a !== r) {
  46144. o >= a && (a = Math.max(a, 1),
  46145. o = a - 1);
  46146. var s = this.getValueSize();
  46147. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46148. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46149. }
  46150. return this
  46151. },
  46152. validate: function() {
  46153. var e = !0
  46154. , t = this.getValueSize();
  46155. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46156. e = !1);
  46157. var i = this.times
  46158. , r = this.values
  46159. , o = i.length;
  46160. 0 === o && (console.error("track is empty", this),
  46161. e = !1);
  46162. for (var a = null, s = 0; s !== o; s++) {
  46163. var l = i[s];
  46164. if ("number" == typeof l && isNaN(l)) {
  46165. console.error("time is not a valid number", this, s, l),
  46166. e = !1;
  46167. break
  46168. }
  46169. if (null !== a && a > l) {
  46170. console.error("out of order keys", this, s, l, a),
  46171. e = !1;
  46172. break
  46173. }
  46174. a = l
  46175. }
  46176. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46177. for (var s = 0, c = r.length; s !== c; ++s) {
  46178. var h = r[s];
  46179. if (isNaN(h)) {
  46180. console.error("value is not a valid number", this, s, h),
  46181. e = !1;
  46182. break
  46183. }
  46184. }
  46185. return e
  46186. },
  46187. optimize: function() {
  46188. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46189. var s = !1
  46190. , l = e[o]
  46191. , c = e[o + 1];
  46192. if (l !== c && (1 !== o || l !== l[0]))
  46193. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46194. var f = t[h + p];
  46195. if (f !== t[u + p] || f !== t[d + p]) {
  46196. s = !0;
  46197. break
  46198. }
  46199. }
  46200. if (s) {
  46201. if (o !== r) {
  46202. e[r] = e[o];
  46203. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46204. t[m + p] = t[g + p]
  46205. }
  46206. ++r
  46207. }
  46208. }
  46209. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46210. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46211. this
  46212. }
  46213. },
  46214. Object.assign(n.KeyframeTrack, {
  46215. parse: function(e) {
  46216. if (void 0 === e.type)
  46217. throw new Error("track type undefined, can not parse");
  46218. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46219. if (void 0 === e.times) {
  46220. console.warn("legacy JSON format detected, converting");
  46221. var i = []
  46222. , r = [];
  46223. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46224. e.times = i,
  46225. e.values = r
  46226. }
  46227. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46228. },
  46229. toJSON: function(e) {
  46230. var t, i = e.constructor;
  46231. if (void 0 !== i.toJSON)
  46232. t = i.toJSON(e);
  46233. else {
  46234. t = {
  46235. name: e.name,
  46236. times: n.AnimationUtils.convertArray(e.times, Array),
  46237. values: n.AnimationUtils.convertArray(e.values, Array)
  46238. };
  46239. var r = e.getInterpolation();
  46240. r !== e.DefaultInterpolation && (t.interpolation = r)
  46241. }
  46242. return t.type = e.ValueTypeName,
  46243. t
  46244. },
  46245. _getTrackTypeForValueTypeName: function(e) {
  46246. switch (e.toLowerCase()) {
  46247. case "scalar":
  46248. case "double":
  46249. case "float":
  46250. case "number":
  46251. case "integer":
  46252. return n.NumberKeyframeTrack;
  46253. case "vector":
  46254. case "vector2":
  46255. case "vector3":
  46256. case "vector4":
  46257. return n.VectorKeyframeTrack;
  46258. case "color":
  46259. return n.ColorKeyframeTrack;
  46260. case "quaternion":
  46261. return n.QuaternionKeyframeTrack;
  46262. case "bool":
  46263. case "boolean":
  46264. return n.BooleanKeyframeTrack;
  46265. case "string":
  46266. return n.StringKeyframeTrack
  46267. }
  46268. throw new Error("Unsupported typeName: " + e)
  46269. }
  46270. }),
  46271. n.PropertyBinding = function(e, t, i) {
  46272. this.path = t,
  46273. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46274. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46275. this.rootNode = e
  46276. }
  46277. ,
  46278. n.PropertyBinding.prototype = {
  46279. constructor: n.PropertyBinding,
  46280. getValue: function(e, t) {
  46281. this.bind(),
  46282. this.getValue(e, t)
  46283. },
  46284. setValue: function(e, t) {
  46285. this.bind(),
  46286. this.setValue(e, t)
  46287. },
  46288. bind: function() {
  46289. var e = this.node
  46290. , t = this.parsedPath
  46291. , i = t.objectName
  46292. , r = t.propertyName
  46293. , o = t.propertyIndex;
  46294. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46295. this.node = e),
  46296. this.getValue = this._getValue_unavailable,
  46297. this.setValue = this._setValue_unavailable,
  46298. !e)
  46299. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46300. if (i) {
  46301. var a = t.objectIndex;
  46302. switch (i) {
  46303. case "materials":
  46304. if (!e.material)
  46305. return void console.error(" can not bind to material as node does not have a material", this);
  46306. if (!e.material.materials)
  46307. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46308. e = e.material.materials;
  46309. break;
  46310. case "bones":
  46311. if (!e.skeleton)
  46312. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46313. e = e.skeleton.bones;
  46314. for (var s = 0; s < e.length; s++)
  46315. if (e[s].name === a) {
  46316. a = s;
  46317. break
  46318. }
  46319. break;
  46320. default:
  46321. if (void 0 === e[i])
  46322. return void console.error(" can not bind to objectName of node, undefined", this);
  46323. e = e[i]
  46324. }
  46325. if (void 0 !== a) {
  46326. if (void 0 === e[a])
  46327. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46328. e = e[a]
  46329. }
  46330. }
  46331. var l = e[r];
  46332. if (!l) {
  46333. var c = t.nodeName;
  46334. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46335. }
  46336. var h = this.Versioning.None;
  46337. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46338. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46339. this.targetObject = e);
  46340. var u = this.BindingType.Direct;
  46341. if (void 0 !== o) {
  46342. if ("morphTargetInfluences" === r) {
  46343. if (!e.geometry)
  46344. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46345. if (!e.geometry.morphTargets)
  46346. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46347. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46348. if (e.geometry.morphTargets[s].name === o) {
  46349. o = s;
  46350. break
  46351. }
  46352. }
  46353. u = this.BindingType.ArrayElement,
  46354. this.resolvedProperty = l,
  46355. this.propertyIndex = o
  46356. } else
  46357. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46358. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46359. this.resolvedProperty = l) : this.propertyName = r;
  46360. this.getValue = this.GetterByBindingType[u],
  46361. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46362. },
  46363. unbind: function() {
  46364. this.node = null,
  46365. this.getValue = this._getValue_unbound,
  46366. this.setValue = this._setValue_unbound
  46367. }
  46368. },
  46369. Object.assign(n.PropertyBinding.prototype, {
  46370. _getValue_unavailable: function() {},
  46371. _setValue_unavailable: function() {},
  46372. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46373. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46374. BindingType: {
  46375. Direct: 0,
  46376. EntireArray: 1,
  46377. ArrayElement: 2,
  46378. HasFromToArray: 3
  46379. },
  46380. Versioning: {
  46381. None: 0,
  46382. NeedsUpdate: 1,
  46383. MatrixWorldNeedsUpdate: 2
  46384. },
  46385. GetterByBindingType: [function(e, t) {
  46386. e[t] = this.node[this.propertyName]
  46387. }
  46388. , function(e, t) {
  46389. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46390. e[t++] = i[n]
  46391. }
  46392. , function(e, t) {
  46393. e[t] = this.resolvedProperty[this.propertyIndex]
  46394. }
  46395. , function(e, t) {
  46396. this.resolvedProperty.toArray(e, t)
  46397. }
  46398. ],
  46399. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46400. this.node[this.propertyName] = e[t]
  46401. }
  46402. , function(e, t) {
  46403. this.node[this.propertyName] = e[t],
  46404. this.targetObject.needsUpdate = !0
  46405. }
  46406. , function(e, t) {
  46407. this.node[this.propertyName] = e[t],
  46408. this.targetObject.matrixWorldNeedsUpdate = !0
  46409. }
  46410. ], [function(e, t) {
  46411. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46412. i[n] = e[t++]
  46413. }
  46414. , function(e, t) {
  46415. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46416. i[n] = e[t++];
  46417. this.targetObject.needsUpdate = !0
  46418. }
  46419. , function(e, t) {
  46420. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46421. i[n] = e[t++];
  46422. this.targetObject.matrixWorldNeedsUpdate = !0
  46423. }
  46424. ], [function(e, t) {
  46425. this.resolvedProperty[this.propertyIndex] = e[t]
  46426. }
  46427. , function(e, t) {
  46428. this.resolvedProperty[this.propertyIndex] = e[t],
  46429. this.targetObject.needsUpdate = !0
  46430. }
  46431. , function(e, t) {
  46432. this.resolvedProperty[this.propertyIndex] = e[t],
  46433. this.targetObject.matrixWorldNeedsUpdate = !0
  46434. }
  46435. ], [function(e, t) {
  46436. this.resolvedProperty.fromArray(e, t)
  46437. }
  46438. , function(e, t) {
  46439. this.resolvedProperty.fromArray(e, t),
  46440. this.targetObject.needsUpdate = !0
  46441. }
  46442. , function(e, t) {
  46443. this.resolvedProperty.fromArray(e, t),
  46444. this.targetObject.matrixWorldNeedsUpdate = !0
  46445. }
  46446. ]]
  46447. }),
  46448. n.PropertyBinding.Composite = function(e, t, i) {
  46449. var r = i || n.PropertyBinding.parseTrackName(t);
  46450. this._targetGroup = e,
  46451. this._bindings = e.subscribe_(t, r)
  46452. }
  46453. ,
  46454. n.PropertyBinding.Composite.prototype = {
  46455. constructor: n.PropertyBinding.Composite,
  46456. getValue: function(e, t) {
  46457. this.bind();
  46458. var i = this._targetGroup.nCachedObjects_
  46459. , n = this._bindings[i];
  46460. void 0 !== n && n.getValue(e, t)
  46461. },
  46462. setValue: function(e, t) {
  46463. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46464. i[n].setValue(e, t)
  46465. },
  46466. bind: function() {
  46467. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46468. e[t].bind()
  46469. },
  46470. unbind: function() {
  46471. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46472. e[t].unbind()
  46473. }
  46474. },
  46475. n.PropertyBinding.create = function(e, t, i) {
  46476. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46477. }
  46478. ,
  46479. n.PropertyBinding.parseTrackName = function(e) {
  46480. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46481. , i = t.exec(e);
  46482. if (!i)
  46483. throw new Error("cannot parse trackName at all: " + e);
  46484. i.index === t.lastIndex && t.lastIndex++;
  46485. var n = {
  46486. nodeName: i[3],
  46487. objectName: i[5],
  46488. objectIndex: i[7],
  46489. propertyName: i[9],
  46490. propertyIndex: i[11]
  46491. };
  46492. if (null === n.propertyName || 0 === n.propertyName.length)
  46493. throw new Error("can not parse propertyName from trackName: " + e);
  46494. return n
  46495. }
  46496. ,
  46497. n.PropertyBinding.findNode = function(e, t) {
  46498. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46499. return e;
  46500. if (e.skeleton) {
  46501. var i = function(e) {
  46502. for (var i = 0; i < e.bones.length; i++) {
  46503. var n = e.bones[i];
  46504. if (n.name === t)
  46505. return n
  46506. }
  46507. return null
  46508. }
  46509. , n = i(e.skeleton);
  46510. if (n)
  46511. return n
  46512. }
  46513. if (e.children) {
  46514. var r = function(e) {
  46515. for (var i = 0; i < e.length; i++) {
  46516. var n = e[i];
  46517. if (n.name === t || n.uuid === t)
  46518. return n;
  46519. var o = r(n.children);
  46520. if (o)
  46521. return o
  46522. }
  46523. return null
  46524. }
  46525. , o = r(e.children);
  46526. if (o)
  46527. return o
  46528. }
  46529. return null
  46530. }
  46531. ,
  46532. n.PropertyMixer = function(e, t, i) {
  46533. this.binding = e,
  46534. this.valueSize = i;
  46535. var n, r = Float64Array;
  46536. switch (t) {
  46537. case "quaternion":
  46538. n = this._slerp;
  46539. break;
  46540. case "string":
  46541. case "bool":
  46542. r = Array,
  46543. n = this._select;
  46544. break;
  46545. default:
  46546. n = this._lerp
  46547. }
  46548. this.buffer = new r(4 * i),
  46549. this._mixBufferRegion = n,
  46550. this.cumulativeWeight = 0,
  46551. this.useCount = 0,
  46552. this.referenceCount = 0
  46553. }
  46554. ,
  46555. n.PropertyMixer.prototype = {
  46556. constructor: n.PropertyMixer,
  46557. accumulate: function(e, t) {
  46558. var i = this.buffer
  46559. , n = this.valueSize
  46560. , r = e * n + n
  46561. , o = this.cumulativeWeight;
  46562. if (0 === o) {
  46563. for (var a = 0; a !== n; ++a)
  46564. i[r + a] = i[a];
  46565. o = t
  46566. } else {
  46567. o += t;
  46568. var s = t / o;
  46569. this._mixBufferRegion(i, r, 0, s, n)
  46570. }
  46571. this.cumulativeWeight = o
  46572. },
  46573. apply: function(e) {
  46574. var t = this.valueSize
  46575. , i = this.buffer
  46576. , n = e * t + t
  46577. , r = this.cumulativeWeight
  46578. , o = this.binding;
  46579. if (this.cumulativeWeight = 0,
  46580. r < 1) {
  46581. var a = 3 * t;
  46582. this._mixBufferRegion(i, n, a, 1 - r, t)
  46583. }
  46584. for (var s = t, l = t + t; s !== l; ++s)
  46585. if (i[s] !== i[s + t]) {
  46586. o.setValue(i, n);
  46587. break
  46588. }
  46589. },
  46590. saveOriginalState: function() {
  46591. var e = this.binding
  46592. , t = this.buffer
  46593. , i = this.valueSize
  46594. , n = 3 * i;
  46595. e.getValue(t, n);
  46596. for (var r = i, o = n; r !== o; ++r)
  46597. t[r] = t[n + r % i];
  46598. this.cumulativeWeight = 0
  46599. },
  46600. restoreOriginalState: function() {
  46601. var e = 3 * this.valueSize;
  46602. this.binding.setValue(this.buffer, e)
  46603. },
  46604. _select: function(e, t, i, n, r) {
  46605. if (n >= .5)
  46606. for (var o = 0; o !== r; ++o)
  46607. e[t + o] = e[i + o]
  46608. },
  46609. _slerp: function(e, t, i, r, o) {
  46610. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46611. },
  46612. _lerp: function(e, t, i, n, r) {
  46613. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46614. var s = t + a;
  46615. e[s] = e[s] * o + e[i + a] * n
  46616. }
  46617. }
  46618. },
  46619. n.BooleanKeyframeTrack = function(e, t, i) {
  46620. n.KeyframeTrack.call(this, e, t, i)
  46621. }
  46622. ,
  46623. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46624. constructor: n.BooleanKeyframeTrack,
  46625. ValueTypeName: "bool",
  46626. ValueBufferType: Array,
  46627. DefaultInterpolation: n.IntepolateDiscrete,
  46628. InterpolantFactoryMethodLinear: void 0,
  46629. InterpolantFactoryMethodSmooth: void 0
  46630. }),
  46631. n.NumberKeyframeTrack = function(e, t, i, r) {
  46632. n.KeyframeTrack.call(this, e, t, i, r)
  46633. }
  46634. ,
  46635. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46636. constructor: n.NumberKeyframeTrack,
  46637. ValueTypeName: "number"
  46638. }),
  46639. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46640. n.KeyframeTrack.call(this, e, t, i, r)
  46641. }
  46642. ,
  46643. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46644. constructor: n.QuaternionKeyframeTrack,
  46645. ValueTypeName: "quaternion",
  46646. DefaultInterpolation: n.InterpolateLinear,
  46647. InterpolantFactoryMethodLinear: function(e) {
  46648. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46649. },
  46650. InterpolantFactoryMethodSmooth: void 0
  46651. }),
  46652. n.StringKeyframeTrack = function(e, t, i, r) {
  46653. n.KeyframeTrack.call(this, e, t, i, r)
  46654. }
  46655. ,
  46656. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46657. constructor: n.StringKeyframeTrack,
  46658. ValueTypeName: "string",
  46659. ValueBufferType: Array,
  46660. DefaultInterpolation: n.IntepolateDiscrete,
  46661. InterpolantFactoryMethodLinear: void 0,
  46662. InterpolantFactoryMethodSmooth: void 0
  46663. }),
  46664. n.VectorKeyframeTrack = function(e, t, i, r) {
  46665. n.KeyframeTrack.call(this, e, t, i, r)
  46666. }
  46667. ,
  46668. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46669. constructor: n.VectorKeyframeTrack,
  46670. ValueTypeName: "vector"
  46671. }),
  46672. n.Audio = function(e) {
  46673. n.Object3D.call(this),
  46674. this.type = "Audio",
  46675. this.context = e.context,
  46676. this.source = this.context.createBufferSource(),
  46677. this.source.onended = this.onEnded.bind(this),
  46678. this.gain = this.context.createGain(),
  46679. this.gain.connect(e.getInput()),
  46680. this.autoplay = !1,
  46681. this.startTime = 0,
  46682. this.playbackRate = 1,
  46683. this.isPlaying = !1,
  46684. this.hasPlaybackControl = !0,
  46685. this.sourceType = "empty",
  46686. this.filter = null
  46687. }
  46688. ,
  46689. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46690. n.Audio.prototype.constructor = n.Audio,
  46691. n.Audio.prototype.getOutput = function() {
  46692. return this.gain
  46693. }
  46694. ,
  46695. n.Audio.prototype.load = function(e) {
  46696. var t = new n.AudioBuffer(this.context);
  46697. return t.load(e),
  46698. this.setBuffer(t),
  46699. this
  46700. }
  46701. ,
  46702. n.Audio.prototype.setNodeSource = function(e) {
  46703. return this.hasPlaybackControl = !1,
  46704. this.sourceType = "audioNode",
  46705. this.source = e,
  46706. this.connect(),
  46707. this
  46708. }
  46709. ,
  46710. n.Audio.prototype.setBuffer = function(e) {
  46711. var t = this;
  46712. return e.onReady(function(e) {
  46713. t.source.buffer = e,
  46714. t.sourceType = "buffer",
  46715. t.autoplay && t.play()
  46716. }),
  46717. this
  46718. }
  46719. ,
  46720. n.Audio.prototype.play = function() {
  46721. if (this.isPlaying === !0)
  46722. return void console.warn("THREE.Audio: Audio is already playing.");
  46723. if (this.hasPlaybackControl === !1)
  46724. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46725. var e = this.context.createBufferSource();
  46726. e.buffer = this.source.buffer,
  46727. e.loop = this.source.loop,
  46728. e.onended = this.source.onended,
  46729. e.start(0, this.startTime),
  46730. e.playbackRate.value = this.playbackRate,
  46731. this.isPlaying = !0,
  46732. this.source = e,
  46733. this.connect()
  46734. }
  46735. ,
  46736. n.Audio.prototype.pause = function() {
  46737. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46738. void (this.startTime = this.context.currentTime))
  46739. }
  46740. ,
  46741. n.Audio.prototype.stop = function() {
  46742. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46743. void (this.startTime = 0))
  46744. }
  46745. ,
  46746. n.Audio.prototype.connect = function() {
  46747. null !== this.filter ? (this.source.connect(this.filter),
  46748. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46749. }
  46750. ,
  46751. n.Audio.prototype.disconnect = function() {
  46752. null !== this.filter ? (this.source.disconnect(this.filter),
  46753. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46754. }
  46755. ,
  46756. n.Audio.prototype.getFilter = function() {
  46757. return this.filter
  46758. }
  46759. ,
  46760. n.Audio.prototype.setFilter = function(e) {
  46761. void 0 === e && (e = null),
  46762. this.isPlaying === !0 ? (this.disconnect(),
  46763. this.filter = e,
  46764. this.connect()) : this.filter = e
  46765. }
  46766. ,
  46767. n.Audio.prototype.setPlaybackRate = function(e) {
  46768. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46769. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46770. }
  46771. ,
  46772. n.Audio.prototype.getPlaybackRate = function() {
  46773. return this.playbackRate
  46774. }
  46775. ,
  46776. n.Audio.prototype.onEnded = function() {
  46777. this.isPlaying = !1
  46778. }
  46779. ,
  46780. n.Audio.prototype.setLoop = function(e) {
  46781. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  46782. }
  46783. ,
  46784. n.Audio.prototype.getLoop = function() {
  46785. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  46786. !1) : this.source.loop
  46787. }
  46788. ,
  46789. n.Audio.prototype.setVolume = function(e) {
  46790. this.gain.gain.value = e
  46791. }
  46792. ,
  46793. n.Audio.prototype.getVolume = function() {
  46794. return this.gain.gain.value
  46795. }
  46796. ,
  46797. n.AudioAnalyser = function(e, t) {
  46798. this.analyser = e.context.createAnalyser(),
  46799. this.analyser.fftSize = void 0 !== t ? t : 2048,
  46800. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  46801. e.getOutput().connect(this.analyser)
  46802. }
  46803. ,
  46804. n.AudioAnalyser.prototype = {
  46805. constructor: n.AudioAnalyser,
  46806. getData: function() {
  46807. return this.analyser.getByteFrequencyData(this.data),
  46808. this.data
  46809. }
  46810. },
  46811. n.AudioBuffer = function(e) {
  46812. this.context = e,
  46813. this.ready = !1,
  46814. this.readyCallbacks = []
  46815. }
  46816. ,
  46817. n.AudioBuffer.prototype.load = function(e) {
  46818. var t = this
  46819. , i = new XMLHttpRequest;
  46820. return i.open("GET", e, !0),
  46821. i.responseType = "arraybuffer",
  46822. i.onload = function(e) {
  46823. t.context.decodeAudioData(this.response, function(e) {
  46824. t.buffer = e,
  46825. t.ready = !0;
  46826. for (var i = 0; i < t.readyCallbacks.length; i++)
  46827. t.readyCallbacks[i](t.buffer);
  46828. t.readyCallbacks = []
  46829. })
  46830. }
  46831. ,
  46832. i.send(),
  46833. this
  46834. }
  46835. ,
  46836. n.AudioBuffer.prototype.onReady = function(e) {
  46837. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  46838. }
  46839. ,
  46840. n.PositionalAudio = function(e) {
  46841. n.Audio.call(this, e),
  46842. this.panner = this.context.createPanner(),
  46843. this.panner.connect(this.gain)
  46844. }
  46845. ,
  46846. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  46847. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  46848. n.PositionalAudio.prototype.getOutput = function() {
  46849. return this.panner
  46850. }
  46851. ,
  46852. n.PositionalAudio.prototype.setRefDistance = function(e) {
  46853. this.panner.refDistance = e
  46854. }
  46855. ,
  46856. n.PositionalAudio.prototype.getRefDistance = function() {
  46857. return this.panner.refDistance
  46858. }
  46859. ,
  46860. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  46861. this.panner.rolloffFactor = e
  46862. }
  46863. ,
  46864. n.PositionalAudio.prototype.getRolloffFactor = function() {
  46865. return this.panner.rolloffFactor
  46866. }
  46867. ,
  46868. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  46869. this.panner.distanceModel = e
  46870. }
  46871. ,
  46872. n.PositionalAudio.prototype.getDistanceModel = function() {
  46873. return this.panner.distanceModel
  46874. }
  46875. ,
  46876. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  46877. this.panner.maxDistance = e
  46878. }
  46879. ,
  46880. n.PositionalAudio.prototype.getMaxDistance = function() {
  46881. return this.panner.maxDistance
  46882. }
  46883. ,
  46884. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  46885. var e = new n.Vector3;
  46886. return function(t) {
  46887. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  46888. e.setFromMatrixPosition(this.matrixWorld),
  46889. this.panner.setPosition(e.x, e.y, e.z)
  46890. }
  46891. }(),
  46892. n.AudioListener = function() {
  46893. n.Object3D.call(this),
  46894. this.type = "AudioListener",
  46895. this.context = new (window.AudioContext || window.webkitAudioContext),
  46896. this.gain = this.context.createGain(),
  46897. this.gain.connect(this.context.destination),
  46898. this.filter = null
  46899. }
  46900. ,
  46901. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  46902. n.AudioListener.prototype.constructor = n.AudioListener,
  46903. n.AudioListener.prototype.getInput = function() {
  46904. return this.gain
  46905. }
  46906. ,
  46907. n.AudioListener.prototype.removeFilter = function() {
  46908. null !== this.filter && (this.gain.disconnect(this.filter),
  46909. this.filter.disconnect(this.context.destination),
  46910. this.gain.connect(this.context.destination),
  46911. this.filter = null)
  46912. }
  46913. ,
  46914. n.AudioListener.prototype.setFilter = function(e) {
  46915. null !== this.filter ? (this.gain.disconnect(this.filter),
  46916. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  46917. this.filter = e,
  46918. this.gain.connect(this.filter),
  46919. this.filter.connect(this.context.destination)
  46920. }
  46921. ,
  46922. n.AudioListener.prototype.getFilter = function() {
  46923. return this.filter
  46924. }
  46925. ,
  46926. n.AudioListener.prototype.setMasterVolume = function(e) {
  46927. this.gain.gain.value = e
  46928. }
  46929. ,
  46930. n.AudioListener.prototype.getMasterVolume = function() {
  46931. return this.gain.gain.value
  46932. }
  46933. ,
  46934. n.AudioListener.prototype.updateMatrixWorld = function() {
  46935. var e = new n.Vector3
  46936. , t = new n.Quaternion
  46937. , i = new n.Vector3
  46938. , r = new n.Vector3;
  46939. return function(o) {
  46940. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  46941. var a = this.context.listener
  46942. , s = this.up;
  46943. this.matrixWorld.decompose(e, t, i),
  46944. r.set(0, 0, -1).applyQuaternion(t),
  46945. a.setPosition(e.x, e.y, e.z),
  46946. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  46947. }
  46948. }(),
  46949. n.Camera = function() {
  46950. n.Object3D.call(this),
  46951. this.type = "Camera",
  46952. this.matrixWorldInverse = new n.Matrix4,
  46953. this.projectionMatrix = new n.Matrix4
  46954. }
  46955. ,
  46956. n.Camera.prototype = Object.create(n.Object3D.prototype),
  46957. n.Camera.prototype.constructor = n.Camera,
  46958. n.Camera.prototype.getWorldDirection = function() {
  46959. var e = new n.Quaternion;
  46960. return function(t) {
  46961. var i = t || new n.Vector3;
  46962. return this.getWorldQuaternion(e),
  46963. i.set(0, 0, -1).applyQuaternion(e)
  46964. }
  46965. }(),
  46966. n.Camera.prototype.lookAt = function() {
  46967. var e = new n.Matrix4;
  46968. return function(t) {
  46969. e.lookAt(this.position, t, this.up),
  46970. this.quaternion.setFromRotationMatrix(e)
  46971. }
  46972. }(),
  46973. n.Camera.prototype.clone = function() {
  46974. return (new this.constructor).copy(this)
  46975. }
  46976. ,
  46977. n.Camera.prototype.copy = function(e) {
  46978. return n.Object3D.prototype.copy.call(this, e),
  46979. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  46980. this.projectionMatrix.copy(e.projectionMatrix),
  46981. this
  46982. }
  46983. ,
  46984. n.CubeCamera = function(e, t, i) {
  46985. n.Object3D.call(this),
  46986. this.type = "CubeCamera";
  46987. var r = 90
  46988. , o = 1
  46989. , a = new n.PerspectiveCamera(r,o,e,t);
  46990. a.up.set(0, -1, 0),
  46991. a.lookAt(new n.Vector3(1,0,0)),
  46992. this.add(a);
  46993. var s = new n.PerspectiveCamera(r,o,e,t);
  46994. s.up.set(0, -1, 0),
  46995. s.lookAt(new n.Vector3(-1,0,0)),
  46996. this.add(s);
  46997. var l = new n.PerspectiveCamera(r,o,e,t);
  46998. l.up.set(0, 0, 1),
  46999. l.lookAt(new n.Vector3(0,1,0)),
  47000. this.add(l);
  47001. var c = new n.PerspectiveCamera(r,o,e,t);
  47002. c.up.set(0, 0, -1),
  47003. c.lookAt(new n.Vector3(0,-1,0)),
  47004. this.add(c);
  47005. var h = new n.PerspectiveCamera(r,o,e,t);
  47006. h.up.set(0, -1, 0),
  47007. h.lookAt(new n.Vector3(0,0,1)),
  47008. this.add(h);
  47009. var u = new n.PerspectiveCamera(r,o,e,t);
  47010. u.up.set(0, -1, 0),
  47011. u.lookAt(new n.Vector3(0,0,-1)),
  47012. this.add(u);
  47013. var d = {
  47014. format: n.RGBFormat,
  47015. magFilter: n.LinearFilter,
  47016. minFilter: n.LinearFilter
  47017. };
  47018. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47019. this.updateCubeMap = function(e, t) {
  47020. null === this.parent && this.updateMatrixWorld();
  47021. var i = this.renderTarget
  47022. , n = i.texture.generateMipmaps;
  47023. i.texture.generateMipmaps = !1,
  47024. i.activeCubeFace = 0,
  47025. e.render(t, a, i),
  47026. i.activeCubeFace = 1,
  47027. e.render(t, s, i),
  47028. i.activeCubeFace = 2,
  47029. e.render(t, l, i),
  47030. i.activeCubeFace = 3,
  47031. e.render(t, c, i),
  47032. i.activeCubeFace = 4,
  47033. e.render(t, h, i),
  47034. i.texture.generateMipmaps = n,
  47035. i.activeCubeFace = 5,
  47036. e.render(t, u, i),
  47037. e.setRenderTarget(null)
  47038. }
  47039. }
  47040. ,
  47041. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47042. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47043. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47044. n.Camera.call(this),
  47045. this.type = "OrthographicCamera",
  47046. this.zoom = 1,
  47047. this.left = e,
  47048. this.right = t,
  47049. this.top = i,
  47050. this.bottom = r,
  47051. this.near = void 0 !== o ? o : .1,
  47052. this.far = void 0 !== a ? a : 2e3,
  47053. this.updateProjectionMatrix()
  47054. }
  47055. ,
  47056. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47057. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47058. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47059. var e = (this.right - this.left) / (2 * this.zoom)
  47060. , t = (this.top - this.bottom) / (2 * this.zoom)
  47061. , i = (this.right + this.left) / 2
  47062. , n = (this.top + this.bottom) / 2;
  47063. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47064. }
  47065. ,
  47066. n.OrthographicCamera.prototype.copy = function(e) {
  47067. return n.Camera.prototype.copy.call(this, e),
  47068. this.left = e.left,
  47069. this.right = e.right,
  47070. this.top = e.top,
  47071. this.bottom = e.bottom,
  47072. this.near = e.near,
  47073. this.far = e.far,
  47074. this.zoom = e.zoom,
  47075. this
  47076. }
  47077. ,
  47078. n.OrthographicCamera.prototype.toJSON = function(e) {
  47079. var t = n.Object3D.prototype.toJSON.call(this, e);
  47080. return t.object.zoom = this.zoom,
  47081. t.object.left = this.left,
  47082. t.object.right = this.right,
  47083. t.object.top = this.top,
  47084. t.object.bottom = this.bottom,
  47085. t.object.near = this.near,
  47086. t.object.far = this.far,
  47087. t
  47088. }
  47089. ,
  47090. n.PerspectiveCamera = function(e, t, i, r) {
  47091. n.Camera.call(this),
  47092. this.type = "PerspectiveCamera",
  47093. this.focalLength = 10,
  47094. this.zoom = 1,
  47095. this.fov = void 0 !== e ? e : 50,
  47096. this.aspect = void 0 !== t ? t : 1,
  47097. this.near = void 0 !== i ? i : .1,
  47098. this.far = void 0 !== r ? r : 2e3,
  47099. this.updateProjectionMatrix()
  47100. }
  47101. ,
  47102. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47103. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47104. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47105. void 0 === t && (t = 24),
  47106. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47107. this.updateProjectionMatrix()
  47108. }
  47109. ,
  47110. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47111. this.fullWidth = e,
  47112. this.fullHeight = t,
  47113. this.x = i,
  47114. this.y = n,
  47115. this.width = r,
  47116. this.height = o,
  47117. this.updateProjectionMatrix()
  47118. }
  47119. ,
  47120. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47121. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47122. if (this.fullWidth) {
  47123. var t = this.fullWidth / this.fullHeight
  47124. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47125. , r = -i
  47126. , o = t * r
  47127. , a = t * i
  47128. , s = Math.abs(a - o)
  47129. , l = Math.abs(i - r);
  47130. 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)
  47131. } else
  47132. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47133. }
  47134. ,
  47135. n.PerspectiveCamera.prototype.copy = function(e) {
  47136. return n.Camera.prototype.copy.call(this, e),
  47137. this.focalLength = e.focalLength,
  47138. this.zoom = e.zoom,
  47139. this.fov = e.fov,
  47140. this.aspect = e.aspect,
  47141. this.near = e.near,
  47142. this.far = e.far,
  47143. this
  47144. }
  47145. ,
  47146. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47147. var t = n.Object3D.prototype.toJSON.call(this, e);
  47148. return t.object.focalLength = this.focalLength,
  47149. t.object.zoom = this.zoom,
  47150. t.object.fov = this.fov,
  47151. t.object.aspect = this.aspect,
  47152. t.object.near = this.near,
  47153. t.object.far = this.far,
  47154. t
  47155. }
  47156. ,
  47157. n.StereoCamera = function() {
  47158. this.type = "StereoCamera",
  47159. this.aspect = 1,
  47160. this.cameraL = new n.PerspectiveCamera,
  47161. this.cameraL.layers.enable(1),
  47162. this.cameraL.matrixAutoUpdate = !1,
  47163. this.cameraR = new n.PerspectiveCamera,
  47164. this.cameraR.layers.enable(2),
  47165. this.cameraR.matrixAutoUpdate = !1
  47166. }
  47167. ,
  47168. n.StereoCamera.prototype = {
  47169. constructor: n.StereoCamera,
  47170. update: function() {
  47171. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47172. return function(l) {
  47173. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47174. if (c) {
  47175. e = l.focalLength,
  47176. t = l.fov,
  47177. i = l.aspect * this.aspect,
  47178. r = l.near,
  47179. o = l.far;
  47180. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47181. s.elements[12] = -p,
  47182. a.elements[12] = p,
  47183. h = -g * i + f,
  47184. u = g * i + f,
  47185. d.elements[0] = 2 * r / (u - h),
  47186. d.elements[8] = (u + h) / (u - h),
  47187. this.cameraL.projectionMatrix.copy(d),
  47188. h = -g * i - f,
  47189. u = g * i - f,
  47190. d.elements[0] = 2 * r / (u - h),
  47191. d.elements[8] = (u + h) / (u - h),
  47192. this.cameraR.projectionMatrix.copy(d)
  47193. }
  47194. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47195. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47196. }
  47197. }()
  47198. },
  47199. n.Light = function(e, t) {
  47200. n.Object3D.call(this),
  47201. this.type = "Light",
  47202. this.color = new n.Color(e),
  47203. this.intensity = void 0 !== t ? t : 1,
  47204. this.receiveShadow = void 0
  47205. }
  47206. ,
  47207. n.Light.prototype = Object.create(n.Object3D.prototype),
  47208. n.Light.prototype.constructor = n.Light,
  47209. n.Light.prototype.copy = function(e) {
  47210. return n.Object3D.prototype.copy.call(this, e),
  47211. this.color.copy(e.color),
  47212. this.intensity = e.intensity,
  47213. this
  47214. }
  47215. ,
  47216. n.Light.prototype.toJSON = function(e) {
  47217. var t = n.Object3D.prototype.toJSON.call(this, e);
  47218. return t.object.color = this.color.getHex(),
  47219. t.object.intensity = this.intensity,
  47220. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47221. void 0 !== this.distance && (t.object.distance = this.distance),
  47222. void 0 !== this.angle && (t.object.angle = this.angle),
  47223. void 0 !== this.decay && (t.object.decay = this.decay),
  47224. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47225. t
  47226. }
  47227. ,
  47228. n.LightShadow = function(e) {
  47229. this.camera = e,
  47230. this.bias = 0,
  47231. this.radius = 1,
  47232. this.mapSize = new n.Vector2(512,512),
  47233. this.map = null,
  47234. this.matrix = new n.Matrix4
  47235. }
  47236. ,
  47237. n.LightShadow.prototype = {
  47238. constructor: n.LightShadow,
  47239. copy: function(e) {
  47240. return this.camera = e.camera.clone(),
  47241. this.bias = e.bias,
  47242. this.radius = e.radius,
  47243. this.mapSize.copy(e.mapSize),
  47244. this
  47245. },
  47246. clone: function() {
  47247. return (new this.constructor).copy(this)
  47248. }
  47249. },
  47250. n.AmbientLight = function(e, t) {
  47251. n.Light.call(this, e, t),
  47252. this.type = "AmbientLight",
  47253. this.castShadow = void 0
  47254. }
  47255. ,
  47256. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47257. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47258. n.DirectionalLight = function(e, t) {
  47259. n.Light.call(this, e, t),
  47260. this.type = "DirectionalLight",
  47261. this.position.set(0, 1, 0),
  47262. this.updateMatrix(),
  47263. this.target = new n.Object3D,
  47264. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47265. }
  47266. ,
  47267. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47268. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47269. n.DirectionalLight.prototype.copy = function(e) {
  47270. return n.Light.prototype.copy.call(this, e),
  47271. this.target = e.target.clone(),
  47272. this.shadow = e.shadow.clone(),
  47273. this
  47274. }
  47275. ,
  47276. n.HemisphereLight = function(e, t, i) {
  47277. n.Light.call(this, e, i),
  47278. this.type = "HemisphereLight",
  47279. this.castShadow = void 0,
  47280. this.position.set(0, 1, 0),
  47281. this.updateMatrix(),
  47282. this.groundColor = new n.Color(t)
  47283. }
  47284. ,
  47285. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47286. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47287. n.HemisphereLight.prototype.copy = function(e) {
  47288. return n.Light.prototype.copy.call(this, e),
  47289. this.groundColor.copy(e.groundColor),
  47290. this
  47291. }
  47292. ,
  47293. n.PointLight = function(e, t, i, r) {
  47294. n.Light.call(this, e, t),
  47295. this.type = "PointLight",
  47296. this.distance = void 0 !== i ? i : 0,
  47297. this.decay = void 0 !== r ? r : 1,
  47298. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47299. }
  47300. ,
  47301. n.PointLight.prototype = Object.create(n.Light.prototype),
  47302. n.PointLight.prototype.constructor = n.PointLight,
  47303. Object.defineProperty(n.PointLight.prototype, "power", {
  47304. get: function() {
  47305. return 4 * this.intensity * Math.PI
  47306. },
  47307. set: function(e) {
  47308. this.intensity = e / (4 * Math.PI)
  47309. }
  47310. }),
  47311. n.PointLight.prototype.copy = function(e) {
  47312. return n.Light.prototype.copy.call(this, e),
  47313. this.distance = e.distance,
  47314. this.decay = e.decay,
  47315. this.shadow = e.shadow.clone(),
  47316. this
  47317. }
  47318. ,
  47319. n.SpotLight = function(e, t, i, r, o, a) {
  47320. n.Light.call(this, e, t),
  47321. this.type = "SpotLight",
  47322. this.position.set(0, 1, 0),
  47323. this.updateMatrix(),
  47324. this.target = new n.Object3D,
  47325. this.distance = void 0 !== i ? i : 0,
  47326. this.angle = void 0 !== r ? r : Math.PI / 3,
  47327. this.penumbra = void 0 !== o ? o : 0,
  47328. this.decay = void 0 !== a ? a : 1,
  47329. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47330. }
  47331. ,
  47332. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47333. n.SpotLight.prototype.constructor = n.SpotLight,
  47334. Object.defineProperty(n.SpotLight.prototype, "power", {
  47335. get: function() {
  47336. return this.intensity * Math.PI
  47337. },
  47338. set: function(e) {
  47339. this.intensity = e / Math.PI
  47340. }
  47341. }),
  47342. n.SpotLight.prototype.copy = function(e) {
  47343. return n.Light.prototype.copy.call(this, e),
  47344. this.distance = e.distance,
  47345. this.angle = e.angle,
  47346. this.penumbra = e.penumbra,
  47347. this.decay = e.decay,
  47348. this.target = e.target.clone(),
  47349. this.shadow = e.shadow.clone(),
  47350. this
  47351. }
  47352. ,
  47353. n.Cache = {
  47354. enabled: !1,
  47355. files: {},
  47356. add: function(e, t) {
  47357. this.enabled !== !1 && (this.files[e] = t)
  47358. },
  47359. get: function(e) {
  47360. if (this.enabled !== !1)
  47361. return this.files[e]
  47362. },
  47363. remove: function(e) {
  47364. delete this.files[e]
  47365. },
  47366. clear: function() {
  47367. this.files = {}
  47368. }
  47369. },
  47370. n.Loader = function() {
  47371. this.onLoadStart = function() {}
  47372. ,
  47373. this.onLoadProgress = function() {}
  47374. ,
  47375. this.onLoadComplete = function() {}
  47376. }
  47377. ,
  47378. n.Loader.prototype = {
  47379. constructor: n.Loader,
  47380. crossOrigin: void 0,
  47381. extractUrlBase: function(e) {
  47382. var t = e.split("/");
  47383. return 1 === t.length ? "./" : (t.pop(),
  47384. t.join("/") + "/")
  47385. },
  47386. initMaterials: function(e, t, i) {
  47387. for (var n = [], r = 0; r < e.length; ++r)
  47388. n[r] = this.createMaterial(e[r], t, i);
  47389. return n
  47390. },
  47391. createMaterial: function() {
  47392. var e, t, i;
  47393. return function(r, o, a) {
  47394. function s(e, i, r, s, c) {
  47395. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47396. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47397. h = t.load(u)),
  47398. void 0 !== i && (h.repeat.fromArray(i),
  47399. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47400. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47401. void 0 !== r && h.offset.fromArray(r),
  47402. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47403. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47404. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47405. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47406. void 0 !== c && (h.anisotropy = c);
  47407. var p = n.Math.generateUUID();
  47408. return l[p] = h,
  47409. p
  47410. }
  47411. void 0 === e && (e = new n.Color),
  47412. void 0 === t && (t = new n.TextureLoader),
  47413. void 0 === i && (i = new n.MaterialLoader);
  47414. var l = {}
  47415. , c = {
  47416. uuid: n.Math.generateUUID(),
  47417. type: "MeshLambertMaterial"
  47418. };
  47419. for (var h in r) {
  47420. var u = r[h];
  47421. switch (h) {
  47422. case "DbgColor":
  47423. case "DbgIndex":
  47424. case "opticalDensity":
  47425. case "illumination":
  47426. break;
  47427. case "DbgName":
  47428. c.name = u;
  47429. break;
  47430. case "blending":
  47431. c.blending = n[u];
  47432. break;
  47433. case "colorAmbient":
  47434. case "mapAmbient":
  47435. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47436. break;
  47437. case "colorDiffuse":
  47438. c.color = e.fromArray(u).getHex();
  47439. break;
  47440. case "colorSpecular":
  47441. c.specular = e.fromArray(u).getHex();
  47442. break;
  47443. case "colorEmissive":
  47444. c.emissive = e.fromArray(u).getHex();
  47445. break;
  47446. case "specularCoef":
  47447. c.shininess = u;
  47448. break;
  47449. case "shading":
  47450. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47451. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47452. break;
  47453. case "mapDiffuse":
  47454. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47455. break;
  47456. case "mapDiffuseRepeat":
  47457. case "mapDiffuseOffset":
  47458. case "mapDiffuseWrap":
  47459. case "mapDiffuseAnisotropy":
  47460. break;
  47461. case "mapLight":
  47462. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47463. break;
  47464. case "mapLightRepeat":
  47465. case "mapLightOffset":
  47466. case "mapLightWrap":
  47467. case "mapLightAnisotropy":
  47468. break;
  47469. case "mapAO":
  47470. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47471. break;
  47472. case "mapAORepeat":
  47473. case "mapAOOffset":
  47474. case "mapAOWrap":
  47475. case "mapAOAnisotropy":
  47476. break;
  47477. case "mapBump":
  47478. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47479. break;
  47480. case "mapBumpScale":
  47481. c.bumpScale = u;
  47482. break;
  47483. case "mapBumpRepeat":
  47484. case "mapBumpOffset":
  47485. case "mapBumpWrap":
  47486. case "mapBumpAnisotropy":
  47487. break;
  47488. case "mapNormal":
  47489. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47490. break;
  47491. case "mapNormalFactor":
  47492. c.normalScale = [u, u];
  47493. break;
  47494. case "mapNormalRepeat":
  47495. case "mapNormalOffset":
  47496. case "mapNormalWrap":
  47497. case "mapNormalAnisotropy":
  47498. break;
  47499. case "mapSpecular":
  47500. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47501. break;
  47502. case "mapSpecularRepeat":
  47503. case "mapSpecularOffset":
  47504. case "mapSpecularWrap":
  47505. case "mapSpecularAnisotropy":
  47506. break;
  47507. case "mapAlpha":
  47508. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47509. break;
  47510. case "mapAlphaRepeat":
  47511. case "mapAlphaOffset":
  47512. case "mapAlphaWrap":
  47513. case "mapAlphaAnisotropy":
  47514. break;
  47515. case "flipSided":
  47516. c.side = n.BackSide;
  47517. break;
  47518. case "doubleSided":
  47519. c.side = n.DoubleSide;
  47520. break;
  47521. case "transparency":
  47522. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47523. c.opacity = u;
  47524. break;
  47525. case "depthTest":
  47526. case "depthWrite":
  47527. case "colorWrite":
  47528. case "opacity":
  47529. case "reflectivity":
  47530. case "transparent":
  47531. case "visible":
  47532. case "wireframe":
  47533. c[h] = u;
  47534. break;
  47535. case "vertexColors":
  47536. u === !0 && (c.vertexColors = n.VertexColors),
  47537. "face" === u && (c.vertexColors = n.FaceColors);
  47538. break;
  47539. default:
  47540. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47541. }
  47542. }
  47543. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47544. "MeshPhongMaterial" !== c.type && delete c.specular,
  47545. c.opacity < 1 && (c.transparent = !0),
  47546. i.setTextures(l),
  47547. i.parse(c)
  47548. }
  47549. }()
  47550. },
  47551. n.Loader.Handlers = {
  47552. handlers: [],
  47553. add: function(e, t) {
  47554. this.handlers.push(e, t)
  47555. },
  47556. get: function(e) {
  47557. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47558. var r = t[i]
  47559. , o = t[i + 1];
  47560. if (r.test(e))
  47561. return o
  47562. }
  47563. return null
  47564. }
  47565. },
  47566. n.XHRLoader = function(e) {
  47567. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47568. }
  47569. ,
  47570. n.XHRLoader.prototype = {
  47571. constructor: n.XHRLoader,
  47572. load: function(e, t, i, r) {
  47573. void 0 !== this.path && (e = this.path + e);
  47574. var o = this
  47575. , a = n.Cache.get(e);
  47576. if (void 0 !== a)
  47577. return t && setTimeout(function() {
  47578. t(a)
  47579. }, 0),
  47580. a;
  47581. var s = new XMLHttpRequest;
  47582. return s.overrideMimeType("text/plain"),
  47583. s.open("GET", e, !0),
  47584. s.addEventListener("load", function(i) {
  47585. var a = i.target.response;
  47586. n.Cache.add(e, a),
  47587. 200 === this.status ? (t && t(a),
  47588. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47589. t && t(a),
  47590. o.manager.itemEnd(e)) : (r && r(i),
  47591. o.manager.itemError(e))
  47592. }, !1),
  47593. void 0 !== i && s.addEventListener("progress", function(e) {
  47594. i(e)
  47595. }, !1),
  47596. s.addEventListener("error", function(t) {
  47597. r && r(t),
  47598. o.manager.itemError(e)
  47599. }, !1),
  47600. void 0 !== this.responseType && (s.responseType = this.responseType),
  47601. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47602. s.send(null),
  47603. o.manager.itemStart(e),
  47604. s
  47605. },
  47606. setPath: function(e) {
  47607. this.path = e
  47608. },
  47609. setResponseType: function(e) {
  47610. this.responseType = e
  47611. },
  47612. setWithCredentials: function(e) {
  47613. this.withCredentials = e
  47614. }
  47615. },
  47616. n.FontLoader = function(e) {
  47617. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47618. }
  47619. ,
  47620. n.FontLoader.prototype = {
  47621. constructor: n.FontLoader,
  47622. load: function(e, t, i, r) {
  47623. var o = new n.XHRLoader(this.manager);
  47624. o.load(e, function(e) {
  47625. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47626. }, i, r)
  47627. }
  47628. },
  47629. n.ImageLoader = function(e) {
  47630. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47631. }
  47632. ,
  47633. n.ImageLoader.prototype = {
  47634. constructor: n.ImageLoader,
  47635. load: function(e, t, i, r) {
  47636. void 0 !== this.path && (e = this.path + e);
  47637. var o = this
  47638. , a = n.Cache.get(e);
  47639. if (void 0 !== a)
  47640. return o.manager.itemStart(e),
  47641. t ? setTimeout(function() {
  47642. t(a),
  47643. o.manager.itemEnd(e)
  47644. }, 0) : o.manager.itemEnd(e),
  47645. a;
  47646. var s = document.createElement("img");
  47647. return s.addEventListener("load", function(i) {
  47648. n.Cache.add(e, this),
  47649. t && t(this),
  47650. o.manager.itemEnd(e)
  47651. }, !1),
  47652. void 0 !== i && s.addEventListener("progress", function(e) {
  47653. i(e)
  47654. }, !1),
  47655. s.addEventListener("error", function(t) {
  47656. r && r(t),
  47657. o.manager.itemError(e)
  47658. }, !1),
  47659. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47660. o.manager.itemStart(e),
  47661. s.src = e,
  47662. s
  47663. },
  47664. setCrossOrigin: function(e) {
  47665. this.crossOrigin = e
  47666. },
  47667. setPath: function(e) {
  47668. this.path = e
  47669. }
  47670. },
  47671. n.JSONLoader = function(e) {
  47672. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47673. e = void 0),
  47674. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47675. this.withCredentials = !1
  47676. }
  47677. ,
  47678. n.JSONLoader.prototype = {
  47679. constructor: n.JSONLoader,
  47680. get statusDomElement() {
  47681. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47682. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47683. this._statusDomElement
  47684. },
  47685. load: function(e, t, i, r) {
  47686. var o = this
  47687. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47688. , s = new n.XHRLoader(this.manager);
  47689. s.setWithCredentials(this.withCredentials),
  47690. s.load(e, function(i) {
  47691. var n = JSON.parse(i)
  47692. , r = n.metadata;
  47693. if (void 0 !== r) {
  47694. var s = r.type;
  47695. if (void 0 !== s) {
  47696. if ("object" === s.toLowerCase())
  47697. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47698. if ("scene" === s.toLowerCase())
  47699. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47700. }
  47701. }
  47702. var l = o.parse(n, a);
  47703. t(l.geometry, l.materials)
  47704. }, i, r)
  47705. },
  47706. setTexturePath: function(e) {
  47707. this.texturePath = e
  47708. },
  47709. parse: function(e, t) {
  47710. function i(t) {
  47711. function i(e, t) {
  47712. return e & 1 << t
  47713. }
  47714. 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;
  47715. if (void 0 !== e.uvs) {
  47716. for (r = 0; r < e.uvs.length; r++)
  47717. e.uvs[r].length && B++;
  47718. for (r = 0; r < B; r++)
  47719. s.faceVertexUvs[r] = []
  47720. }
  47721. for (l = 0,
  47722. c = L.length; l < c; )
  47723. E = new n.Vector3,
  47724. E.x = L[l++] * t,
  47725. E.y = L[l++] * t,
  47726. E.z = L[l++] * t,
  47727. s.vertices.push(E);
  47728. for (l = 0,
  47729. c = O.length; l < c; )
  47730. if (f = O[l++],
  47731. g = i(f, 0),
  47732. m = i(f, 1),
  47733. v = i(f, 3),
  47734. A = i(f, 4),
  47735. y = i(f, 5),
  47736. C = i(f, 6),
  47737. I = i(f, 7),
  47738. g) {
  47739. if (w = new n.Face3,
  47740. w.a = O[l],
  47741. w.b = O[l + 1],
  47742. w.c = O[l + 3],
  47743. _ = new n.Face3,
  47744. _.a = O[l + 1],
  47745. _.b = O[l + 2],
  47746. _.c = O[l + 3],
  47747. l += 4,
  47748. m && (p = O[l++],
  47749. w.materialIndex = p,
  47750. _.materialIndex = p),
  47751. a = s.faces.length,
  47752. v)
  47753. for (r = 0; r < B; r++)
  47754. for (S = e.uvs[r],
  47755. s.faceVertexUvs[r][a] = [],
  47756. s.faceVertexUvs[r][a + 1] = [],
  47757. o = 0; o < 4; o++)
  47758. d = O[l++],
  47759. R = S[2 * d],
  47760. P = S[2 * d + 1],
  47761. M = new n.Vector2(R,P),
  47762. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47763. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47764. if (A && (u = 3 * O[l++],
  47765. w.normal.set(D[u++], D[u++], D[u]),
  47766. _.normal.copy(w.normal)),
  47767. y)
  47768. for (r = 0; r < 4; r++)
  47769. u = 3 * O[l++],
  47770. x = new n.Vector3(D[u++],D[u++],D[u]),
  47771. 2 !== r && w.vertexNormals.push(x),
  47772. 0 !== r && _.vertexNormals.push(x);
  47773. if (C && (h = O[l++],
  47774. T = N[h],
  47775. w.color.setHex(T),
  47776. _.color.setHex(T)),
  47777. I)
  47778. for (r = 0; r < 4; r++)
  47779. h = O[l++],
  47780. T = N[h],
  47781. 2 !== r && w.vertexColors.push(new n.Color(T)),
  47782. 0 !== r && _.vertexColors.push(new n.Color(T));
  47783. s.faces.push(w),
  47784. s.faces.push(_)
  47785. } else {
  47786. if (b = new n.Face3,
  47787. b.a = O[l++],
  47788. b.b = O[l++],
  47789. b.c = O[l++],
  47790. m && (p = O[l++],
  47791. b.materialIndex = p),
  47792. a = s.faces.length,
  47793. v)
  47794. for (r = 0; r < B; r++)
  47795. for (S = e.uvs[r],
  47796. s.faceVertexUvs[r][a] = [],
  47797. o = 0; o < 3; o++)
  47798. d = O[l++],
  47799. R = S[2 * d],
  47800. P = S[2 * d + 1],
  47801. M = new n.Vector2(R,P),
  47802. s.faceVertexUvs[r][a].push(M);
  47803. if (A && (u = 3 * O[l++],
  47804. b.normal.set(D[u++], D[u++], D[u])),
  47805. y)
  47806. for (r = 0; r < 3; r++)
  47807. u = 3 * O[l++],
  47808. x = new n.Vector3(D[u++],D[u++],D[u]),
  47809. b.vertexNormals.push(x);
  47810. if (C && (h = O[l++],
  47811. b.color.setHex(N[h])),
  47812. I)
  47813. for (r = 0; r < 3; r++)
  47814. h = O[l++],
  47815. b.vertexColors.push(new n.Color(N[h]));
  47816. s.faces.push(b)
  47817. }
  47818. }
  47819. function r() {
  47820. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  47821. if (e.skinWeights)
  47822. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  47823. var o = e.skinWeights[i]
  47824. , a = t > 1 ? e.skinWeights[i + 1] : 0
  47825. , l = t > 2 ? e.skinWeights[i + 2] : 0
  47826. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  47827. s.skinWeights.push(new n.Vector4(o,a,l,c))
  47828. }
  47829. if (e.skinIndices)
  47830. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  47831. var h = e.skinIndices[i]
  47832. , u = t > 1 ? e.skinIndices[i + 1] : 0
  47833. , d = t > 2 ? e.skinIndices[i + 2] : 0
  47834. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  47835. s.skinIndices.push(new n.Vector4(h,u,d,p))
  47836. }
  47837. s.bones = e.bones,
  47838. 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.")
  47839. }
  47840. function o(t) {
  47841. if (void 0 !== e.morphTargets)
  47842. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  47843. s.morphTargets[i] = {},
  47844. s.morphTargets[i].name = e.morphTargets[i].name,
  47845. s.morphTargets[i].vertices = [];
  47846. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  47847. var h = new n.Vector3;
  47848. h.x = a[l] * t,
  47849. h.y = a[l + 1] * t,
  47850. h.z = a[l + 2] * t,
  47851. o.push(h)
  47852. }
  47853. }
  47854. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  47855. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  47856. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  47857. u[i].color.fromArray(d, 3 * i)
  47858. }
  47859. }
  47860. function a() {
  47861. var t = []
  47862. , i = [];
  47863. void 0 !== e.animation && i.push(e.animation),
  47864. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  47865. for (var r = 0; r < i.length; r++) {
  47866. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  47867. o && t.push(o)
  47868. }
  47869. if (s.morphTargets) {
  47870. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  47871. t = t.concat(a)
  47872. }
  47873. t.length > 0 && (s.animations = t)
  47874. }
  47875. var s = new n.Geometry
  47876. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  47877. if (i(l),
  47878. r(),
  47879. o(l),
  47880. a(),
  47881. s.computeFaceNormals(),
  47882. s.computeBoundingSphere(),
  47883. void 0 === e.materials || 0 === e.materials.length)
  47884. return {
  47885. geometry: s
  47886. };
  47887. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  47888. return {
  47889. geometry: s,
  47890. materials: c
  47891. }
  47892. }
  47893. },
  47894. n.LoadingManager = function(e, t, i) {
  47895. var n = this
  47896. , r = !1
  47897. , o = 0
  47898. , a = 0;
  47899. this.onStart = void 0,
  47900. this.onLoad = e,
  47901. this.onProgress = t,
  47902. this.onError = i,
  47903. this.itemStart = function(e) {
  47904. a++,
  47905. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  47906. r = !0
  47907. }
  47908. ,
  47909. this.itemEnd = function(e) {
  47910. o++,
  47911. void 0 !== n.onProgress && n.onProgress(e, o, a),
  47912. o === a && (r = !1,
  47913. void 0 !== n.onLoad && n.onLoad())
  47914. }
  47915. ,
  47916. this.itemError = function(e) {
  47917. void 0 !== n.onError && n.onError(e)
  47918. }
  47919. }
  47920. ,
  47921. n.DefaultLoadingManager = new n.LoadingManager,
  47922. n.BufferGeometryLoader = function(e) {
  47923. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47924. }
  47925. ,
  47926. n.BufferGeometryLoader.prototype = {
  47927. constructor: n.BufferGeometryLoader,
  47928. load: function(e, t, i, r) {
  47929. var o = this
  47930. , a = new n.XHRLoader(o.manager);
  47931. a.load(e, function(e) {
  47932. t(o.parse(JSON.parse(e)))
  47933. }, i, r)
  47934. },
  47935. parse: function(e) {
  47936. var t = new n.BufferGeometry
  47937. , i = e.data.index
  47938. , r = {
  47939. Int8Array: Int8Array,
  47940. Uint8Array: Uint8Array,
  47941. Uint8ClampedArray: Uint8ClampedArray,
  47942. Int16Array: Int16Array,
  47943. Uint16Array: Uint16Array,
  47944. Int32Array: Int32Array,
  47945. Uint32Array: Uint32Array,
  47946. Float32Array: Float32Array,
  47947. Float64Array: Float64Array
  47948. };
  47949. if (void 0 !== i) {
  47950. var o = new r[i.type](i.array);
  47951. t.setIndex(new n.BufferAttribute(o,1))
  47952. }
  47953. var a = e.data.attributes;
  47954. for (var s in a) {
  47955. var l = a[s]
  47956. , o = new r[l.type](l.array);
  47957. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  47958. }
  47959. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  47960. if (void 0 !== c)
  47961. for (var h = 0, u = c.length; h !== u; ++h) {
  47962. var d = c[h];
  47963. t.addGroup(d.start, d.count, d.materialIndex)
  47964. }
  47965. var p = e.data.boundingSphere;
  47966. if (void 0 !== p) {
  47967. var f = new n.Vector3;
  47968. void 0 !== p.center && f.fromArray(p.center),
  47969. t.boundingSphere = new n.Sphere(f,p.radius)
  47970. }
  47971. return t
  47972. }
  47973. },
  47974. n.MaterialLoader = function(e) {
  47975. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47976. this.textures = {}
  47977. }
  47978. ,
  47979. n.MaterialLoader.prototype = {
  47980. constructor: n.MaterialLoader,
  47981. load: function(e, t, i, r) {
  47982. var o = this
  47983. , a = new n.XHRLoader(o.manager);
  47984. a.load(e, function(e) {
  47985. t(o.parse(JSON.parse(e)))
  47986. }, i, r)
  47987. },
  47988. setTextures: function(e) {
  47989. this.textures = e
  47990. },
  47991. getTexture: function(e) {
  47992. var t = this.textures;
  47993. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  47994. t[e]
  47995. },
  47996. parse: function(e) {
  47997. var t = new n[e.type];
  47998. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  47999. void 0 !== e.name && (t.name = e.name),
  48000. void 0 !== e.color && t.color.setHex(e.color),
  48001. void 0 !== e.roughness && (t.roughness = e.roughness),
  48002. void 0 !== e.metalness && (t.metalness = e.metalness),
  48003. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48004. void 0 !== e.specular && t.specular.setHex(e.specular),
  48005. void 0 !== e.shininess && (t.shininess = e.shininess),
  48006. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48007. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48008. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48009. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48010. void 0 !== e.shading && (t.shading = e.shading),
  48011. void 0 !== e.blending && (t.blending = e.blending),
  48012. void 0 !== e.side && (t.side = e.side),
  48013. void 0 !== e.opacity && (t.opacity = e.opacity),
  48014. void 0 !== e.transparent && (t.transparent = e.transparent),
  48015. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48016. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48017. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48018. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48019. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48020. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48021. void 0 !== e.size && (t.size = e.size),
  48022. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48023. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48024. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48025. t.transparent = !0),
  48026. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48027. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48028. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48029. void 0 !== e.normalScale) {
  48030. var i = e.normalScale;
  48031. Array.isArray(i) === !1 && (i = [i, i]),
  48032. t.normalScale = (new n.Vector2).fromArray(i)
  48033. }
  48034. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48035. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48036. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48037. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48038. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48039. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48040. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48041. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48042. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48043. t.combine = n.MultiplyOperation),
  48044. e.reflectivity && (t.reflectivity = e.reflectivity),
  48045. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48046. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48047. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48048. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48049. void 0 !== e.materials)
  48050. for (var r = 0, o = e.materials.length; r < o; r++)
  48051. t.materials.push(this.parse(e.materials[r]));
  48052. return t
  48053. }
  48054. },
  48055. n.ObjectLoader = function(e) {
  48056. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48057. this.texturePath = ""
  48058. }
  48059. ,
  48060. n.ObjectLoader.prototype = {
  48061. constructor: n.ObjectLoader,
  48062. load: function(e, t, i, r) {
  48063. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48064. var o = this
  48065. , a = new n.XHRLoader(o.manager);
  48066. a.load(e, function(e) {
  48067. o.parse(JSON.parse(e), t)
  48068. }, i, r)
  48069. },
  48070. setTexturePath: function(e) {
  48071. this.texturePath = e
  48072. },
  48073. setCrossOrigin: function(e) {
  48074. this.crossOrigin = e
  48075. },
  48076. parse: function(e, t) {
  48077. var i = this.parseGeometries(e.geometries)
  48078. , n = this.parseImages(e.images, function() {
  48079. void 0 !== t && t(a)
  48080. })
  48081. , r = this.parseTextures(e.textures, n)
  48082. , o = this.parseMaterials(e.materials, r)
  48083. , a = this.parseObject(e.object, i, o);
  48084. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48085. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48086. a
  48087. },
  48088. parseGeometries: function(e) {
  48089. var t = {};
  48090. if (void 0 !== e)
  48091. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48092. var s, l = e[o];
  48093. switch (l.type) {
  48094. case "PlaneGeometry":
  48095. case "PlaneBufferGeometry":
  48096. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48097. break;
  48098. case "BoxGeometry":
  48099. case "BoxBufferGeometry":
  48100. case "CubeGeometry":
  48101. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48102. break;
  48103. case "CircleGeometry":
  48104. case "CircleBufferGeometry":
  48105. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48106. break;
  48107. case "CylinderGeometry":
  48108. case "CylinderBufferGeometry":
  48109. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48110. break;
  48111. case "SphereGeometry":
  48112. case "SphereBufferGeometry":
  48113. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48114. break;
  48115. case "DodecahedronGeometry":
  48116. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48117. break;
  48118. case "IcosahedronGeometry":
  48119. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48120. break;
  48121. case "OctahedronGeometry":
  48122. s = new n.OctahedronGeometry(l.radius,l.detail);
  48123. break;
  48124. case "TetrahedronGeometry":
  48125. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48126. break;
  48127. case "RingGeometry":
  48128. case "RingBufferGeometry":
  48129. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48130. break;
  48131. case "TorusGeometry":
  48132. case "TorusBufferGeometry":
  48133. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48134. break;
  48135. case "TorusKnotGeometry":
  48136. case "TorusKnotBufferGeometry":
  48137. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48138. break;
  48139. case "LatheGeometry":
  48140. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48141. break;
  48142. case "BufferGeometry":
  48143. s = r.parse(l);
  48144. break;
  48145. case "Geometry":
  48146. s = i.parse(l.data, this.texturePath).geometry;
  48147. break;
  48148. default:
  48149. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48150. continue
  48151. }
  48152. s.uuid = l.uuid,
  48153. void 0 !== l.name && (s.name = l.name),
  48154. t[l.uuid] = s
  48155. }
  48156. return t
  48157. },
  48158. parseMaterials: function(e, t) {
  48159. var i = {};
  48160. if (void 0 !== e) {
  48161. var r = new n.MaterialLoader;
  48162. r.setTextures(t);
  48163. for (var o = 0, a = e.length; o < a; o++) {
  48164. var s = r.parse(e[o]);
  48165. i[s.uuid] = s
  48166. }
  48167. }
  48168. return i
  48169. },
  48170. parseAnimations: function(e) {
  48171. for (var t = [], i = 0; i < e.length; i++) {
  48172. var r = n.AnimationClip.parse(e[i]);
  48173. t.push(r)
  48174. }
  48175. return t
  48176. },
  48177. parseImages: function(e, t) {
  48178. function i(e) {
  48179. return r.manager.itemStart(e),
  48180. s.load(e, function() {
  48181. r.manager.itemEnd(e)
  48182. })
  48183. }
  48184. var r = this
  48185. , o = {};
  48186. if (void 0 !== e && e.length > 0) {
  48187. var a = new n.LoadingManager(t)
  48188. , s = new n.ImageLoader(a);
  48189. s.setCrossOrigin(this.crossOrigin);
  48190. for (var l = 0, c = e.length; l < c; l++) {
  48191. var h = e[l]
  48192. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48193. o[h.uuid] = i(u)
  48194. }
  48195. }
  48196. return o
  48197. },
  48198. parseTextures: function(e, t) {
  48199. function i(e) {
  48200. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48201. n[e])
  48202. }
  48203. var r = {};
  48204. if (void 0 !== e)
  48205. for (var o = 0, a = e.length; o < a; o++) {
  48206. var s = e[o];
  48207. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48208. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48209. var l = new n.Texture(t[s.image]);
  48210. l.needsUpdate = !0,
  48211. l.uuid = s.uuid,
  48212. void 0 !== s.name && (l.name = s.name),
  48213. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48214. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48215. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48216. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48217. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48218. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48219. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48220. l.wrapT = i(s.wrap[1])),
  48221. r[s.uuid] = l
  48222. }
  48223. return r
  48224. },
  48225. parseObject: function() {
  48226. var e = new n.Matrix4;
  48227. return function(t, i, r) {
  48228. function o(e) {
  48229. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48230. i[e]
  48231. }
  48232. function a(e) {
  48233. if (void 0 !== e)
  48234. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48235. r[e]
  48236. }
  48237. var s;
  48238. switch (t.type) {
  48239. case "Scene":
  48240. s = new n.Scene;
  48241. break;
  48242. case "PerspectiveCamera":
  48243. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48244. break;
  48245. case "OrthographicCamera":
  48246. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48247. break;
  48248. case "AmbientLight":
  48249. s = new n.AmbientLight(t.color,t.intensity);
  48250. break;
  48251. case "DirectionalLight":
  48252. s = new n.DirectionalLight(t.color,t.intensity);
  48253. break;
  48254. case "PointLight":
  48255. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48256. break;
  48257. case "SpotLight":
  48258. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48259. break;
  48260. case "HemisphereLight":
  48261. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48262. break;
  48263. case "Mesh":
  48264. var l = o(t.geometry)
  48265. , c = a(t.material);
  48266. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48267. break;
  48268. case "LOD":
  48269. s = new n.LOD;
  48270. break;
  48271. case "Line":
  48272. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48273. break;
  48274. case "PointCloud":
  48275. case "Points":
  48276. s = new n.Points(o(t.geometry),a(t.material));
  48277. break;
  48278. case "Sprite":
  48279. s = new n.Sprite(a(t.material));
  48280. break;
  48281. case "Group":
  48282. s = new n.Group;
  48283. break;
  48284. default:
  48285. s = new n.Object3D
  48286. }
  48287. if (s.uuid = t.uuid,
  48288. void 0 !== t.name && (s.name = t.name),
  48289. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48290. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48291. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48292. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48293. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48294. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48295. void 0 !== t.visible && (s.visible = t.visible),
  48296. void 0 !== t.userData && (s.userData = t.userData),
  48297. void 0 !== t.children)
  48298. for (var h in t.children)
  48299. s.add(this.parseObject(t.children[h], i, r));
  48300. if ("LOD" === t.type)
  48301. for (var u = t.levels, d = 0; d < u.length; d++) {
  48302. var p = u[d]
  48303. , h = s.getObjectByProperty("uuid", p.object);
  48304. void 0 !== h && s.addLevel(h, p.distance)
  48305. }
  48306. return s
  48307. }
  48308. }()
  48309. },
  48310. n.TextureLoader = function(e) {
  48311. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48312. }
  48313. ,
  48314. n.TextureLoader.prototype = {
  48315. constructor: n.TextureLoader,
  48316. load: function(e, t, i, r) {
  48317. var o = new n.Texture
  48318. , a = new n.ImageLoader(this.manager);
  48319. return a.setCrossOrigin(this.crossOrigin),
  48320. a.setPath(this.path),
  48321. a.load(e, function(e) {
  48322. o.image = e,
  48323. o.needsUpdate = !0,
  48324. void 0 !== t && t(o)
  48325. }, i, r),
  48326. o
  48327. },
  48328. setCrossOrigin: function(e) {
  48329. this.crossOrigin = e
  48330. },
  48331. setPath: function(e) {
  48332. this.path = e
  48333. }
  48334. },
  48335. n.CubeTextureLoader = function(e) {
  48336. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48337. }
  48338. ,
  48339. n.CubeTextureLoader.prototype = {
  48340. constructor: n.CubeTextureLoader,
  48341. load: function(e, t, i, r) {
  48342. function o(i) {
  48343. s.load(e[i], function(e) {
  48344. a.images[i] = e,
  48345. l++,
  48346. 6 === l && (a.needsUpdate = !0,
  48347. t && t(a))
  48348. }, void 0, r)
  48349. }
  48350. var a = new n.CubeTexture
  48351. , s = new n.ImageLoader(this.manager);
  48352. s.setCrossOrigin(this.crossOrigin),
  48353. s.setPath(this.path);
  48354. for (var l = 0, c = 0; c < e.length; ++c)
  48355. o(c);
  48356. return a
  48357. },
  48358. setCrossOrigin: function(e) {
  48359. this.crossOrigin = e
  48360. },
  48361. setPath: function(e) {
  48362. this.path = e
  48363. }
  48364. },
  48365. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48366. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48367. this._parser = null
  48368. }
  48369. ,
  48370. n.BinaryTextureLoader.prototype = {
  48371. constructor: n.BinaryTextureLoader,
  48372. load: function(e, t, i, r) {
  48373. var o = this
  48374. , a = new n.DataTexture
  48375. , s = new n.XHRLoader(this.manager);
  48376. return s.setResponseType("arraybuffer"),
  48377. s.load(e, function(e) {
  48378. var i = o._parser(e);
  48379. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48380. a.image.height = i.height,
  48381. a.image.data = i.data),
  48382. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48383. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48384. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48385. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48386. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48387. void 0 !== i.format && (a.format = i.format),
  48388. void 0 !== i.type && (a.type = i.type),
  48389. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48390. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48391. a.needsUpdate = !0,
  48392. t && t(a, i))
  48393. }, i, r),
  48394. a
  48395. }
  48396. },
  48397. n.CompressedTextureLoader = function(e) {
  48398. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48399. this._parser = null
  48400. }
  48401. ;
  48402. n.CompressedTextureLoader.prototype = {
  48403. constructor: n.CompressedTextureLoader,
  48404. load: function(e, t, i, r) {
  48405. function o(o) {
  48406. c.load(e[o], function(e) {
  48407. var i = a._parser(e, !0);
  48408. s[o] = {
  48409. width: i.width,
  48410. height: i.height,
  48411. format: i.format,
  48412. mipmaps: i.mipmaps
  48413. },
  48414. h += 1,
  48415. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48416. l.format = i.format,
  48417. l.needsUpdate = !0,
  48418. t && t(l))
  48419. }, i, r)
  48420. }
  48421. var a = this
  48422. , s = []
  48423. , l = new n.CompressedTexture;
  48424. l.image = s;
  48425. var c = new n.XHRLoader(this.manager);
  48426. if (c.setPath(this.path),
  48427. c.setResponseType("arraybuffer"),
  48428. Array.isArray(e))
  48429. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48430. o(u);
  48431. else
  48432. c.load(e, function(e) {
  48433. var i = a._parser(e, !0);
  48434. if (i.isCubemap)
  48435. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48436. s[o] = {
  48437. mipmaps: []
  48438. };
  48439. for (var c = 0; c < i.mipmapCount; c++)
  48440. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48441. s[o].format = i.format,
  48442. s[o].width = i.width,
  48443. s[o].height = i.height
  48444. }
  48445. else
  48446. l.image.width = i.width,
  48447. l.image.height = i.height,
  48448. l.mipmaps = i.mipmaps;
  48449. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48450. l.format = i.format,
  48451. l.needsUpdate = !0,
  48452. t && t(l)
  48453. }, i, r);
  48454. return l
  48455. },
  48456. setPath: function(e) {
  48457. this.path = e
  48458. }
  48459. };
  48460. n.Material = function() {
  48461. Object.defineProperty(this, "id", {
  48462. value: n.MaterialIdCount++
  48463. }),
  48464. this.uuid = n.Math.generateUUID(),
  48465. this.name = "",
  48466. this.type = "Material",
  48467. this.side = n.FrontSide,
  48468. this.opacity = 1,
  48469. this.transparent = !1,
  48470. this.blending = n.NormalBlending,
  48471. this.blendSrc = n.SrcAlphaFactor,
  48472. this.blendDst = n.OneMinusSrcAlphaFactor,
  48473. this.blendEquation = n.AddEquation,
  48474. this.blendSrcAlpha = null,
  48475. this.blendDstAlpha = null,
  48476. this.blendEquationAlpha = null,
  48477. this.depthFunc = n.LessEqualDepth,
  48478. this.depthTest = !0,
  48479. this.depthWrite = !0,
  48480. this.colorWrite = !0,
  48481. this.precision = null,
  48482. this.polygonOffset = !1,
  48483. this.polygonOffsetFactor = 0,
  48484. this.polygonOffsetUnits = 0,
  48485. this.alphaTest = 0,
  48486. this.premultipliedAlpha = !1,
  48487. this.overdraw = 0,
  48488. this.visible = !0,
  48489. this._needsUpdate = !0
  48490. }
  48491. ,
  48492. n.Material.prototype = {
  48493. constructor: n.Material,
  48494. get needsUpdate() {
  48495. return this._needsUpdate
  48496. },
  48497. set needsUpdate(e) {
  48498. e === !0 && this.update(),
  48499. this._needsUpdate = e
  48500. },
  48501. setValues: function(e) {
  48502. if (void 0 !== e)
  48503. for (var t in e) {
  48504. var i = e[t];
  48505. if (void 0 !== i) {
  48506. var r = this[t];
  48507. 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.")
  48508. } else
  48509. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48510. }
  48511. },
  48512. toJSON: function(e) {
  48513. function t(e) {
  48514. var t = [];
  48515. for (var i in e) {
  48516. var n = e[i];
  48517. delete n.metadata,
  48518. t.push(n)
  48519. }
  48520. return t
  48521. }
  48522. var i = void 0 === e;
  48523. i && (e = {
  48524. textures: {},
  48525. images: {}
  48526. });
  48527. var r = {
  48528. metadata: {
  48529. version: 4.4,
  48530. type: "Material",
  48531. generator: "Material.toJSON"
  48532. }
  48533. };
  48534. if (r.uuid = this.uuid,
  48535. r.type = this.type,
  48536. "" !== this.name && (r.name = this.name),
  48537. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48538. .5 !== this.roughness && (r.roughness = this.roughness),
  48539. .5 !== this.metalness && (r.metalness = this.metalness),
  48540. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48541. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48542. void 0 !== this.shininess && (r.shininess = this.shininess),
  48543. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48544. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48545. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48546. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48547. r.bumpScale = this.bumpScale),
  48548. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48549. r.normalScale = this.normalScale.toArray()),
  48550. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48551. r.displacementScale = this.displacementScale,
  48552. r.displacementBias = this.displacementBias),
  48553. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48554. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48555. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48556. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48557. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48558. r.reflectivity = this.reflectivity),
  48559. void 0 !== this.size && (r.size = this.size),
  48560. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48561. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48562. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48563. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48564. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48565. this.opacity < 1 && (r.opacity = this.opacity),
  48566. this.transparent === !0 && (r.transparent = this.transparent),
  48567. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48568. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48569. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48570. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48571. i) {
  48572. var o = t(e.textures)
  48573. , a = t(e.images);
  48574. o.length > 0 && (r.textures = o),
  48575. a.length > 0 && (r.images = a)
  48576. }
  48577. return r
  48578. },
  48579. clone: function() {
  48580. return (new this.constructor).copy(this)
  48581. },
  48582. copy: function(e) {
  48583. return this.name = e.name,
  48584. this.side = e.side,
  48585. this.opacity = e.opacity,
  48586. this.transparent = e.transparent,
  48587. this.blending = e.blending,
  48588. this.blendSrc = e.blendSrc,
  48589. this.blendDst = e.blendDst,
  48590. this.blendEquation = e.blendEquation,
  48591. this.blendSrcAlpha = e.blendSrcAlpha,
  48592. this.blendDstAlpha = e.blendDstAlpha,
  48593. this.blendEquationAlpha = e.blendEquationAlpha,
  48594. this.depthFunc = e.depthFunc,
  48595. this.depthTest = e.depthTest,
  48596. this.depthWrite = e.depthWrite,
  48597. this.colorWrite = e.colorWrite,
  48598. this.precision = e.precision,
  48599. this.polygonOffset = e.polygonOffset,
  48600. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48601. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48602. this.alphaTest = e.alphaTest,
  48603. this.premultipliedAlpha = e.premultipliedAlpha,
  48604. this.overdraw = e.overdraw,
  48605. this.visible = e.visible,
  48606. this
  48607. },
  48608. update: function() {
  48609. this.dispatchEvent({
  48610. type: "update"
  48611. })
  48612. },
  48613. dispose: function() {
  48614. this.dispatchEvent({
  48615. type: "dispose"
  48616. })
  48617. }
  48618. },
  48619. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48620. n.MaterialIdCount = 0,
  48621. n.LineBasicMaterial = function(e) {
  48622. n.Material.call(this),
  48623. this.type = "LineBasicMaterial",
  48624. this.color = new n.Color(16777215),
  48625. this.linewidth = 1,
  48626. this.linecap = "round",
  48627. this.linejoin = "round",
  48628. this.blending = n.NormalBlending,
  48629. this.vertexColors = n.NoColors,
  48630. this.fog = !0,
  48631. this.setValues(e)
  48632. }
  48633. ,
  48634. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48635. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48636. n.LineBasicMaterial.prototype.copy = function(e) {
  48637. return n.Material.prototype.copy.call(this, e),
  48638. this.color.copy(e.color),
  48639. this.linewidth = e.linewidth,
  48640. this.linecap = e.linecap,
  48641. this.linejoin = e.linejoin,
  48642. this.vertexColors = e.vertexColors,
  48643. this.fog = e.fog,
  48644. this
  48645. }
  48646. ,
  48647. n.LineDashedMaterial = function(e) {
  48648. n.Material.call(this),
  48649. this.type = "LineDashedMaterial",
  48650. this.color = new n.Color(16777215),
  48651. this.linewidth = 1,
  48652. this.scale = 1,
  48653. this.dashSize = 3,
  48654. this.gapSize = 1,
  48655. this.blending = n.NormalBlending,
  48656. this.vertexColors = n.NoColors,
  48657. this.fog = !0,
  48658. this.setValues(e)
  48659. }
  48660. ,
  48661. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48662. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48663. n.LineDashedMaterial.prototype.copy = function(e) {
  48664. return n.Material.prototype.copy.call(this, e),
  48665. this.color.copy(e.color),
  48666. this.linewidth = e.linewidth,
  48667. this.scale = e.scale,
  48668. this.dashSize = e.dashSize,
  48669. this.gapSize = e.gapSize,
  48670. this.vertexColors = e.vertexColors,
  48671. this.fog = e.fog,
  48672. this
  48673. }
  48674. ,
  48675. n.MeshBasicMaterial = function(e) {
  48676. n.Material.call(this),
  48677. this.type = "MeshBasicMaterial",
  48678. this.color = new n.Color(16777215),
  48679. this.map = null,
  48680. this.aoMap = null,
  48681. this.aoMapIntensity = 1,
  48682. this.specularMap = null,
  48683. this.alphaMap = null,
  48684. this.envMap = null,
  48685. this.combine = n.MultiplyOperation,
  48686. this.reflectivity = 1,
  48687. this.refractionRatio = .98,
  48688. this.fog = !0,
  48689. this.shading = n.SmoothShading,
  48690. this.blending = n.NormalBlending,
  48691. this.wireframe = !1,
  48692. this.wireframeLinewidth = 1,
  48693. this.wireframeLinecap = "round",
  48694. this.wireframeLinejoin = "round",
  48695. this.vertexColors = n.NoColors,
  48696. this.skinning = !1,
  48697. this.morphTargets = !1,
  48698. this.setValues(e)
  48699. }
  48700. ,
  48701. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48702. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48703. n.MeshBasicMaterial.prototype.copy = function(e) {
  48704. return n.Material.prototype.copy.call(this, e),
  48705. this.color.copy(e.color),
  48706. this.map = e.map,
  48707. this.aoMap = e.aoMap,
  48708. this.aoMapIntensity = e.aoMapIntensity,
  48709. this.specularMap = e.specularMap,
  48710. this.alphaMap = e.alphaMap,
  48711. this.envMap = e.envMap,
  48712. this.combine = e.combine,
  48713. this.reflectivity = e.reflectivity,
  48714. this.refractionRatio = e.refractionRatio,
  48715. this.fog = e.fog,
  48716. this.shading = e.shading,
  48717. this.wireframe = e.wireframe,
  48718. this.wireframeLinewidth = e.wireframeLinewidth,
  48719. this.wireframeLinecap = e.wireframeLinecap,
  48720. this.wireframeLinejoin = e.wireframeLinejoin,
  48721. this.vertexColors = e.vertexColors,
  48722. this.skinning = e.skinning,
  48723. this.morphTargets = e.morphTargets,
  48724. this
  48725. }
  48726. ,
  48727. n.MeshLambertMaterial = function(e) {
  48728. n.Material.call(this),
  48729. this.type = "MeshLambertMaterial",
  48730. this.color = new n.Color(16777215),
  48731. this.map = null,
  48732. this.lightMap = null,
  48733. this.lightMapIntensity = 1,
  48734. this.aoMap = null,
  48735. this.aoMapIntensity = 1,
  48736. this.emissive = new n.Color(0),
  48737. this.emissiveIntensity = 1,
  48738. this.emissiveMap = null,
  48739. this.specularMap = null,
  48740. this.alphaMap = null,
  48741. this.envMap = null,
  48742. this.combine = n.MultiplyOperation,
  48743. this.reflectivity = 1,
  48744. this.refractionRatio = .98,
  48745. this.fog = !0,
  48746. this.blending = n.NormalBlending,
  48747. this.wireframe = !1,
  48748. this.wireframeLinewidth = 1,
  48749. this.wireframeLinecap = "round",
  48750. this.wireframeLinejoin = "round",
  48751. this.vertexColors = n.NoColors,
  48752. this.skinning = !1,
  48753. this.morphTargets = !1,
  48754. this.morphNormals = !1,
  48755. this.setValues(e)
  48756. }
  48757. ,
  48758. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48759. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48760. n.MeshLambertMaterial.prototype.copy = function(e) {
  48761. return n.Material.prototype.copy.call(this, e),
  48762. this.color.copy(e.color),
  48763. this.map = e.map,
  48764. this.lightMap = e.lightMap,
  48765. this.lightMapIntensity = e.lightMapIntensity,
  48766. this.aoMap = e.aoMap,
  48767. this.aoMapIntensity = e.aoMapIntensity,
  48768. this.emissive.copy(e.emissive),
  48769. this.emissiveMap = e.emissiveMap,
  48770. this.emissiveIntensity = e.emissiveIntensity,
  48771. this.specularMap = e.specularMap,
  48772. this.alphaMap = e.alphaMap,
  48773. this.envMap = e.envMap,
  48774. this.combine = e.combine,
  48775. this.reflectivity = e.reflectivity,
  48776. this.refractionRatio = e.refractionRatio,
  48777. this.fog = e.fog,
  48778. this.wireframe = e.wireframe,
  48779. this.wireframeLinewidth = e.wireframeLinewidth,
  48780. this.wireframeLinecap = e.wireframeLinecap,
  48781. this.wireframeLinejoin = e.wireframeLinejoin,
  48782. this.vertexColors = e.vertexColors,
  48783. this.skinning = e.skinning,
  48784. this.morphTargets = e.morphTargets,
  48785. this.morphNormals = e.morphNormals,
  48786. this
  48787. }
  48788. ,
  48789. n.MeshPhongMaterial = function(e) {
  48790. n.Material.call(this),
  48791. this.type = "MeshPhongMaterial",
  48792. this.color = new n.Color(16777215),
  48793. this.specular = new n.Color(1118481),
  48794. this.shininess = 30,
  48795. this.map = null,
  48796. this.lightMap = null,
  48797. this.lightMapIntensity = 1,
  48798. this.aoMap = null,
  48799. this.aoMapIntensity = 1,
  48800. this.emissive = new n.Color(0),
  48801. this.emissiveIntensity = 1,
  48802. this.emissiveMap = null,
  48803. this.bumpMap = null,
  48804. this.bumpScale = 1,
  48805. this.normalMap = null,
  48806. this.normalScale = new n.Vector2(1,1),
  48807. this.displacementMap = null,
  48808. this.displacementScale = 1,
  48809. this.displacementBias = 0,
  48810. this.specularMap = null,
  48811. this.alphaMap = null,
  48812. this.envMap = null,
  48813. this.combine = n.MultiplyOperation,
  48814. this.reflectivity = 1,
  48815. this.refractionRatio = .98,
  48816. this.fog = !0,
  48817. this.shading = n.SmoothShading,
  48818. this.blending = n.NormalBlending,
  48819. this.wireframe = !1,
  48820. this.wireframeLinewidth = 1,
  48821. this.wireframeLinecap = "round",
  48822. this.wireframeLinejoin = "round",
  48823. this.vertexColors = n.NoColors,
  48824. this.skinning = !1,
  48825. this.morphTargets = !1,
  48826. this.morphNormals = !1,
  48827. this.setValues(e)
  48828. }
  48829. ,
  48830. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  48831. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  48832. n.MeshPhongMaterial.prototype.copy = function(e) {
  48833. return n.Material.prototype.copy.call(this, e),
  48834. this.color.copy(e.color),
  48835. this.specular.copy(e.specular),
  48836. this.shininess = e.shininess,
  48837. this.map = e.map,
  48838. this.lightMap = e.lightMap,
  48839. this.lightMapIntensity = e.lightMapIntensity,
  48840. this.aoMap = e.aoMap,
  48841. this.aoMapIntensity = e.aoMapIntensity,
  48842. this.emissive.copy(e.emissive),
  48843. this.emissiveMap = e.emissiveMap,
  48844. this.emissiveIntensity = e.emissiveIntensity,
  48845. this.bumpMap = e.bumpMap,
  48846. this.bumpScale = e.bumpScale,
  48847. this.normalMap = e.normalMap,
  48848. this.normalScale.copy(e.normalScale),
  48849. this.displacementMap = e.displacementMap,
  48850. this.displacementScale = e.displacementScale,
  48851. this.displacementBias = e.displacementBias,
  48852. this.specularMap = e.specularMap,
  48853. this.alphaMap = e.alphaMap,
  48854. this.envMap = e.envMap,
  48855. this.combine = e.combine,
  48856. this.reflectivity = e.reflectivity,
  48857. this.refractionRatio = e.refractionRatio,
  48858. this.fog = e.fog,
  48859. this.shading = e.shading,
  48860. this.wireframe = e.wireframe,
  48861. this.wireframeLinewidth = e.wireframeLinewidth,
  48862. this.wireframeLinecap = e.wireframeLinecap,
  48863. this.wireframeLinejoin = e.wireframeLinejoin,
  48864. this.vertexColors = e.vertexColors,
  48865. this.skinning = e.skinning,
  48866. this.morphTargets = e.morphTargets,
  48867. this.morphNormals = e.morphNormals,
  48868. this
  48869. }
  48870. ,
  48871. n.MeshStandardMaterial = function(e) {
  48872. n.Material.call(this),
  48873. this.type = "MeshStandardMaterial",
  48874. this.color = new n.Color(16777215),
  48875. this.roughness = .5,
  48876. this.metalness = .5,
  48877. this.map = null,
  48878. this.lightMap = null,
  48879. this.lightMapIntensity = 1,
  48880. this.aoMap = null,
  48881. this.aoMapIntensity = 1,
  48882. this.emissive = new n.Color(0),
  48883. this.emissiveIntensity = 1,
  48884. this.emissiveMap = null,
  48885. this.bumpMap = null,
  48886. this.bumpScale = 1,
  48887. this.normalMap = null,
  48888. this.normalScale = new n.Vector2(1,1),
  48889. this.displacementMap = null,
  48890. this.displacementScale = 1,
  48891. this.displacementBias = 0,
  48892. this.roughnessMap = null,
  48893. this.metalnessMap = null,
  48894. this.alphaMap = null,
  48895. this.envMap = null,
  48896. this.envMapIntensity = 1,
  48897. this.refractionRatio = .98,
  48898. this.fog = !0,
  48899. this.shading = n.SmoothShading,
  48900. this.blending = n.NormalBlending,
  48901. this.wireframe = !1,
  48902. this.wireframeLinewidth = 1,
  48903. this.wireframeLinecap = "round",
  48904. this.wireframeLinejoin = "round",
  48905. this.vertexColors = n.NoColors,
  48906. this.skinning = !1,
  48907. this.morphTargets = !1,
  48908. this.morphNormals = !1,
  48909. this.setValues(e)
  48910. }
  48911. ,
  48912. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  48913. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  48914. n.MeshStandardMaterial.prototype.copy = function(e) {
  48915. return n.Material.prototype.copy.call(this, e),
  48916. this.color.copy(e.color),
  48917. this.roughness = e.roughness,
  48918. this.metalness = e.metalness,
  48919. this.map = e.map,
  48920. this.lightMap = e.lightMap,
  48921. this.lightMapIntensity = e.lightMapIntensity,
  48922. this.aoMap = e.aoMap,
  48923. this.aoMapIntensity = e.aoMapIntensity,
  48924. this.emissive.copy(e.emissive),
  48925. this.emissiveMap = e.emissiveMap,
  48926. this.emissiveIntensity = e.emissiveIntensity,
  48927. this.bumpMap = e.bumpMap,
  48928. this.bumpScale = e.bumpScale,
  48929. this.normalMap = e.normalMap,
  48930. this.normalScale.copy(e.normalScale),
  48931. this.displacementMap = e.displacementMap,
  48932. this.displacementScale = e.displacementScale,
  48933. this.displacementBias = e.displacementBias,
  48934. this.roughnessMap = e.roughnessMap,
  48935. this.metalnessMap = e.metalnessMap,
  48936. this.alphaMap = e.alphaMap,
  48937. this.envMap = e.envMap,
  48938. this.envMapIntensity = e.envMapIntensity,
  48939. this.refractionRatio = e.refractionRatio,
  48940. this.fog = e.fog,
  48941. this.shading = e.shading,
  48942. this.wireframe = e.wireframe,
  48943. this.wireframeLinewidth = e.wireframeLinewidth,
  48944. this.wireframeLinecap = e.wireframeLinecap,
  48945. this.wireframeLinejoin = e.wireframeLinejoin,
  48946. this.vertexColors = e.vertexColors,
  48947. this.skinning = e.skinning,
  48948. this.morphTargets = e.morphTargets,
  48949. this.morphNormals = e.morphNormals,
  48950. this
  48951. }
  48952. ,
  48953. n.MeshDepthMaterial = function(e) {
  48954. n.Material.call(this),
  48955. this.type = "MeshDepthMaterial",
  48956. this.morphTargets = !1,
  48957. this.wireframe = !1,
  48958. this.wireframeLinewidth = 1,
  48959. this.setValues(e)
  48960. }
  48961. ,
  48962. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  48963. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  48964. n.MeshDepthMaterial.prototype.copy = function(e) {
  48965. return n.Material.prototype.copy.call(this, e),
  48966. this.wireframe = e.wireframe,
  48967. this.wireframeLinewidth = e.wireframeLinewidth,
  48968. this
  48969. }
  48970. ,
  48971. n.MeshNormalMaterial = function(e) {
  48972. n.Material.call(this, e),
  48973. this.type = "MeshNormalMaterial",
  48974. this.wireframe = !1,
  48975. this.wireframeLinewidth = 1,
  48976. this.morphTargets = !1,
  48977. this.setValues(e)
  48978. }
  48979. ,
  48980. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  48981. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  48982. n.MeshNormalMaterial.prototype.copy = function(e) {
  48983. return n.Material.prototype.copy.call(this, e),
  48984. this.wireframe = e.wireframe,
  48985. this.wireframeLinewidth = e.wireframeLinewidth,
  48986. this
  48987. }
  48988. ,
  48989. n.MultiMaterial = function(e) {
  48990. this.uuid = n.Math.generateUUID(),
  48991. this.type = "MultiMaterial",
  48992. this.materials = e instanceof Array ? e : [],
  48993. this.visible = !0
  48994. }
  48995. ,
  48996. n.MultiMaterial.prototype = {
  48997. constructor: n.MultiMaterial,
  48998. toJSON: function(e) {
  48999. for (var t = {
  49000. metadata: {
  49001. version: 4.2,
  49002. type: "material",
  49003. generator: "MaterialExporter"
  49004. },
  49005. uuid: this.uuid,
  49006. type: this.type,
  49007. materials: []
  49008. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49009. var o = i[n].toJSON(e);
  49010. delete o.metadata,
  49011. t.materials.push(o)
  49012. }
  49013. return t.visible = this.visible,
  49014. t
  49015. },
  49016. clone: function() {
  49017. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49018. e.materials.push(this.materials[t].clone());
  49019. return e.visible = this.visible,
  49020. e
  49021. }
  49022. },
  49023. n.PointsMaterial = function(e) {
  49024. n.Material.call(this),
  49025. this.type = "PointsMaterial",
  49026. this.color = new n.Color(16777215),
  49027. this.map = null,
  49028. this.size = 1,
  49029. this.sizeAttenuation = !0,
  49030. this.blending = n.NormalBlending,
  49031. this.vertexColors = n.NoColors,
  49032. this.fog = !0,
  49033. this.setValues(e)
  49034. }
  49035. ,
  49036. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49037. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49038. n.PointsMaterial.prototype.copy = function(e) {
  49039. return n.Material.prototype.copy.call(this, e),
  49040. this.color.copy(e.color),
  49041. this.map = e.map,
  49042. this.size = e.size,
  49043. this.sizeAttenuation = e.sizeAttenuation,
  49044. this.vertexColors = e.vertexColors,
  49045. this.fog = e.fog,
  49046. this
  49047. }
  49048. ,
  49049. n.ShaderMaterial = function(e) {
  49050. n.Material.call(this),
  49051. this.type = "ShaderMaterial",
  49052. this.defines = {},
  49053. this.uniforms = {},
  49054. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49055. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49056. this.shading = n.SmoothShading,
  49057. this.linewidth = 1,
  49058. this.wireframe = !1,
  49059. this.wireframeLinewidth = 1,
  49060. this.fog = !1,
  49061. this.lights = !1,
  49062. this.vertexColors = n.NoColors,
  49063. this.skinning = !1,
  49064. this.morphTargets = !1,
  49065. this.morphNormals = !1,
  49066. this.extensions = {
  49067. derivatives: !1,
  49068. fragDepth: !1,
  49069. drawBuffers: !1,
  49070. shaderTextureLOD: !1
  49071. },
  49072. this.defaultAttributeValues = {
  49073. color: [1, 1, 1],
  49074. uv: [0, 0],
  49075. uv2: [0, 0]
  49076. },
  49077. this.index0AttributeName = void 0,
  49078. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49079. this.setValues(e))
  49080. }
  49081. ,
  49082. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49083. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49084. n.ShaderMaterial.prototype.copy = function(e) {
  49085. return n.Material.prototype.copy.call(this, e),
  49086. this.fragmentShader = e.fragmentShader,
  49087. this.vertexShader = e.vertexShader,
  49088. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49089. this.defines = e.defines,
  49090. this.shading = e.shading,
  49091. this.wireframe = e.wireframe,
  49092. this.wireframeLinewidth = e.wireframeLinewidth,
  49093. this.fog = e.fog,
  49094. this.lights = e.lights,
  49095. this.vertexColors = e.vertexColors,
  49096. this.skinning = e.skinning,
  49097. this.morphTargets = e.morphTargets,
  49098. this.morphNormals = e.morphNormals,
  49099. this.extensions = e.extensions,
  49100. this
  49101. }
  49102. ,
  49103. n.ShaderMaterial.prototype.toJSON = function(e) {
  49104. var t = n.Material.prototype.toJSON.call(this, e);
  49105. return t.uniforms = this.uniforms,
  49106. t.vertexShader = this.vertexShader,
  49107. t.fragmentShader = this.fragmentShader,
  49108. t
  49109. }
  49110. ,
  49111. n.RawShaderMaterial = function(e) {
  49112. n.ShaderMaterial.call(this, e),
  49113. this.type = "RawShaderMaterial"
  49114. }
  49115. ,
  49116. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49117. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49118. n.SpriteMaterial = function(e) {
  49119. n.Material.call(this),
  49120. this.type = "SpriteMaterial",
  49121. this.color = new n.Color(16777215),
  49122. this.map = null,
  49123. this.rotation = 0,
  49124. this.fog = !1,
  49125. this.setValues(e)
  49126. }
  49127. ,
  49128. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49129. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49130. n.SpriteMaterial.prototype.copy = function(e) {
  49131. return n.Material.prototype.copy.call(this, e),
  49132. this.color.copy(e.color),
  49133. this.map = e.map,
  49134. this.rotation = e.rotation,
  49135. this.fog = e.fog,
  49136. this
  49137. }
  49138. ,
  49139. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49140. Object.defineProperty(this, "id", {
  49141. value: n.TextureIdCount++
  49142. }),
  49143. this.uuid = n.Math.generateUUID(),
  49144. this.name = "",
  49145. this.sourceFile = "",
  49146. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49147. this.mipmaps = [],
  49148. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49149. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49150. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49151. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49152. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49153. this.anisotropy = void 0 !== c ? c : 1,
  49154. this.format = void 0 !== s ? s : n.RGBAFormat,
  49155. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49156. this.offset = new n.Vector2(0,0),
  49157. this.repeat = new n.Vector2(1,1),
  49158. this.generateMipmaps = !0,
  49159. this.premultiplyAlpha = !1,
  49160. this.flipY = !0,
  49161. this.unpackAlignment = 4,
  49162. this.encoding = n.LinearEncoding,
  49163. this.version = 0,
  49164. this.onUpdate = null
  49165. }
  49166. ,
  49167. n.Texture.DEFAULT_IMAGE = void 0,
  49168. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49169. n.Texture.prototype = {
  49170. constructor: n.Texture,
  49171. set needsUpdate(e) {
  49172. e === !0 && this.version++
  49173. },
  49174. clone: function() {
  49175. return (new this.constructor).copy(this)
  49176. },
  49177. copy: function(e) {
  49178. return this.image = e.image,
  49179. this.mipmaps = e.mipmaps.slice(0),
  49180. this.mapping = e.mapping,
  49181. this.wrapS = e.wrapS,
  49182. this.wrapT = e.wrapT,
  49183. this.magFilter = e.magFilter,
  49184. this.minFilter = e.minFilter,
  49185. this.anisotropy = e.anisotropy,
  49186. this.format = e.format,
  49187. this.type = e.type,
  49188. this.offset.copy(e.offset),
  49189. this.repeat.copy(e.repeat),
  49190. this.generateMipmaps = e.generateMipmaps,
  49191. this.premultiplyAlpha = e.premultiplyAlpha,
  49192. this.flipY = e.flipY,
  49193. this.unpackAlignment = e.unpackAlignment,
  49194. this.encoding = e.encoding,
  49195. this
  49196. },
  49197. toJSON: function(e) {
  49198. function t(e) {
  49199. var t;
  49200. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49201. t.width = e.width,
  49202. t.height = e.height,
  49203. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49204. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49205. }
  49206. if (void 0 !== e.textures[this.uuid])
  49207. return e.textures[this.uuid];
  49208. var i = {
  49209. metadata: {
  49210. version: 4.4,
  49211. type: "Texture",
  49212. generator: "Texture.toJSON"
  49213. },
  49214. uuid: this.uuid,
  49215. name: this.name,
  49216. mapping: this.mapping,
  49217. repeat: [this.repeat.x, this.repeat.y],
  49218. offset: [this.offset.x, this.offset.y],
  49219. wrap: [this.wrapS, this.wrapT],
  49220. minFilter: this.minFilter,
  49221. magFilter: this.magFilter,
  49222. anisotropy: this.anisotropy
  49223. };
  49224. if (void 0 !== this.image) {
  49225. var r = this.image;
  49226. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49227. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49228. uuid: r.uuid,
  49229. url: t(r)
  49230. }),
  49231. i.image = r.uuid
  49232. }
  49233. return e.textures[this.uuid] = i,
  49234. i
  49235. },
  49236. dispose: function() {
  49237. this.dispatchEvent({
  49238. type: "dispose"
  49239. })
  49240. },
  49241. transformUv: function(e) {
  49242. if (this.mapping === n.UVMapping) {
  49243. if (e.multiply(this.repeat),
  49244. e.add(this.offset),
  49245. e.x < 0 || e.x > 1)
  49246. switch (this.wrapS) {
  49247. case n.RepeatWrapping:
  49248. e.x = e.x - Math.floor(e.x);
  49249. break;
  49250. case n.ClampToEdgeWrapping:
  49251. e.x = e.x < 0 ? 0 : 1;
  49252. break;
  49253. case n.MirroredRepeatWrapping:
  49254. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49255. }
  49256. if (e.y < 0 || e.y > 1)
  49257. switch (this.wrapT) {
  49258. case n.RepeatWrapping:
  49259. e.y = e.y - Math.floor(e.y);
  49260. break;
  49261. case n.ClampToEdgeWrapping:
  49262. e.y = e.y < 0 ? 0 : 1;
  49263. break;
  49264. case n.MirroredRepeatWrapping:
  49265. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49266. }
  49267. this.flipY && (e.y = 1 - e.y)
  49268. }
  49269. }
  49270. },
  49271. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49272. n.TextureIdCount = 0,
  49273. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49274. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49275. this.needsUpdate = !0
  49276. }
  49277. ,
  49278. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49279. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49280. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49281. e = void 0 !== e ? e : [],
  49282. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49283. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49284. this.flipY = !1
  49285. }
  49286. ,
  49287. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49288. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49289. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49290. get: function() {
  49291. return this.image
  49292. },
  49293. set: function(e) {
  49294. this.image = e
  49295. }
  49296. }),
  49297. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49298. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49299. this.image = {
  49300. width: t,
  49301. height: i
  49302. },
  49303. this.mipmaps = e,
  49304. this.flipY = !1,
  49305. this.generateMipmaps = !1
  49306. }
  49307. ,
  49308. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49309. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49310. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49311. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49312. this.image = {
  49313. data: e,
  49314. width: t,
  49315. height: i
  49316. },
  49317. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49318. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49319. this.flipY = !1,
  49320. this.generateMipmaps = !1
  49321. }
  49322. ,
  49323. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49324. n.DataTexture.prototype.constructor = n.DataTexture,
  49325. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49326. function h() {
  49327. requestAnimationFrame(h)
  49328. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49329. u.needsUpdate = !0
  49330. }
  49331. }
  49332. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49333. this.generateMipmaps = !1;
  49334. var u = this;
  49335. h()
  49336. }
  49337. ,
  49338. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49339. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49340. n.Group = function() {
  49341. n.Object3D.call(this),
  49342. this.type = "Group"
  49343. }
  49344. ,
  49345. n.Group.prototype = Object.create(n.Object3D.prototype),
  49346. n.Group.prototype.constructor = n.Group,
  49347. n.Points = function(e, t) {
  49348. n.Object3D.call(this),
  49349. this.type = "Points",
  49350. this.geometry = void 0 !== e ? e : new n.Geometry,
  49351. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49352. color: 16777215 * Math.random()
  49353. })
  49354. }
  49355. ,
  49356. n.Points.prototype = Object.create(n.Object3D.prototype),
  49357. n.Points.prototype.constructor = n.Points,
  49358. n.Points.prototype.raycast = function() {
  49359. var e = new n.Matrix4
  49360. , t = new n.Ray
  49361. , i = new n.Sphere;
  49362. return function(r, o) {
  49363. function a(e, i) {
  49364. var n = t.distanceSqToPoint(e);
  49365. if (n < d) {
  49366. var a = t.closestPointToPoint(e);
  49367. a.applyMatrix4(c);
  49368. var l = r.ray.origin.distanceTo(a);
  49369. if (l < r.near || l > r.far)
  49370. return;
  49371. o.push({
  49372. distance: l,
  49373. distanceToRay: Math.sqrt(n),
  49374. point: a.clone(),
  49375. index: i,
  49376. face: null,
  49377. object: s
  49378. })
  49379. }
  49380. }
  49381. var s = this
  49382. , l = this.geometry
  49383. , c = this.matrixWorld
  49384. , h = r.params.Points.threshold;
  49385. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49386. i.copy(l.boundingSphere),
  49387. i.applyMatrix4(c),
  49388. r.ray.intersectsSphere(i) !== !1) {
  49389. e.getInverse(c),
  49390. t.copy(r.ray).applyMatrix4(e);
  49391. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49392. , d = u * u
  49393. , p = new n.Vector3;
  49394. if (l instanceof n.BufferGeometry) {
  49395. var f = l.index
  49396. , g = l.attributes
  49397. , m = g.position.array;
  49398. if (null !== f)
  49399. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49400. var C = v[A];
  49401. p.fromArray(m, 3 * C),
  49402. a(p, C)
  49403. }
  49404. else
  49405. for (var A = 0, I = m.length / 3; A < I; A++)
  49406. p.fromArray(m, 3 * A),
  49407. a(p, A)
  49408. } else
  49409. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49410. a(E[A], A)
  49411. }
  49412. }
  49413. }(),
  49414. n.Points.prototype.clone = function() {
  49415. return new this.constructor(this.geometry,this.material).copy(this)
  49416. }
  49417. ,
  49418. n.Line = function(e, t, i) {
  49419. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49420. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49421. this.type = "Line",
  49422. this.geometry = void 0 !== e ? e : new n.Geometry,
  49423. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49424. color: 16777215 * Math.random()
  49425. })))
  49426. }
  49427. ,
  49428. n.Line.prototype = Object.create(n.Object3D.prototype),
  49429. n.Line.prototype.constructor = n.Line,
  49430. n.Line.prototype.raycast = function() {
  49431. var e = new n.Matrix4
  49432. , t = new n.Ray
  49433. , i = new n.Sphere;
  49434. return function(r, o) {
  49435. var a = r.linePrecision
  49436. , s = a * a
  49437. , l = this.geometry
  49438. , c = this.matrixWorld;
  49439. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49440. i.copy(l.boundingSphere),
  49441. i.applyMatrix4(c),
  49442. r.ray.intersectsSphere(i) !== !1) {
  49443. e.getInverse(c),
  49444. t.copy(r.ray).applyMatrix4(e);
  49445. var h = new n.Vector3
  49446. , u = new n.Vector3
  49447. , d = new n.Vector3
  49448. , p = new n.Vector3
  49449. , f = this instanceof n.LineSegments ? 2 : 1;
  49450. if (l instanceof n.BufferGeometry) {
  49451. var g = l.index
  49452. , m = l.attributes
  49453. , v = m.position.array;
  49454. if (null !== g)
  49455. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49456. var I = A[y]
  49457. , E = A[y + 1];
  49458. h.fromArray(v, 3 * I),
  49459. u.fromArray(v, 3 * E);
  49460. var b = t.distanceSqToSegment(h, u, p, d);
  49461. if (!(b > s)) {
  49462. p.applyMatrix4(this.matrixWorld);
  49463. var w = r.ray.origin.distanceTo(p);
  49464. w < r.near || w > r.far || o.push({
  49465. distance: w,
  49466. point: d.clone().applyMatrix4(this.matrixWorld),
  49467. index: y,
  49468. face: null,
  49469. faceIndex: null,
  49470. object: this
  49471. })
  49472. }
  49473. }
  49474. else
  49475. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49476. h.fromArray(v, 3 * y),
  49477. u.fromArray(v, 3 * y + 3);
  49478. var b = t.distanceSqToSegment(h, u, p, d);
  49479. if (!(b > s)) {
  49480. p.applyMatrix4(this.matrixWorld);
  49481. var w = r.ray.origin.distanceTo(p);
  49482. w < r.near || w > r.far || o.push({
  49483. distance: w,
  49484. point: d.clone().applyMatrix4(this.matrixWorld),
  49485. index: y,
  49486. face: null,
  49487. faceIndex: null,
  49488. object: this
  49489. })
  49490. }
  49491. }
  49492. } else if (l instanceof n.Geometry)
  49493. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49494. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49495. if (!(b > s)) {
  49496. p.applyMatrix4(this.matrixWorld);
  49497. var w = r.ray.origin.distanceTo(p);
  49498. w < r.near || w > r.far || o.push({
  49499. distance: w,
  49500. point: d.clone().applyMatrix4(this.matrixWorld),
  49501. index: y,
  49502. face: null,
  49503. faceIndex: null,
  49504. object: this
  49505. })
  49506. }
  49507. }
  49508. }
  49509. }
  49510. }(),
  49511. n.Line.prototype.clone = function() {
  49512. return new this.constructor(this.geometry,this.material).copy(this)
  49513. }
  49514. ,
  49515. n.LineStrip = 0,
  49516. n.LinePieces = 1,
  49517. n.LineSegments = function(e, t) {
  49518. n.Line.call(this, e, t),
  49519. this.type = "LineSegments"
  49520. }
  49521. ,
  49522. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49523. n.LineSegments.prototype.constructor = n.LineSegments,
  49524. n.Mesh = function(e, t) {
  49525. n.Object3D.call(this),
  49526. this.type = "Mesh",
  49527. this.geometry = void 0 !== e ? e : new n.Geometry,
  49528. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49529. color: 16777215 * Math.random()
  49530. }),
  49531. this.drawMode = n.TrianglesDrawMode,
  49532. this.updateMorphTargets()
  49533. }
  49534. ,
  49535. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49536. n.Mesh.prototype.constructor = n.Mesh,
  49537. n.Mesh.prototype.setDrawMode = function(e) {
  49538. this.drawMode = e
  49539. }
  49540. ,
  49541. n.Mesh.prototype.updateMorphTargets = function() {
  49542. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49543. this.morphTargetBase = -1,
  49544. this.morphTargetInfluences = [],
  49545. this.morphTargetDictionary = {};
  49546. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49547. this.morphTargetInfluences.push(0),
  49548. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49549. }
  49550. }
  49551. ,
  49552. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49553. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49554. 0)
  49555. }
  49556. ,
  49557. n.Mesh.prototype.raycast = function() {
  49558. function e(e, t, i, r, o, a, s) {
  49559. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49560. o.multiplyScalar(m.x),
  49561. a.multiplyScalar(m.y),
  49562. s.multiplyScalar(m.z),
  49563. o.add(a).add(s),
  49564. o.clone()
  49565. }
  49566. function t(e, t, i, r, o, a, s) {
  49567. var l, c = e.material;
  49568. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49569. null === l)
  49570. return null;
  49571. A.copy(s),
  49572. A.applyMatrix4(e.matrixWorld);
  49573. var h = t.ray.origin.distanceTo(A);
  49574. return h < t.near || h > t.far ? null : {
  49575. distance: h,
  49576. point: A.clone(),
  49577. object: e
  49578. }
  49579. }
  49580. function i(i, r, o, a, h, u, d, m) {
  49581. s.fromArray(a, 3 * u),
  49582. l.fromArray(a, 3 * d),
  49583. c.fromArray(a, 3 * m);
  49584. var A = t(i, r, o, s, l, c, v);
  49585. return A && (h && (p.fromArray(h, 2 * u),
  49586. f.fromArray(h, 2 * d),
  49587. g.fromArray(h, 2 * m),
  49588. A.uv = e(v, s, l, c, p, f, g)),
  49589. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49590. A.faceIndex = u),
  49591. A
  49592. }
  49593. var r = new n.Matrix4
  49594. , o = new n.Ray
  49595. , a = new n.Sphere
  49596. , s = new n.Vector3
  49597. , l = new n.Vector3
  49598. , c = new n.Vector3
  49599. , h = new n.Vector3
  49600. , u = new n.Vector3
  49601. , d = new n.Vector3
  49602. , p = new n.Vector2
  49603. , f = new n.Vector2
  49604. , g = new n.Vector2
  49605. , m = new n.Vector3
  49606. , v = new n.Vector3
  49607. , A = new n.Vector3;
  49608. return function(m, A) {
  49609. var y = this.geometry
  49610. , C = this.material
  49611. , I = this.matrixWorld;
  49612. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49613. a.copy(y.boundingSphere),
  49614. a.applyMatrix4(I),
  49615. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49616. o.copy(m.ray).applyMatrix4(r),
  49617. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49618. var E, b;
  49619. if (y instanceof n.BufferGeometry) {
  49620. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49621. if (void 0 !== S.uv && (E = S.uv.array),
  49622. null !== x)
  49623. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49624. w = R[P],
  49625. _ = R[P + 1],
  49626. T = R[P + 2],
  49627. b = i(this, m, o, M, E, w, _, T),
  49628. b && (b.faceIndex = Math.floor(P / 3),
  49629. A.push(b));
  49630. else
  49631. for (var P = 0, O = M.length; P < O; P += 9)
  49632. w = P / 3,
  49633. _ = w + 1,
  49634. T = w + 2,
  49635. b = i(this, m, o, M, E, w, _, T),
  49636. b && (b.index = w,
  49637. A.push(b))
  49638. } else if (y instanceof n.Geometry) {
  49639. 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];
  49640. k.length > 0 && (E = k);
  49641. for (var H = 0, G = U.length; H < G; H++) {
  49642. var z = U[H]
  49643. , W = B === !0 ? F[z.materialIndex] : C;
  49644. if (void 0 !== W) {
  49645. if (L = V[z.a],
  49646. D = V[z.b],
  49647. N = V[z.c],
  49648. W.morphTargets === !0) {
  49649. var j = y.morphTargets
  49650. , Y = this.morphTargetInfluences;
  49651. s.set(0, 0, 0),
  49652. l.set(0, 0, 0),
  49653. c.set(0, 0, 0);
  49654. for (var X = 0, Z = j.length; X < Z; X++) {
  49655. var q = Y[X];
  49656. if (0 !== q) {
  49657. var K = j[X].vertices;
  49658. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49659. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49660. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49661. }
  49662. }
  49663. s.add(L),
  49664. l.add(D),
  49665. c.add(N),
  49666. L = s,
  49667. D = l,
  49668. N = c
  49669. }
  49670. if (b = t(this, m, o, L, D, N, v)) {
  49671. if (E) {
  49672. var Q = E[H];
  49673. p.copy(Q[0]),
  49674. f.copy(Q[1]),
  49675. g.copy(Q[2]),
  49676. b.uv = e(v, L, D, N, p, f, g)
  49677. }
  49678. b.face = z,
  49679. b.faceIndex = H,
  49680. A.push(b)
  49681. }
  49682. }
  49683. }
  49684. }
  49685. }
  49686. }
  49687. }(),
  49688. n.Mesh.prototype.clone = function() {
  49689. return new this.constructor(this.geometry,this.material).copy(this)
  49690. }
  49691. ,
  49692. n.Bone = function(e) {
  49693. n.Object3D.call(this),
  49694. this.type = "Bone",
  49695. this.skin = e
  49696. }
  49697. ,
  49698. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49699. n.Bone.prototype.constructor = n.Bone,
  49700. n.Bone.prototype.copy = function(e) {
  49701. return n.Object3D.prototype.copy.call(this, e),
  49702. this.skin = e.skin,
  49703. this
  49704. }
  49705. ,
  49706. n.Skeleton = function(e, t, i) {
  49707. if (this.useVertexTexture = void 0 === i || i,
  49708. this.identityMatrix = new n.Matrix4,
  49709. e = e || [],
  49710. this.bones = e.slice(0),
  49711. this.useVertexTexture) {
  49712. var r = Math.sqrt(4 * this.bones.length);
  49713. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49714. r = Math.max(r, 4),
  49715. this.boneTextureWidth = r,
  49716. this.boneTextureHeight = r,
  49717. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49718. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49719. } else
  49720. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49721. if (void 0 === t)
  49722. this.calculateInverses();
  49723. else if (this.bones.length === t.length)
  49724. this.boneInverses = t.slice(0);
  49725. else {
  49726. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49727. this.boneInverses = [];
  49728. for (var o = 0, a = this.bones.length; o < a; o++)
  49729. this.boneInverses.push(new n.Matrix4)
  49730. }
  49731. }
  49732. ,
  49733. n.Skeleton.prototype.calculateInverses = function() {
  49734. this.boneInverses = [];
  49735. for (var e = 0, t = this.bones.length; e < t; e++) {
  49736. var i = new n.Matrix4;
  49737. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49738. this.boneInverses.push(i)
  49739. }
  49740. }
  49741. ,
  49742. n.Skeleton.prototype.pose = function() {
  49743. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49744. e = this.bones[t],
  49745. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49746. for (var t = 0, i = this.bones.length; t < i; t++)
  49747. e = this.bones[t],
  49748. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49749. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49750. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49751. }
  49752. ,
  49753. n.Skeleton.prototype.update = function() {
  49754. var e = new n.Matrix4;
  49755. return function() {
  49756. for (var t = 0, i = this.bones.length; t < i; t++) {
  49757. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49758. e.multiplyMatrices(n, this.boneInverses[t]),
  49759. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49760. }
  49761. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49762. }
  49763. }(),
  49764. n.Skeleton.prototype.clone = function() {
  49765. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49766. }
  49767. ,
  49768. n.SkinnedMesh = function(e, t, i) {
  49769. n.Mesh.call(this, e, t),
  49770. this.type = "SkinnedMesh",
  49771. this.bindMode = "attached",
  49772. this.bindMatrix = new n.Matrix4,
  49773. this.bindMatrixInverse = new n.Matrix4;
  49774. var r = [];
  49775. if (this.geometry && void 0 !== this.geometry.bones) {
  49776. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49777. a = this.geometry.bones[s],
  49778. o = new n.Bone(this),
  49779. r.push(o),
  49780. o.name = a.name,
  49781. o.position.fromArray(a.pos),
  49782. o.quaternion.fromArray(a.rotq),
  49783. void 0 !== a.scl && o.scale.fromArray(a.scl);
  49784. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  49785. a = this.geometry.bones[s],
  49786. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  49787. }
  49788. this.normalizeSkinWeights(),
  49789. this.updateMatrixWorld(!0),
  49790. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  49791. }
  49792. ,
  49793. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  49794. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  49795. n.SkinnedMesh.prototype.bind = function(e, t) {
  49796. this.skeleton = e,
  49797. void 0 === t && (this.updateMatrixWorld(!0),
  49798. this.skeleton.calculateInverses(),
  49799. t = this.matrixWorld),
  49800. this.bindMatrix.copy(t),
  49801. this.bindMatrixInverse.getInverse(t)
  49802. }
  49803. ,
  49804. n.SkinnedMesh.prototype.pose = function() {
  49805. this.skeleton.pose()
  49806. }
  49807. ,
  49808. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  49809. if (this.geometry instanceof n.Geometry)
  49810. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  49811. var t = this.geometry.skinWeights[e]
  49812. , i = 1 / t.lengthManhattan();
  49813. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  49814. }
  49815. else if (this.geometry instanceof n.BufferGeometry)
  49816. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  49817. r.x = o.getX(e),
  49818. r.y = o.getY(e),
  49819. r.z = o.getZ(e),
  49820. r.w = o.getW(e);
  49821. var i = 1 / r.lengthManhattan();
  49822. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  49823. o.setXYZW(e, r.x, r.y, r.z, r.w)
  49824. }
  49825. }
  49826. ,
  49827. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  49828. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  49829. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  49830. }
  49831. ,
  49832. n.SkinnedMesh.prototype.clone = function() {
  49833. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  49834. }
  49835. ,
  49836. n.LOD = function() {
  49837. n.Object3D.call(this),
  49838. this.type = "LOD",
  49839. Object.defineProperties(this, {
  49840. levels: {
  49841. enumerable: !0,
  49842. value: []
  49843. },
  49844. objects: {
  49845. get: function() {
  49846. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  49847. this.levels
  49848. }
  49849. }
  49850. })
  49851. }
  49852. ,
  49853. n.LOD.prototype = Object.create(n.Object3D.prototype),
  49854. n.LOD.prototype.constructor = n.LOD,
  49855. n.LOD.prototype.addLevel = function(e, t) {
  49856. void 0 === t && (t = 0),
  49857. t = Math.abs(t);
  49858. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  49859. ;
  49860. i.splice(n, 0, {
  49861. distance: t,
  49862. object: e
  49863. }),
  49864. this.add(e)
  49865. }
  49866. ,
  49867. n.LOD.prototype.getObjectForDistance = function(e) {
  49868. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  49869. ;
  49870. return t[i - 1].object
  49871. }
  49872. ,
  49873. n.LOD.prototype.raycast = function() {
  49874. var e = new n.Vector3;
  49875. return function(t, i) {
  49876. e.setFromMatrixPosition(this.matrixWorld);
  49877. var n = t.ray.origin.distanceTo(e);
  49878. this.getObjectForDistance(n).raycast(t, i)
  49879. }
  49880. }(),
  49881. n.LOD.prototype.update = function() {
  49882. var e = new n.Vector3
  49883. , t = new n.Vector3;
  49884. return function(i) {
  49885. var n = this.levels;
  49886. if (n.length > 1) {
  49887. e.setFromMatrixPosition(i.matrixWorld),
  49888. t.setFromMatrixPosition(this.matrixWorld);
  49889. var r = e.distanceTo(t);
  49890. n[0].object.visible = !0;
  49891. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  49892. n[o - 1].object.visible = !1,
  49893. n[o].object.visible = !0;
  49894. for (; o < a; o++)
  49895. n[o].object.visible = !1
  49896. }
  49897. }
  49898. }(),
  49899. n.LOD.prototype.copy = function(e) {
  49900. n.Object3D.prototype.copy.call(this, e, !1);
  49901. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  49902. var o = t[i];
  49903. this.addLevel(o.object.clone(), o.distance)
  49904. }
  49905. return this
  49906. }
  49907. ,
  49908. n.LOD.prototype.toJSON = function(e) {
  49909. var t = n.Object3D.prototype.toJSON.call(this, e);
  49910. t.object.levels = [];
  49911. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  49912. var a = i[r];
  49913. t.object.levels.push({
  49914. object: a.object.uuid,
  49915. distance: a.distance
  49916. })
  49917. }
  49918. return t
  49919. }
  49920. ,
  49921. n.Sprite = function() {
  49922. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  49923. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  49924. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  49925. , r = new n.BufferGeometry;
  49926. return r.setIndex(new n.BufferAttribute(e,1)),
  49927. r.addAttribute("position", new n.BufferAttribute(t,3)),
  49928. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  49929. function(e) {
  49930. n.Object3D.call(this),
  49931. this.type = "Sprite",
  49932. this.geometry = r,
  49933. this.material = void 0 !== e ? e : new n.SpriteMaterial
  49934. }
  49935. }(),
  49936. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  49937. n.Sprite.prototype.constructor = n.Sprite,
  49938. n.Sprite.prototype.raycast = function() {
  49939. var e = new n.Vector3;
  49940. return function(t, i) {
  49941. e.setFromMatrixPosition(this.matrixWorld);
  49942. var n = t.ray.distanceSqToPoint(e)
  49943. , r = this.scale.x * this.scale.y;
  49944. n > r || i.push({
  49945. distance: Math.sqrt(n),
  49946. point: this.position,
  49947. face: null,
  49948. object: this
  49949. })
  49950. }
  49951. }(),
  49952. n.Sprite.prototype.clone = function() {
  49953. return new this.constructor(this.material).copy(this)
  49954. }
  49955. ,
  49956. n.Particle = n.Sprite,
  49957. n.LensFlare = function(e, t, i, r, o) {
  49958. n.Object3D.call(this),
  49959. this.lensFlares = [],
  49960. this.positionScreen = new n.Vector3,
  49961. this.customUpdateCallback = void 0,
  49962. void 0 !== e && this.add(e, t, i, r, o)
  49963. }
  49964. ,
  49965. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  49966. n.LensFlare.prototype.constructor = n.LensFlare,
  49967. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  49968. void 0 === t && (t = -1),
  49969. void 0 === i && (i = 0),
  49970. void 0 === a && (a = 1),
  49971. void 0 === o && (o = new n.Color(16777215)),
  49972. void 0 === r && (r = n.NormalBlending),
  49973. i = Math.min(i, Math.max(0, i)),
  49974. this.lensFlares.push({
  49975. texture: e,
  49976. size: t,
  49977. distance: i,
  49978. x: 0,
  49979. y: 0,
  49980. z: 0,
  49981. scale: 1,
  49982. rotation: 0,
  49983. opacity: a,
  49984. color: o,
  49985. blending: r
  49986. })
  49987. }
  49988. ,
  49989. n.LensFlare.prototype.updateLensFlares = function() {
  49990. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  49991. for (e = 0; e < i; e++)
  49992. t = this.lensFlares[e],
  49993. t.x = this.positionScreen.x + n * t.distance,
  49994. t.y = this.positionScreen.y + r * t.distance,
  49995. t.wantedRotation = t.x * Math.PI * .25,
  49996. t.rotation += .25 * (t.wantedRotation - t.rotation)
  49997. }
  49998. ,
  49999. n.LensFlare.prototype.copy = function(e) {
  50000. n.Object3D.prototype.copy.call(this, e),
  50001. this.positionScreen.copy(e.positionScreen),
  50002. this.customUpdateCallback = e.customUpdateCallback;
  50003. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50004. this.lensFlares.push(e.lensFlares[t]);
  50005. return this
  50006. }
  50007. ,
  50008. n.Scene = function() {
  50009. n.Object3D.call(this),
  50010. this.type = "Scene",
  50011. this.fog = null,
  50012. this.overrideMaterial = null,
  50013. this.autoUpdate = !0
  50014. }
  50015. ,
  50016. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50017. n.Scene.prototype.constructor = n.Scene,
  50018. n.Scene.prototype.copy = function(e, t) {
  50019. return n.Object3D.prototype.copy.call(this, e, t),
  50020. null !== e.fog && (this.fog = e.fog.clone()),
  50021. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50022. this.autoUpdate = e.autoUpdate,
  50023. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50024. this
  50025. }
  50026. ,
  50027. n.Fog = function(e, t, i) {
  50028. this.name = "",
  50029. this.color = new n.Color(e),
  50030. this.near = void 0 !== t ? t : 1,
  50031. this.far = void 0 !== i ? i : 1e3
  50032. }
  50033. ,
  50034. n.Fog.prototype.clone = function() {
  50035. return new n.Fog(this.color.getHex(),this.near,this.far)
  50036. }
  50037. ,
  50038. n.FogExp2 = function(e, t) {
  50039. this.name = "",
  50040. this.color = new n.Color(e),
  50041. this.density = void 0 !== t ? t : 25e-5
  50042. }
  50043. ,
  50044. n.FogExp2.prototype.clone = function() {
  50045. return new n.FogExp2(this.color.getHex(),this.density)
  50046. }
  50047. ,
  50048. n.ShaderChunk = {},
  50049. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50050. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50051. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50052. 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",
  50053. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50054. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50055. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50056. 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",
  50057. 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",
  50058. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50059. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50060. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50061. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50062. 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",
  50063. 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",
  50064. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50065. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50066. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50067. 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",
  50068. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50069. 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",
  50070. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50071. 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",
  50072. 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",
  50073. 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",
  50074. 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",
  50075. 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",
  50076. 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",
  50077. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50078. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50079. 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",
  50080. 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",
  50081. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50082. 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",
  50083. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50084. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50085. 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",
  50086. 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",
  50087. 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",
  50088. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50089. 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",
  50090. 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",
  50091. 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",
  50092. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50093. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50094. 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",
  50095. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50096. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50097. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50098. 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",
  50099. 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";
  50100. 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";
  50101. 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",
  50102. 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",
  50103. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50104. 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",
  50105. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50106. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50107. 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",
  50108. 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",
  50109. 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",
  50110. 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",
  50111. 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",
  50112. 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",
  50113. 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",
  50114. 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",
  50115. 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",
  50116. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50117. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50118. 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",
  50119. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50120. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50121. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50122. 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",
  50123. 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",
  50124. 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",
  50125. 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",
  50126. n.UniformsUtils = {
  50127. merge: function(e) {
  50128. for (var t = {}, i = 0; i < e.length; i++) {
  50129. var n = this.clone(e[i]);
  50130. for (var r in n)
  50131. t[r] = n[r]
  50132. }
  50133. return t
  50134. },
  50135. clone: function(e) {
  50136. var t = {};
  50137. for (var i in e) {
  50138. t[i] = {};
  50139. for (var r in e[i]) {
  50140. var o = e[i][r];
  50141. 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
  50142. }
  50143. }
  50144. return t
  50145. }
  50146. },
  50147. n.UniformsLib = {
  50148. common: {
  50149. diffuse: {
  50150. type: "c",
  50151. value: new n.Color(15658734)
  50152. },
  50153. opacity: {
  50154. type: "f",
  50155. value: 1
  50156. },
  50157. map: {
  50158. type: "t",
  50159. value: null
  50160. },
  50161. offsetRepeat: {
  50162. type: "v4",
  50163. value: new n.Vector4(0,0,1,1)
  50164. },
  50165. specularMap: {
  50166. type: "t",
  50167. value: null
  50168. },
  50169. alphaMap: {
  50170. type: "t",
  50171. value: null
  50172. },
  50173. envMap: {
  50174. type: "t",
  50175. value: null
  50176. },
  50177. flipEnvMap: {
  50178. type: "f",
  50179. value: -1
  50180. },
  50181. reflectivity: {
  50182. type: "f",
  50183. value: 1
  50184. },
  50185. refractionRatio: {
  50186. type: "f",
  50187. value: .98
  50188. }
  50189. },
  50190. aomap: {
  50191. aoMap: {
  50192. type: "t",
  50193. value: null
  50194. },
  50195. aoMapIntensity: {
  50196. type: "f",
  50197. value: 1
  50198. }
  50199. },
  50200. lightmap: {
  50201. lightMap: {
  50202. type: "t",
  50203. value: null
  50204. },
  50205. lightMapIntensity: {
  50206. type: "f",
  50207. value: 1
  50208. }
  50209. },
  50210. emissivemap: {
  50211. emissiveMap: {
  50212. type: "t",
  50213. value: null
  50214. }
  50215. },
  50216. bumpmap: {
  50217. bumpMap: {
  50218. type: "t",
  50219. value: null
  50220. },
  50221. bumpScale: {
  50222. type: "f",
  50223. value: 1
  50224. }
  50225. },
  50226. normalmap: {
  50227. normalMap: {
  50228. type: "t",
  50229. value: null
  50230. },
  50231. normalScale: {
  50232. type: "v2",
  50233. value: new n.Vector2(1,1)
  50234. }
  50235. },
  50236. displacementmap: {
  50237. displacementMap: {
  50238. type: "t",
  50239. value: null
  50240. },
  50241. displacementScale: {
  50242. type: "f",
  50243. value: 1
  50244. },
  50245. displacementBias: {
  50246. type: "f",
  50247. value: 0
  50248. }
  50249. },
  50250. roughnessmap: {
  50251. roughnessMap: {
  50252. type: "t",
  50253. value: null
  50254. }
  50255. },
  50256. metalnessmap: {
  50257. metalnessMap: {
  50258. type: "t",
  50259. value: null
  50260. }
  50261. },
  50262. fog: {
  50263. fogDensity: {
  50264. type: "f",
  50265. value: 25e-5
  50266. },
  50267. fogNear: {
  50268. type: "f",
  50269. value: 1
  50270. },
  50271. fogFar: {
  50272. type: "f",
  50273. value: 2e3
  50274. },
  50275. fogColor: {
  50276. type: "c",
  50277. value: new n.Color(16777215)
  50278. }
  50279. },
  50280. lights: {
  50281. ambientLightColor: {
  50282. type: "fv",
  50283. value: []
  50284. },
  50285. directionalLights: {
  50286. type: "sa",
  50287. value: [],
  50288. properties: {
  50289. direction: {
  50290. type: "v3"
  50291. },
  50292. color: {
  50293. type: "c"
  50294. },
  50295. shadow: {
  50296. type: "i"
  50297. },
  50298. shadowBias: {
  50299. type: "f"
  50300. },
  50301. shadowRadius: {
  50302. type: "f"
  50303. },
  50304. shadowMapSize: {
  50305. type: "v2"
  50306. }
  50307. }
  50308. },
  50309. directionalShadowMap: {
  50310. type: "tv",
  50311. value: []
  50312. },
  50313. directionalShadowMatrix: {
  50314. type: "m4v",
  50315. value: []
  50316. },
  50317. spotLights: {
  50318. type: "sa",
  50319. value: [],
  50320. properties: {
  50321. color: {
  50322. type: "c"
  50323. },
  50324. position: {
  50325. type: "v3"
  50326. },
  50327. direction: {
  50328. type: "v3"
  50329. },
  50330. distance: {
  50331. type: "f"
  50332. },
  50333. coneCos: {
  50334. type: "f"
  50335. },
  50336. penumbraCos: {
  50337. type: "f"
  50338. },
  50339. decay: {
  50340. type: "f"
  50341. },
  50342. shadow: {
  50343. type: "i"
  50344. },
  50345. shadowBias: {
  50346. type: "f"
  50347. },
  50348. shadowRadius: {
  50349. type: "f"
  50350. },
  50351. shadowMapSize: {
  50352. type: "v2"
  50353. }
  50354. }
  50355. },
  50356. spotShadowMap: {
  50357. type: "tv",
  50358. value: []
  50359. },
  50360. spotShadowMatrix: {
  50361. type: "m4v",
  50362. value: []
  50363. },
  50364. pointLights: {
  50365. type: "sa",
  50366. value: [],
  50367. properties: {
  50368. color: {
  50369. type: "c"
  50370. },
  50371. position: {
  50372. type: "v3"
  50373. },
  50374. decay: {
  50375. type: "f"
  50376. },
  50377. distance: {
  50378. type: "f"
  50379. },
  50380. shadow: {
  50381. type: "i"
  50382. },
  50383. shadowBias: {
  50384. type: "f"
  50385. },
  50386. shadowRadius: {
  50387. type: "f"
  50388. },
  50389. shadowMapSize: {
  50390. type: "v2"
  50391. }
  50392. }
  50393. },
  50394. pointShadowMap: {
  50395. type: "tv",
  50396. value: []
  50397. },
  50398. pointShadowMatrix: {
  50399. type: "m4v",
  50400. value: []
  50401. },
  50402. hemisphereLights: {
  50403. type: "sa",
  50404. value: [],
  50405. properties: {
  50406. direction: {
  50407. type: "v3"
  50408. },
  50409. skyColor: {
  50410. type: "c"
  50411. },
  50412. groundColor: {
  50413. type: "c"
  50414. }
  50415. }
  50416. }
  50417. },
  50418. points: {
  50419. diffuse: {
  50420. type: "c",
  50421. value: new n.Color(15658734)
  50422. },
  50423. opacity: {
  50424. type: "f",
  50425. value: 1
  50426. },
  50427. size: {
  50428. type: "f",
  50429. value: 1
  50430. },
  50431. scale: {
  50432. type: "f",
  50433. value: 1
  50434. },
  50435. map: {
  50436. type: "t",
  50437. value: null
  50438. },
  50439. offsetRepeat: {
  50440. type: "v4",
  50441. value: new n.Vector4(0,0,1,1)
  50442. }
  50443. }
  50444. },
  50445. 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",
  50446. 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",
  50447. 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",
  50448. 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",
  50449. 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",
  50450. 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",
  50451. 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",
  50452. 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",
  50453. 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",
  50454. 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",
  50455. 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",
  50456. 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",
  50457. 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",
  50458. 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",
  50459. 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",
  50460. 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",
  50461. 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",
  50462. 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",
  50463. 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",
  50464. 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",
  50465. 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",
  50466. 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",
  50467. 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",
  50468. 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",
  50469. n.ShaderLib = {
  50470. basic: {
  50471. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50472. vertexShader: n.ShaderChunk.meshbasic_vert,
  50473. fragmentShader: n.ShaderChunk.meshbasic_frag
  50474. },
  50475. lambert: {
  50476. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50477. emissive: {
  50478. type: "c",
  50479. value: new n.Color(0)
  50480. }
  50481. }]),
  50482. vertexShader: n.ShaderChunk.meshlambert_vert,
  50483. fragmentShader: n.ShaderChunk.meshlambert_frag
  50484. },
  50485. phong: {
  50486. 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, {
  50487. emissive: {
  50488. type: "c",
  50489. value: new n.Color(0)
  50490. },
  50491. specular: {
  50492. type: "c",
  50493. value: new n.Color(1118481)
  50494. },
  50495. shininess: {
  50496. type: "f",
  50497. value: 30
  50498. }
  50499. }]),
  50500. vertexShader: n.ShaderChunk.meshphong_vert,
  50501. fragmentShader: n.ShaderChunk.meshphong_frag
  50502. },
  50503. standard: {
  50504. 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, {
  50505. emissive: {
  50506. type: "c",
  50507. value: new n.Color(0)
  50508. },
  50509. roughness: {
  50510. type: "f",
  50511. value: .5
  50512. },
  50513. metalness: {
  50514. type: "f",
  50515. value: 0
  50516. },
  50517. envMapIntensity: {
  50518. type: "f",
  50519. value: 1
  50520. }
  50521. }]),
  50522. vertexShader: n.ShaderChunk.meshstandard_vert,
  50523. fragmentShader: n.ShaderChunk.meshstandard_frag
  50524. },
  50525. points: {
  50526. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50527. vertexShader: n.ShaderChunk.points_vert,
  50528. fragmentShader: n.ShaderChunk.points_frag
  50529. },
  50530. dashed: {
  50531. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50532. scale: {
  50533. type: "f",
  50534. value: 1
  50535. },
  50536. dashSize: {
  50537. type: "f",
  50538. value: 1
  50539. },
  50540. totalSize: {
  50541. type: "f",
  50542. value: 2
  50543. }
  50544. }]),
  50545. vertexShader: n.ShaderChunk.linedashed_vert,
  50546. fragmentShader: n.ShaderChunk.linedashed_frag
  50547. },
  50548. depth: {
  50549. uniforms: {
  50550. mNear: {
  50551. type: "f",
  50552. value: 1
  50553. },
  50554. mFar: {
  50555. type: "f",
  50556. value: 2e3
  50557. },
  50558. opacity: {
  50559. type: "f",
  50560. value: 1
  50561. }
  50562. },
  50563. vertexShader: n.ShaderChunk.depth_vert,
  50564. fragmentShader: n.ShaderChunk.depth_frag
  50565. },
  50566. normal: {
  50567. uniforms: {
  50568. opacity: {
  50569. type: "f",
  50570. value: 1
  50571. }
  50572. },
  50573. vertexShader: n.ShaderChunk.normal_vert,
  50574. fragmentShader: n.ShaderChunk.normal_frag
  50575. },
  50576. cube: {
  50577. uniforms: {
  50578. tCube: {
  50579. type: "t",
  50580. value: null
  50581. },
  50582. tFlip: {
  50583. type: "f",
  50584. value: -1
  50585. }
  50586. },
  50587. vertexShader: n.ShaderChunk.cube_vert,
  50588. fragmentShader: n.ShaderChunk.cube_frag
  50589. },
  50590. equirect: {
  50591. uniforms: {
  50592. tEquirect: {
  50593. type: "t",
  50594. value: null
  50595. },
  50596. tFlip: {
  50597. type: "f",
  50598. value: -1
  50599. }
  50600. },
  50601. vertexShader: n.ShaderChunk.equirect_vert,
  50602. fragmentShader: n.ShaderChunk.equirect_frag
  50603. },
  50604. depthRGBA: {
  50605. uniforms: {},
  50606. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50607. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50608. },
  50609. distanceRGBA: {
  50610. uniforms: {
  50611. lightPos: {
  50612. type: "v3",
  50613. value: new n.Vector3(0,0,0)
  50614. }
  50615. },
  50616. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50617. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50618. }
  50619. },
  50620. n.WebGLRenderer = function(e) {
  50621. function t() {
  50622. return null === ye ? Oe : 1
  50623. }
  50624. function i(e, t, i, n) {
  50625. se === !0 && (e *= n,
  50626. t *= n,
  50627. i *= n),
  50628. Ye.clearColor(e, t, i, n)
  50629. }
  50630. function r() {
  50631. Ye.init(),
  50632. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50633. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50634. i(Se.r, Se.g, Se.b, Me)
  50635. }
  50636. function o() {
  50637. Ae = null,
  50638. be = null,
  50639. Ee = "",
  50640. Ie = -1,
  50641. Ye.reset()
  50642. }
  50643. function a(e) {
  50644. e.preventDefault(),
  50645. o(),
  50646. r(),
  50647. Xe.clear()
  50648. }
  50649. function s(e) {
  50650. var t = e.target;
  50651. t.removeEventListener("dispose", s),
  50652. h(t),
  50653. ke.textures--
  50654. }
  50655. function l(e) {
  50656. var t = e.target;
  50657. t.removeEventListener("dispose", l),
  50658. u(t),
  50659. ke.textures--
  50660. }
  50661. function c(e) {
  50662. var t = e.target;
  50663. t.removeEventListener("dispose", c),
  50664. d(t)
  50665. }
  50666. function h(e) {
  50667. var t = Xe.get(e);
  50668. if (e.image && t.__image__webglTextureCube)
  50669. Ge.deleteTexture(t.__image__webglTextureCube);
  50670. else {
  50671. if (void 0 === t.__webglInit)
  50672. return;
  50673. Ge.deleteTexture(t.__webglTexture)
  50674. }
  50675. Xe.delete(e)
  50676. }
  50677. function u(e) {
  50678. var t = Xe.get(e)
  50679. , i = Xe.get(e.texture);
  50680. if (e && void 0 !== i.__webglTexture) {
  50681. if (Ge.deleteTexture(i.__webglTexture),
  50682. e instanceof n.WebGLRenderTargetCube)
  50683. for (var r = 0; r < 6; r++)
  50684. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50685. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50686. else
  50687. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50688. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50689. Xe.delete(e.texture),
  50690. Xe.delete(e)
  50691. }
  50692. }
  50693. function d(e) {
  50694. p(e),
  50695. Xe.delete(e)
  50696. }
  50697. function p(e) {
  50698. var t = Xe.get(e).program;
  50699. e.program = void 0,
  50700. void 0 !== t && qe.releaseProgram(t)
  50701. }
  50702. function f(e, t, i, r) {
  50703. var o;
  50704. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50705. null === o))
  50706. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50707. void 0 === r && (r = 0),
  50708. Ye.initAttributes();
  50709. var a = i.attributes
  50710. , s = t.getAttributes()
  50711. , l = e.defaultAttributeValues;
  50712. for (var c in s) {
  50713. var h = s[c];
  50714. if (h >= 0) {
  50715. var u = a[c];
  50716. if (void 0 !== u) {
  50717. var d = u.itemSize
  50718. , p = Ze.getAttributeBuffer(u);
  50719. if (u instanceof n.InterleavedBufferAttribute) {
  50720. var f = u.data
  50721. , g = f.stride
  50722. , m = u.offset;
  50723. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50724. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50725. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50726. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50727. } else
  50728. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50729. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50730. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50731. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50732. } else if (void 0 !== l) {
  50733. var v = l[c];
  50734. if (void 0 !== v)
  50735. switch (v.length) {
  50736. case 2:
  50737. Ge.vertexAttrib2fv(h, v);
  50738. break;
  50739. case 3:
  50740. Ge.vertexAttrib3fv(h, v);
  50741. break;
  50742. case 4:
  50743. Ge.vertexAttrib4fv(h, v);
  50744. break;
  50745. default:
  50746. Ge.vertexAttrib1fv(h, v)
  50747. }
  50748. }
  50749. }
  50750. }
  50751. Ye.disableUnusedAttributes()
  50752. }
  50753. function g(e, t) {
  50754. return Math.abs(t[0]) - Math.abs(e[0])
  50755. }
  50756. function m(e, t) {
  50757. 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
  50758. }
  50759. function v(e, t) {
  50760. 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
  50761. }
  50762. function A(e, t, i, n, r) {
  50763. var o, a;
  50764. i.transparent ? (o = de,
  50765. a = ++pe) : (o = he,
  50766. a = ++ue);
  50767. var s = o[a];
  50768. void 0 !== s ? (s.id = e.id,
  50769. s.object = e,
  50770. s.geometry = t,
  50771. s.material = i,
  50772. s.z = Ve.z,
  50773. s.group = r) : (s = {
  50774. id: e.id,
  50775. object: e,
  50776. geometry: t,
  50777. material: i,
  50778. z: Ve.z,
  50779. group: r
  50780. },
  50781. o.push(s))
  50782. }
  50783. function y(e, t) {
  50784. if (e.visible !== !1) {
  50785. if (e.layers.test(t.layers))
  50786. if (e instanceof n.Light)
  50787. ce.push(e);
  50788. else if (e instanceof n.Sprite)
  50789. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  50790. else if (e instanceof n.LensFlare)
  50791. me.push(e);
  50792. else if (e instanceof n.ImmediateRenderObject)
  50793. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50794. Ve.applyProjection(Fe)),
  50795. A(e, null, e.material, Ve.z, null);
  50796. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  50797. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  50798. var i = e.material;
  50799. if (i.visible === !0) {
  50800. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50801. Ve.applyProjection(Fe));
  50802. var r = Ze.update(e);
  50803. if (i instanceof n.MultiMaterial)
  50804. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  50805. var c = o[s]
  50806. , h = a[c.materialIndex];
  50807. h.visible === !0 && A(e, r, h, Ve.z, c)
  50808. }
  50809. else
  50810. A(e, r, i, Ve.z, null)
  50811. }
  50812. }
  50813. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  50814. y(u[s], t)
  50815. }
  50816. }
  50817. function C(e, t, i, r) {
  50818. for (var o = 0, a = e.length; o < a; o++) {
  50819. var s = e[o]
  50820. , l = s.object
  50821. , c = s.geometry
  50822. , h = void 0 === r ? s.material : r
  50823. , u = s.group;
  50824. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50825. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  50826. l instanceof n.ImmediateRenderObject) {
  50827. E(h);
  50828. var d = w(t, i, h, l);
  50829. Ee = "",
  50830. l.render(function(e) {
  50831. ve.renderBufferImmediate(e, d, h)
  50832. })
  50833. } else
  50834. ve.renderBufferDirect(t, i, c, h, l, u)
  50835. }
  50836. }
  50837. function I(e, t, i) {
  50838. var r = Xe.get(e)
  50839. , o = qe.getParameters(e, Ue, t, i)
  50840. , a = qe.getProgramCode(e, o)
  50841. , s = r.program
  50842. , l = !0;
  50843. if (void 0 === s)
  50844. e.addEventListener("dispose", c);
  50845. else if (s.code !== a)
  50846. p(e);
  50847. else {
  50848. if (void 0 !== o.shaderID)
  50849. return;
  50850. l = !1
  50851. }
  50852. if (l) {
  50853. if (o.shaderID) {
  50854. var h = n.ShaderLib[o.shaderID];
  50855. r.__webglShader = {
  50856. name: e.type,
  50857. uniforms: n.UniformsUtils.clone(h.uniforms),
  50858. vertexShader: h.vertexShader,
  50859. fragmentShader: h.fragmentShader
  50860. }
  50861. } else
  50862. r.__webglShader = {
  50863. name: e.type,
  50864. uniforms: e.uniforms,
  50865. vertexShader: e.vertexShader,
  50866. fragmentShader: e.fragmentShader
  50867. };
  50868. e.__webglShader = r.__webglShader,
  50869. s = qe.acquireProgram(e, o, a),
  50870. r.program = s,
  50871. e.program = s
  50872. }
  50873. var u = s.getAttributes();
  50874. if (e.morphTargets) {
  50875. e.numSupportedMorphTargets = 0;
  50876. for (var d = 0; d < ve.maxMorphTargets; d++)
  50877. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  50878. }
  50879. if (e.morphNormals) {
  50880. e.numSupportedMorphNormals = 0;
  50881. for (var d = 0; d < ve.maxMorphNormals; d++)
  50882. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  50883. }
  50884. r.uniformsList = [];
  50885. var f = r.__webglShader.uniforms
  50886. , g = r.program.getUniforms();
  50887. for (var m in f) {
  50888. var v = g[m];
  50889. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  50890. }
  50891. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  50892. f.ambientLightColor.value = Ue.ambient,
  50893. f.directionalLights.value = Ue.directional,
  50894. f.spotLights.value = Ue.spot,
  50895. f.pointLights.value = Ue.point,
  50896. f.hemisphereLights.value = Ue.hemi,
  50897. f.directionalShadowMap.value = Ue.directionalShadowMap,
  50898. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  50899. f.spotShadowMap.value = Ue.spotShadowMap,
  50900. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  50901. f.pointShadowMap.value = Ue.pointShadowMap,
  50902. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  50903. r.hasDynamicUniforms = !1;
  50904. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  50905. var C = r.uniformsList[A][0];
  50906. if (C.dynamic === !0) {
  50907. r.hasDynamicUniforms = !0;
  50908. break
  50909. }
  50910. }
  50911. }
  50912. function E(e) {
  50913. b(e),
  50914. 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),
  50915. Ye.setDepthFunc(e.depthFunc),
  50916. Ye.setDepthTest(e.depthTest),
  50917. Ye.setDepthWrite(e.depthWrite),
  50918. Ye.setColorWrite(e.colorWrite),
  50919. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  50920. }
  50921. function b(e) {
  50922. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  50923. Ye.setFlipSided(e.side === n.BackSide)
  50924. }
  50925. function w(e, t, i, r) {
  50926. xe = 0;
  50927. var o = Xe.get(i);
  50928. void 0 === o.program && (i.needsUpdate = !0),
  50929. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  50930. i.needsUpdate && (I(i, t, r),
  50931. i.needsUpdate = !1);
  50932. var a = !1
  50933. , s = !1
  50934. , l = !1
  50935. , c = o.program
  50936. , h = c.getUniforms()
  50937. , u = o.__webglShader.uniforms;
  50938. if (c.id !== Ae && (Ge.useProgram(c.program),
  50939. Ae = c.id,
  50940. a = !0,
  50941. s = !0,
  50942. l = !0),
  50943. i.id !== Ie && (Ie = i.id,
  50944. s = !0),
  50945. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  50946. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  50947. e !== be && (be = e,
  50948. s = !0,
  50949. l = !0),
  50950. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  50951. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  50952. (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),
  50953. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  50954. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  50955. i.skinning)
  50956. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  50957. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  50958. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  50959. if (void 0 !== h.boneTexture) {
  50960. var d = B();
  50961. Ge.uniform1i(h.boneTexture, d),
  50962. ve.setTexture(r.skeleton.boneTexture, d)
  50963. }
  50964. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  50965. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  50966. } else
  50967. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  50968. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  50969. t && i.fog && R(u, t),
  50970. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  50971. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  50972. 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,
  50973. u.mFar.value = e.far,
  50974. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  50975. V(o.uniformsList)),
  50976. N(h, r),
  50977. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  50978. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  50979. c
  50980. }
  50981. function _(e, t, i) {
  50982. for (var n = [], r = 0, o = e.length; r < o; r++) {
  50983. var a = e[r][0]
  50984. , s = a.onUpdateCallback;
  50985. void 0 !== s && (s.bind(a)(t, i),
  50986. n.push(e[r]))
  50987. }
  50988. V(n)
  50989. }
  50990. function T(e, t) {
  50991. e.opacity.value = t.opacity,
  50992. e.diffuse.value = t.color,
  50993. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  50994. e.map.value = t.map,
  50995. e.specularMap.value = t.specularMap,
  50996. e.alphaMap.value = t.alphaMap,
  50997. t.aoMap && (e.aoMap.value = t.aoMap,
  50998. e.aoMapIntensity.value = t.aoMapIntensity);
  50999. var i;
  51000. 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),
  51001. void 0 !== i) {
  51002. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51003. var r = i.offset
  51004. , o = i.repeat;
  51005. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51006. }
  51007. e.envMap.value = t.envMap,
  51008. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51009. e.reflectivity.value = t.reflectivity,
  51010. e.refractionRatio.value = t.refractionRatio
  51011. }
  51012. function x(e, t) {
  51013. e.diffuse.value = t.color,
  51014. e.opacity.value = t.opacity
  51015. }
  51016. function S(e, t) {
  51017. e.dashSize.value = t.dashSize,
  51018. e.totalSize.value = t.dashSize + t.gapSize,
  51019. e.scale.value = t.scale
  51020. }
  51021. function M(e, t) {
  51022. if (e.diffuse.value = t.color,
  51023. e.opacity.value = t.opacity,
  51024. e.size.value = t.size * Oe,
  51025. e.scale.value = te.clientHeight / 2,
  51026. e.map.value = t.map,
  51027. null !== t.map) {
  51028. var i = t.map.offset
  51029. , n = t.map.repeat;
  51030. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51031. }
  51032. }
  51033. function R(e, t) {
  51034. e.fogColor.value = t.color,
  51035. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51036. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51037. }
  51038. function P(e, t) {
  51039. t.lightMap && (e.lightMap.value = t.lightMap,
  51040. e.lightMapIntensity.value = t.lightMapIntensity),
  51041. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51042. }
  51043. function O(e, t) {
  51044. e.specular.value = t.specular,
  51045. e.shininess.value = Math.max(t.shininess, 1e-4),
  51046. t.lightMap && (e.lightMap.value = t.lightMap,
  51047. e.lightMapIntensity.value = t.lightMapIntensity),
  51048. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51049. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51050. e.bumpScale.value = t.bumpScale),
  51051. t.normalMap && (e.normalMap.value = t.normalMap,
  51052. e.normalScale.value.copy(t.normalScale)),
  51053. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51054. e.displacementScale.value = t.displacementScale,
  51055. e.displacementBias.value = t.displacementBias)
  51056. }
  51057. function L(e, t) {
  51058. e.roughness.value = t.roughness,
  51059. e.metalness.value = t.metalness,
  51060. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51061. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51062. t.lightMap && (e.lightMap.value = t.lightMap,
  51063. e.lightMapIntensity.value = t.lightMapIntensity),
  51064. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51065. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51066. e.bumpScale.value = t.bumpScale),
  51067. t.normalMap && (e.normalMap.value = t.normalMap,
  51068. e.normalScale.value.copy(t.normalScale)),
  51069. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51070. e.displacementScale.value = t.displacementScale,
  51071. e.displacementBias.value = t.displacementBias),
  51072. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51073. }
  51074. function D(e, t) {
  51075. e.ambientLightColor.needsUpdate = t,
  51076. e.directionalLights.needsUpdate = t,
  51077. e.pointLights.needsUpdate = t,
  51078. e.spotLights.needsUpdate = t,
  51079. e.hemisphereLights.needsUpdate = t
  51080. }
  51081. function N(e, t) {
  51082. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51083. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51084. }
  51085. function B() {
  51086. var e = xe;
  51087. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51088. xe += 1,
  51089. e
  51090. }
  51091. function F(e, t, i, r) {
  51092. var o, a;
  51093. if ("1i" === t)
  51094. Ge.uniform1i(i, r);
  51095. else if ("1f" === t)
  51096. Ge.uniform1f(i, r);
  51097. else if ("2f" === t)
  51098. Ge.uniform2f(i, r[0], r[1]);
  51099. else if ("3f" === t)
  51100. Ge.uniform3f(i, r[0], r[1], r[2]);
  51101. else if ("4f" === t)
  51102. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51103. else if ("1iv" === t)
  51104. Ge.uniform1iv(i, r);
  51105. else if ("3iv" === t)
  51106. Ge.uniform3iv(i, r);
  51107. else if ("1fv" === t)
  51108. Ge.uniform1fv(i, r);
  51109. else if ("2fv" === t)
  51110. Ge.uniform2fv(i, r);
  51111. else if ("3fv" === t)
  51112. Ge.uniform3fv(i, r);
  51113. else if ("4fv" === t)
  51114. Ge.uniform4fv(i, r);
  51115. else if ("Matrix2fv" === t)
  51116. Ge.uniformMatrix2fv(i, !1, r);
  51117. else if ("Matrix3fv" === t)
  51118. Ge.uniformMatrix3fv(i, !1, r);
  51119. else if ("Matrix4fv" === t)
  51120. Ge.uniformMatrix4fv(i, !1, r);
  51121. else if ("i" === t)
  51122. Ge.uniform1i(i, r);
  51123. else if ("f" === t)
  51124. Ge.uniform1f(i, r);
  51125. else if ("v2" === t)
  51126. Ge.uniform2f(i, r.x, r.y);
  51127. else if ("v3" === t)
  51128. Ge.uniform3f(i, r.x, r.y, r.z);
  51129. else if ("v4" === t)
  51130. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51131. else if ("c" === t)
  51132. Ge.uniform3f(i, r.r, r.g, r.b);
  51133. else if ("s" === t) {
  51134. var s = e.properties;
  51135. for (var l in s) {
  51136. var c = s[l]
  51137. , h = i[l]
  51138. , u = r[l];
  51139. F(c, c.type, h, u)
  51140. }
  51141. } else if ("sa" === t)
  51142. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51143. for (var l in s) {
  51144. var c = s[l]
  51145. , h = i[d][l]
  51146. , u = r[d][l];
  51147. F(c, c.type, h, u)
  51148. }
  51149. else if ("iv1" === t)
  51150. Ge.uniform1iv(i, r);
  51151. else if ("iv" === t)
  51152. Ge.uniform3iv(i, r);
  51153. else if ("fv1" === t)
  51154. Ge.uniform1fv(i, r);
  51155. else if ("fv" === t)
  51156. Ge.uniform3fv(i, r);
  51157. else if ("v2v" === t) {
  51158. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51159. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51160. f += 2)
  51161. e._array[f + 0] = r[d].x,
  51162. e._array[f + 1] = r[d].y;
  51163. Ge.uniform2fv(i, e._array)
  51164. } else if ("v3v" === t) {
  51165. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51166. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51167. m += 3)
  51168. e._array[m + 0] = r[d].x,
  51169. e._array[m + 1] = r[d].y,
  51170. e._array[m + 2] = r[d].z;
  51171. Ge.uniform3fv(i, e._array)
  51172. } else if ("v4v" === t) {
  51173. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51174. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51175. v += 4)
  51176. e._array[v + 0] = r[d].x,
  51177. e._array[v + 1] = r[d].y,
  51178. e._array[v + 2] = r[d].z,
  51179. e._array[v + 3] = r[d].w;
  51180. Ge.uniform4fv(i, e._array)
  51181. } else if ("m2" === t)
  51182. Ge.uniformMatrix2fv(i, !1, r.elements);
  51183. else if ("m3" === t)
  51184. Ge.uniformMatrix3fv(i, !1, r.elements);
  51185. else if ("m3v" === t) {
  51186. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51187. for (var d = 0, g = r.length; d < g; d++)
  51188. r[d].flattenToArrayOffset(e._array, 9 * d);
  51189. Ge.uniformMatrix3fv(i, !1, e._array)
  51190. } else if ("m4" === t)
  51191. Ge.uniformMatrix4fv(i, !1, r.elements);
  51192. else if ("m4v" === t) {
  51193. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51194. for (var d = 0, g = r.length; d < g; d++)
  51195. r[d].flattenToArrayOffset(e._array, 16 * d);
  51196. Ge.uniformMatrix4fv(i, !1, e._array)
  51197. } else if ("t" === t) {
  51198. if (o = r,
  51199. a = B(),
  51200. Ge.uniform1i(i, a),
  51201. !o)
  51202. return;
  51203. 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)
  51204. } else if ("tv" === t) {
  51205. void 0 === e._array && (e._array = []);
  51206. for (var d = 0, g = e.value.length; d < g; d++)
  51207. e._array[d] = B();
  51208. Ge.uniform1iv(i, e._array);
  51209. for (var d = 0, g = e.value.length; d < g; d++)
  51210. o = e.value[d],
  51211. a = e._array[d],
  51212. 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))
  51213. } else
  51214. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51215. }
  51216. function V(e) {
  51217. for (var t = 0, i = e.length; t < i; t++) {
  51218. var n = e[t][0];
  51219. if (n.needsUpdate !== !1) {
  51220. var r = n.type
  51221. , o = e[t][1]
  51222. , a = n.value;
  51223. F(n, r, o, a)
  51224. }
  51225. }
  51226. }
  51227. function U(e, t) {
  51228. 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;
  51229. for (Ue.shadowsPointLight = 0,
  51230. i = 0,
  51231. r = e.length; i < r; i++)
  51232. if (o = e[i],
  51233. a = o.color,
  51234. s = o.intensity,
  51235. l = o.distance,
  51236. o instanceof n.AmbientLight)
  51237. c += a.r * s,
  51238. h += a.g * s,
  51239. u += a.b * s;
  51240. else if (o instanceof n.DirectionalLight) {
  51241. var A = Ke.get(o);
  51242. A.color.copy(o.color).multiplyScalar(o.intensity),
  51243. A.direction.setFromMatrixPosition(o.matrixWorld),
  51244. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51245. A.direction.sub(Ve),
  51246. A.direction.transformDirection(d),
  51247. A.shadow = o.castShadow,
  51248. o.castShadow && (A.shadowBias = o.shadow.bias,
  51249. A.shadowRadius = o.shadow.radius,
  51250. A.shadowMapSize = o.shadow.mapSize,
  51251. Ue.shadows[v++] = o),
  51252. Ue.directionalShadowMap[p] = o.shadow.map,
  51253. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51254. Ue.directional[p++] = A
  51255. } else if (o instanceof n.SpotLight) {
  51256. var A = Ke.get(o);
  51257. A.position.setFromMatrixPosition(o.matrixWorld),
  51258. A.position.applyMatrix4(d),
  51259. A.color.copy(a).multiplyScalar(s),
  51260. A.distance = l,
  51261. A.direction.setFromMatrixPosition(o.matrixWorld),
  51262. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51263. A.direction.sub(Ve),
  51264. A.direction.transformDirection(d),
  51265. A.coneCos = Math.cos(o.angle),
  51266. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51267. A.decay = 0 === o.distance ? 0 : o.decay,
  51268. A.shadow = o.castShadow,
  51269. o.castShadow && (A.shadowBias = o.shadow.bias,
  51270. A.shadowRadius = o.shadow.radius,
  51271. A.shadowMapSize = o.shadow.mapSize,
  51272. Ue.shadows[v++] = o),
  51273. Ue.spotShadowMap[g] = o.shadow.map,
  51274. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51275. Ue.spot[g++] = A
  51276. } else if (o instanceof n.PointLight) {
  51277. var A = Ke.get(o);
  51278. A.position.setFromMatrixPosition(o.matrixWorld),
  51279. A.position.applyMatrix4(d),
  51280. A.color.copy(o.color).multiplyScalar(o.intensity),
  51281. A.distance = o.distance,
  51282. A.decay = 0 === o.distance ? 0 : o.decay,
  51283. A.shadow = o.castShadow,
  51284. o.castShadow && (A.shadowBias = o.shadow.bias,
  51285. A.shadowRadius = o.shadow.radius,
  51286. A.shadowMapSize = o.shadow.mapSize,
  51287. Ue.shadows[v++] = o),
  51288. Ue.pointShadowMap[f] = o.shadow.map,
  51289. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51290. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51291. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51292. Ue.point[f++] = A
  51293. } else if (o instanceof n.HemisphereLight) {
  51294. var A = Ke.get(o);
  51295. A.direction.setFromMatrixPosition(o.matrixWorld),
  51296. A.direction.transformDirection(d),
  51297. A.direction.normalize(),
  51298. A.skyColor.copy(o.color).multiplyScalar(s),
  51299. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51300. Ue.hemi[m++] = A
  51301. }
  51302. Ue.ambient[0] = c,
  51303. Ue.ambient[1] = h,
  51304. Ue.ambient[2] = u,
  51305. Ue.directional.length = p,
  51306. Ue.spot.length = g,
  51307. Ue.point.length = f,
  51308. Ue.hemi.length = m,
  51309. Ue.shadows.length = v,
  51310. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51311. }
  51312. function k(e, t, i) {
  51313. var r;
  51314. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51315. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51316. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51317. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51318. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51319. 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),
  51320. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51321. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51322. 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)),
  51323. r = We.get("EXT_texture_filter_anisotropic")) {
  51324. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51325. return;
  51326. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51327. return;
  51328. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51329. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51330. }
  51331. }
  51332. function H(e, t, i) {
  51333. void 0 === e.__webglInit && (e.__webglInit = !0,
  51334. t.addEventListener("dispose", s),
  51335. e.__webglTexture = Ge.createTexture(),
  51336. ke.textures++),
  51337. Ye.activeTexture(Ge.TEXTURE0 + i),
  51338. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51339. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51340. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51341. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51342. var r = G(t.image, je.maxTextureSize);
  51343. W(t) && z(r) === !1 && (r = j(r));
  51344. var o = z(r)
  51345. , a = ee(t.format)
  51346. , l = ee(t.type);
  51347. k(Ge.TEXTURE_2D, t, o);
  51348. var c, h = t.mipmaps;
  51349. if (t instanceof n.DataTexture)
  51350. if (h.length > 0 && o) {
  51351. for (var u = 0, d = h.length; u < d; u++)
  51352. c = h[u],
  51353. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51354. t.generateMipmaps = !1
  51355. } else
  51356. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51357. else if (t instanceof n.CompressedTexture)
  51358. for (var u = 0, d = h.length; u < d; u++)
  51359. c = h[u],
  51360. 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);
  51361. else if (h.length > 0 && o) {
  51362. for (var u = 0, d = h.length; u < d; u++)
  51363. c = h[u],
  51364. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51365. t.generateMipmaps = !1
  51366. } else
  51367. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51368. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51369. e.__version = t.version,
  51370. t.onUpdate && t.onUpdate(t)
  51371. }
  51372. function G(e, t) {
  51373. if (e.width > t || e.height > t) {
  51374. var i = t / Math.max(e.width, e.height)
  51375. , n = document.createElement("canvas");
  51376. n.width = Math.floor(e.width * i),
  51377. n.height = Math.floor(e.height * i);
  51378. var r = n.getContext("2d");
  51379. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51380. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51381. n
  51382. }
  51383. return e
  51384. }
  51385. function z(e) {
  51386. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51387. }
  51388. function W(e) {
  51389. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51390. }
  51391. function j(e) {
  51392. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51393. var t = document.createElement("canvas");
  51394. t.width = n.Math.nearestPowerOfTwo(e.width),
  51395. t.height = n.Math.nearestPowerOfTwo(e.height);
  51396. var i = t.getContext("2d");
  51397. return i.drawImage(e, 0, 0, t.width, t.height),
  51398. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51399. t
  51400. }
  51401. return e
  51402. }
  51403. function Y(e, t) {
  51404. var i = Xe.get(e);
  51405. if (6 === e.image.length)
  51406. if (e.version > 0 && i.__version !== e.version) {
  51407. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51408. i.__image__webglTextureCube = Ge.createTexture(),
  51409. ke.textures++),
  51410. Ye.activeTexture(Ge.TEXTURE0 + t),
  51411. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51412. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51413. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51414. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51415. var c = a[0]
  51416. , h = z(c)
  51417. , u = ee(e.format)
  51418. , d = ee(e.type);
  51419. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51420. for (var l = 0; l < 6; l++)
  51421. if (r)
  51422. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51423. p = f[g],
  51424. 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);
  51425. else
  51426. 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]);
  51427. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51428. i.__version = e.version,
  51429. e.onUpdate && e.onUpdate(e)
  51430. } else
  51431. Ye.activeTexture(Ge.TEXTURE0 + t),
  51432. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51433. }
  51434. function X(e, t) {
  51435. Ye.activeTexture(Ge.TEXTURE0 + t),
  51436. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51437. }
  51438. function Z(e, t, i, n) {
  51439. var r = ee(t.texture.format)
  51440. , o = ee(t.texture.type);
  51441. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51442. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51443. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51444. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51445. }
  51446. function q(e, t) {
  51447. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51448. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51449. 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),
  51450. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51451. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51452. }
  51453. function K(e) {
  51454. var t = Xe.get(e)
  51455. , i = e instanceof n.WebGLRenderTargetCube;
  51456. if (i) {
  51457. t.__webglDepthbuffer = [];
  51458. for (var r = 0; r < 6; r++)
  51459. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51460. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51461. q(t.__webglDepthbuffer[r], e)
  51462. } else
  51463. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51464. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51465. q(t.__webglDepthbuffer, e);
  51466. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51467. }
  51468. function Q(e) {
  51469. var t = Xe.get(e)
  51470. , i = Xe.get(e.texture);
  51471. e.addEventListener("dispose", l),
  51472. i.__webglTexture = Ge.createTexture(),
  51473. ke.textures++;
  51474. var r = e instanceof n.WebGLRenderTargetCube
  51475. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51476. if (r) {
  51477. t.__webglFramebuffer = [];
  51478. for (var a = 0; a < 6; a++)
  51479. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51480. } else
  51481. t.__webglFramebuffer = Ge.createFramebuffer();
  51482. if (r) {
  51483. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51484. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51485. for (var a = 0; a < 6; a++)
  51486. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51487. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51488. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51489. } else
  51490. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51491. k(Ge.TEXTURE_2D, e.texture, o),
  51492. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51493. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51494. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51495. e.depthBuffer && K(e)
  51496. }
  51497. function J(e) {
  51498. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51499. , i = Xe.get(e.texture).__webglTexture;
  51500. Ye.bindTexture(t, i),
  51501. Ge.generateMipmap(t),
  51502. Ye.bindTexture(t, null)
  51503. }
  51504. function $(e) {
  51505. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51506. }
  51507. function ee(e) {
  51508. var t;
  51509. if (e === n.RepeatWrapping)
  51510. return Ge.REPEAT;
  51511. if (e === n.ClampToEdgeWrapping)
  51512. return Ge.CLAMP_TO_EDGE;
  51513. if (e === n.MirroredRepeatWrapping)
  51514. return Ge.MIRRORED_REPEAT;
  51515. if (e === n.NearestFilter)
  51516. return Ge.NEAREST;
  51517. if (e === n.NearestMipMapNearestFilter)
  51518. return Ge.NEAREST_MIPMAP_NEAREST;
  51519. if (e === n.NearestMipMapLinearFilter)
  51520. return Ge.NEAREST_MIPMAP_LINEAR;
  51521. if (e === n.LinearFilter)
  51522. return Ge.LINEAR;
  51523. if (e === n.LinearMipMapNearestFilter)
  51524. return Ge.LINEAR_MIPMAP_NEAREST;
  51525. if (e === n.LinearMipMapLinearFilter)
  51526. return Ge.LINEAR_MIPMAP_LINEAR;
  51527. if (e === n.UnsignedByteType)
  51528. return Ge.UNSIGNED_BYTE;
  51529. if (e === n.UnsignedShort4444Type)
  51530. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51531. if (e === n.UnsignedShort5551Type)
  51532. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51533. if (e === n.UnsignedShort565Type)
  51534. return Ge.UNSIGNED_SHORT_5_6_5;
  51535. if (e === n.ByteType)
  51536. return Ge.BYTE;
  51537. if (e === n.ShortType)
  51538. return Ge.SHORT;
  51539. if (e === n.UnsignedShortType)
  51540. return Ge.UNSIGNED_SHORT;
  51541. if (e === n.IntType)
  51542. return Ge.INT;
  51543. if (e === n.UnsignedIntType)
  51544. return Ge.UNSIGNED_INT;
  51545. if (e === n.FloatType)
  51546. return Ge.FLOAT;
  51547. if (t = We.get("OES_texture_half_float"),
  51548. null !== t && e === n.HalfFloatType)
  51549. return t.HALF_FLOAT_OES;
  51550. if (e === n.AlphaFormat)
  51551. return Ge.ALPHA;
  51552. if (e === n.RGBFormat)
  51553. return Ge.RGB;
  51554. if (e === n.RGBAFormat)
  51555. return Ge.RGBA;
  51556. if (e === n.LuminanceFormat)
  51557. return Ge.LUMINANCE;
  51558. if (e === n.LuminanceAlphaFormat)
  51559. return Ge.LUMINANCE_ALPHA;
  51560. if (e === n.AddEquation)
  51561. return Ge.FUNC_ADD;
  51562. if (e === n.SubtractEquation)
  51563. return Ge.FUNC_SUBTRACT;
  51564. if (e === n.ReverseSubtractEquation)
  51565. return Ge.FUNC_REVERSE_SUBTRACT;
  51566. if (e === n.ZeroFactor)
  51567. return Ge.ZERO;
  51568. if (e === n.OneFactor)
  51569. return Ge.ONE;
  51570. if (e === n.SrcColorFactor)
  51571. return Ge.SRC_COLOR;
  51572. if (e === n.OneMinusSrcColorFactor)
  51573. return Ge.ONE_MINUS_SRC_COLOR;
  51574. if (e === n.SrcAlphaFactor)
  51575. return Ge.SRC_ALPHA;
  51576. if (e === n.OneMinusSrcAlphaFactor)
  51577. return Ge.ONE_MINUS_SRC_ALPHA;
  51578. if (e === n.DstAlphaFactor)
  51579. return Ge.DST_ALPHA;
  51580. if (e === n.OneMinusDstAlphaFactor)
  51581. return Ge.ONE_MINUS_DST_ALPHA;
  51582. if (e === n.DstColorFactor)
  51583. return Ge.DST_COLOR;
  51584. if (e === n.OneMinusDstColorFactor)
  51585. return Ge.ONE_MINUS_DST_COLOR;
  51586. if (e === n.SrcAlphaSaturateFactor)
  51587. return Ge.SRC_ALPHA_SATURATE;
  51588. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51589. null !== t) {
  51590. if (e === n.RGB_S3TC_DXT1_Format)
  51591. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51592. if (e === n.RGBA_S3TC_DXT1_Format)
  51593. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51594. if (e === n.RGBA_S3TC_DXT3_Format)
  51595. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51596. if (e === n.RGBA_S3TC_DXT5_Format)
  51597. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51598. }
  51599. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51600. null !== t) {
  51601. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51602. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51603. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51604. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51605. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51606. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51607. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51608. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51609. }
  51610. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51611. null !== t && e === n.RGB_ETC1_Format)
  51612. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51613. if (t = We.get("EXT_blend_minmax"),
  51614. null !== t) {
  51615. if (e === n.MinEquation)
  51616. return t.MIN_EXT;
  51617. if (e === n.MaxEquation)
  51618. return t.MAX_EXT
  51619. }
  51620. return 0
  51621. }
  51622. console.log("THREE.WebGLRenderer", n.REVISION),
  51623. e = e || {};
  51624. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51625. , ie = void 0 !== e.context ? e.context : null
  51626. , ne = void 0 !== e.alpha && e.alpha
  51627. , re = void 0 === e.depth || e.depth
  51628. , oe = void 0 === e.stencil || e.stencil
  51629. , ae = void 0 !== e.antialias && e.antialias
  51630. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51631. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51632. , ce = []
  51633. , he = []
  51634. , ue = -1
  51635. , de = []
  51636. , pe = -1
  51637. , fe = new Float32Array(8)
  51638. , ge = []
  51639. , me = [];
  51640. this.domElement = te,
  51641. this.context = null,
  51642. this.autoClear = !0,
  51643. this.autoClearColor = !0,
  51644. this.autoClearDepth = !0,
  51645. this.autoClearStencil = !0,
  51646. this.sortObjects = !0,
  51647. this.gammaFactor = 2,
  51648. this.gammaInput = !1,
  51649. this.gammaOutput = !1,
  51650. this.physicallyCorrectLights = !1,
  51651. this.toneMapping = n.LinearToneMapping,
  51652. this.toneMappingExposure = 1,
  51653. this.toneMappingWhitePoint = 1,
  51654. this.maxMorphTargets = 8,
  51655. this.maxMorphNormals = 4,
  51656. this.autoScaleCubemaps = !0;
  51657. var ve = this
  51658. , Ae = null
  51659. , ye = null
  51660. , Ce = null
  51661. , Ie = -1
  51662. , Ee = ""
  51663. , be = null
  51664. , we = new n.Vector4
  51665. , _e = null
  51666. , Te = new n.Vector4
  51667. , xe = 0
  51668. , Se = new n.Color(0)
  51669. , Me = 0
  51670. , Re = te.width
  51671. , Pe = te.height
  51672. , Oe = 1
  51673. , Le = new n.Vector4(0,0,Re,Pe)
  51674. , De = !1
  51675. , Ne = new n.Vector4(0,0,Re,Pe)
  51676. , Be = new n.Frustum
  51677. , Fe = new n.Matrix4
  51678. , Ve = new n.Vector3
  51679. , Ue = {
  51680. hash: "",
  51681. ambient: [0, 0, 0],
  51682. directional: [],
  51683. directionalShadowMap: [],
  51684. directionalShadowMatrix: [],
  51685. spot: [],
  51686. spotShadowMap: [],
  51687. spotShadowMatrix: [],
  51688. point: [],
  51689. pointShadowMap: [],
  51690. pointShadowMatrix: [],
  51691. hemi: [],
  51692. shadows: [],
  51693. shadowsPointLight: 0
  51694. }
  51695. , ke = {
  51696. geometries: 0,
  51697. textures: 0
  51698. }
  51699. , He = {
  51700. calls: 0,
  51701. vertices: 0,
  51702. faces: 0,
  51703. points: 0
  51704. };
  51705. this.info = {
  51706. render: He,
  51707. memory: ke,
  51708. programs: null
  51709. };
  51710. var Ge;
  51711. try {
  51712. var ze = {
  51713. alpha: ne,
  51714. depth: re,
  51715. stencil: oe,
  51716. antialias: ae,
  51717. premultipliedAlpha: se,
  51718. preserveDrawingBuffer: le
  51719. };
  51720. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51721. null === Ge)
  51722. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51723. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51724. return {
  51725. rangeMin: 1,
  51726. rangeMax: 1,
  51727. precision: 1
  51728. }
  51729. }
  51730. ),
  51731. te.addEventListener("webglcontextlost", a, !1)
  51732. } catch (e) {
  51733. console.error("THREE.WebGLRenderer: " + e)
  51734. }
  51735. var We = new n.WebGLExtensions(Ge);
  51736. We.get("OES_texture_float"),
  51737. We.get("OES_texture_float_linear"),
  51738. We.get("OES_texture_half_float"),
  51739. We.get("OES_texture_half_float_linear"),
  51740. We.get("OES_standard_derivatives"),
  51741. We.get("ANGLE_instanced_arrays"),
  51742. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51743. var je = new n.WebGLCapabilities(Ge,We,e)
  51744. , Ye = new n.WebGLState(Ge,We,ee)
  51745. , Xe = new n.WebGLProperties
  51746. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51747. , qe = new n.WebGLPrograms(this,je)
  51748. , Ke = new n.WebGLLights;
  51749. this.info.programs = qe.programs;
  51750. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51751. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51752. r(),
  51753. this.context = Ge,
  51754. this.capabilities = je,
  51755. this.extensions = We,
  51756. this.properties = Xe,
  51757. this.state = Ye;
  51758. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51759. this.shadowMap = $e;
  51760. var et = new n.SpritePlugin(this,ge)
  51761. , tt = new n.LensFlarePlugin(this,me);
  51762. this.getContext = function() {
  51763. return Ge
  51764. }
  51765. ,
  51766. this.getContextAttributes = function() {
  51767. return Ge.getContextAttributes()
  51768. }
  51769. ,
  51770. this.forceContextLoss = function() {
  51771. We.get("WEBGL_lose_context").loseContext()
  51772. }
  51773. ,
  51774. this.getMaxAnisotropy = function() {
  51775. var e;
  51776. return function() {
  51777. if (void 0 !== e)
  51778. return e;
  51779. var t = We.get("EXT_texture_filter_anisotropic");
  51780. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  51781. }
  51782. }(),
  51783. this.getPrecision = function() {
  51784. return je.precision
  51785. }
  51786. ,
  51787. this.getPixelRatio = function() {
  51788. return Oe
  51789. }
  51790. ,
  51791. this.setPixelRatio = function(e) {
  51792. void 0 !== e && (Oe = e,
  51793. this.setSize(Ne.z, Ne.w, !1))
  51794. }
  51795. ,
  51796. this.getSize = function() {
  51797. return {
  51798. width: Re,
  51799. height: Pe
  51800. }
  51801. }
  51802. ,
  51803. this.setSize = function(e, t, i, devicePixelRatio) {
  51804. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  51805. Re = e,
  51806. Pe = t,
  51807. te.width = e * Oe,
  51808. te.height = t * Oe,
  51809. i !== !1 && (te.style.width = e + "px",
  51810. te.style.height = t + "px"),
  51811. this.setViewport(0, 0, e, t)
  51812. }
  51813. ,
  51814. this.setViewport = function(e, t, i, n) {
  51815. Ye.viewport(Ne.set(e, t, i, n))
  51816. }
  51817. ,
  51818. this.setScissor = function(e, t, i, n) {
  51819. Ye.scissor(Le.set(e, t, i, n))
  51820. }
  51821. ,
  51822. this.setScissorTest = function(e) {
  51823. Ye.setScissorTest(De = e)
  51824. }
  51825. ,
  51826. this.getClearColor = function() {
  51827. return Se
  51828. }
  51829. ,
  51830. this.setClearColor = function(e, t) {
  51831. Se.set(e),
  51832. Me = void 0 !== t ? t : 1,
  51833. i(Se.r, Se.g, Se.b, Me)
  51834. }
  51835. ,
  51836. this.getClearAlpha = function() {
  51837. return Me
  51838. }
  51839. ,
  51840. this.setClearAlpha = function(e) {
  51841. Me = e,
  51842. i(Se.r, Se.g, Se.b, Me)
  51843. }
  51844. ,
  51845. this.clear = function(e, t, i) {
  51846. var n = 0;
  51847. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  51848. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  51849. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  51850. Ge.clear(n)
  51851. }
  51852. ,
  51853. this.clearColor = function() {
  51854. this.clear(!0, !1, !1)
  51855. }
  51856. ,
  51857. this.clearDepth = function() {
  51858. this.clear(!1, !0, !1)
  51859. }
  51860. ,
  51861. this.clearStencil = function() {
  51862. this.clear(!1, !1, !0)
  51863. }
  51864. ,
  51865. this.clearTarget = function(e, t, i, n) {
  51866. this.setRenderTarget(e),
  51867. this.clear(t, i, n)
  51868. }
  51869. ,
  51870. this.resetGLState = o,
  51871. this.dispose = function() {
  51872. te.removeEventListener("webglcontextlost", a, !1)
  51873. }
  51874. ,
  51875. this.renderBufferImmediate = function(e, t, i) {
  51876. Ye.initAttributes();
  51877. var r = Xe.get(e);
  51878. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  51879. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  51880. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  51881. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  51882. var o = t.getAttributes();
  51883. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  51884. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  51885. Ye.enableAttribute(o.position),
  51886. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  51887. e.hasNormals) {
  51888. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  51889. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  51890. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  51891. var l = e.normalArray
  51892. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  51893. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  51894. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  51895. l[a + 0] = c,
  51896. l[a + 1] = h,
  51897. l[a + 2] = u,
  51898. l[a + 3] = c,
  51899. l[a + 4] = h,
  51900. l[a + 5] = u,
  51901. l[a + 6] = c,
  51902. l[a + 7] = h,
  51903. l[a + 8] = u
  51904. }
  51905. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  51906. Ye.enableAttribute(o.normal),
  51907. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  51908. }
  51909. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  51910. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  51911. Ye.enableAttribute(o.uv),
  51912. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  51913. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  51914. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  51915. Ye.enableAttribute(o.color),
  51916. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  51917. Ye.disableUnusedAttributes(),
  51918. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  51919. e.count = 0
  51920. }
  51921. ,
  51922. this.renderBufferDirect = function(e, i, r, o, a, s) {
  51923. E(o);
  51924. var l = w(e, i, o, a)
  51925. , c = !1
  51926. , h = r.id + "_" + l.id + "_" + o.wireframe;
  51927. h !== Ee && (Ee = h,
  51928. c = !0);
  51929. var u = a.morphTargetInfluences;
  51930. if (void 0 !== u) {
  51931. for (var d = [], p = 0, m = u.length; p < m; p++) {
  51932. var v = u[p];
  51933. d.push([v, p])
  51934. }
  51935. d.sort(g),
  51936. d.length > 8 && (d.length = 8);
  51937. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  51938. var v = d[p];
  51939. if (fe[p] = v[0],
  51940. 0 !== v[0]) {
  51941. var y = v[1];
  51942. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  51943. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  51944. } else
  51945. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  51946. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  51947. }
  51948. var C = l.getUniforms();
  51949. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  51950. c = !0
  51951. }
  51952. var y = r.index
  51953. , I = r.attributes.position;
  51954. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  51955. var b;
  51956. null !== y ? (b = Je,
  51957. b.setIndex(y)) : b = Qe,
  51958. c && (f(o, l, r),
  51959. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  51960. var _ = 0
  51961. , T = 1 / 0;
  51962. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  51963. var x = r.drawRange.start
  51964. , S = r.drawRange.count
  51965. , M = null !== s ? s.start : 0
  51966. , R = null !== s ? s.count : 1 / 0
  51967. , P = Math.max(_, x, M)
  51968. , O = Math.min(_ + T, x + S, M + R) - 1
  51969. , L = Math.max(0, O - P + 1);
  51970. if (a instanceof n.Mesh)
  51971. if (o.wireframe === !0)
  51972. Ye.setLineWidth(o.wireframeLinewidth * t()),
  51973. b.setMode(Ge.LINES);
  51974. else
  51975. switch (a.drawMode) {
  51976. case n.TrianglesDrawMode:
  51977. b.setMode(Ge.TRIANGLES);
  51978. break;
  51979. case n.TriangleStripDrawMode:
  51980. b.setMode(Ge.TRIANGLE_STRIP);
  51981. break;
  51982. case n.TriangleFanDrawMode:
  51983. b.setMode(Ge.TRIANGLE_FAN)
  51984. }
  51985. else if (a instanceof n.Line) {
  51986. var D = o.linewidth;
  51987. void 0 === D && (D = 1),
  51988. Ye.setLineWidth(D * t()),
  51989. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  51990. } else
  51991. a instanceof n.Points && b.setMode(Ge.POINTS);
  51992. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  51993. }
  51994. ,
  51995. this.render = function(e, t, i, r) {
  51996. if (t instanceof n.Camera == !1)
  51997. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  51998. var o = e.fog;
  51999. if (Ee = "",
  52000. Ie = -1,
  52001. be = null,
  52002. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52003. null === t.parent && t.updateMatrixWorld(),
  52004. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52005. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52006. Be.setFromMatrix(Fe),
  52007. ce.length = 0,
  52008. ue = -1,
  52009. pe = -1,
  52010. ge.length = 0,
  52011. me.length = 0,
  52012. y(e, t),
  52013. he.length = ue + 1,
  52014. de.length = pe + 1,
  52015. ve.sortObjects === !0 && (he.sort(m),
  52016. de.sort(v)),
  52017. U(ce, t),
  52018. $e.render(e, t),
  52019. He.calls = 0,
  52020. He.vertices = 0,
  52021. He.faces = 0,
  52022. He.points = 0,
  52023. void 0 === i && (i = null),
  52024. this.setRenderTarget(i),
  52025. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52026. e.overrideMaterial) {
  52027. var a = e.overrideMaterial;
  52028. C(he, t, o, a),
  52029. C(de, t, o, a)
  52030. } else
  52031. Ye.setBlending(n.NoBlending),
  52032. C(he, t, o),
  52033. C(de, t, o);
  52034. if (et.render(e, t),
  52035. tt.render(e, t, Te),
  52036. i) {
  52037. var s = i.texture;
  52038. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52039. }
  52040. Ye.setDepthTest(!0),
  52041. Ye.setDepthWrite(!0),
  52042. Ye.setColorWrite(!0)
  52043. }
  52044. ,
  52045. this.setFaceCulling = function(e, t) {
  52046. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52047. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52048. Ye.enable(Ge.CULL_FACE))
  52049. }
  52050. ,
  52051. this.setTexture = function(e, t) {
  52052. var i = Xe.get(e);
  52053. if (e.version > 0 && i.__version !== e.version) {
  52054. var n = e.image;
  52055. 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)
  52056. }
  52057. Ye.activeTexture(Ge.TEXTURE0 + t),
  52058. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52059. }
  52060. ,
  52061. this.getCurrentRenderTarget = function() {
  52062. return ye
  52063. }
  52064. ,
  52065. this.setRenderTarget = function(e) {
  52066. ye = e,
  52067. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52068. var t, i = e instanceof n.WebGLRenderTargetCube;
  52069. if (e) {
  52070. var r = Xe.get(e);
  52071. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52072. we.copy(e.scissor),
  52073. _e = e.scissorTest,
  52074. Te.copy(e.viewport)
  52075. } else
  52076. t = null,
  52077. we.copy(Le).multiplyScalar(Oe),
  52078. _e = De,
  52079. Te.copy(Ne).multiplyScalar(Oe);
  52080. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52081. Ce = t),
  52082. Ye.scissor(we),
  52083. Ye.setScissorTest(_e),
  52084. Ye.viewport(Te),
  52085. i) {
  52086. var o = Xe.get(e.texture);
  52087. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52088. }
  52089. }
  52090. ,
  52091. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52092. if (e instanceof n.WebGLRenderTarget == !1)
  52093. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52094. var s = Xe.get(e).__webglFramebuffer;
  52095. if (s) {
  52096. var l = !1;
  52097. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52098. l = !0);
  52099. try {
  52100. var c = e.texture;
  52101. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52102. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52103. 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")))
  52104. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52105. 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.")
  52106. } finally {
  52107. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52108. }
  52109. }
  52110. }
  52111. }
  52112. ,
  52113. n.WebGLRenderTarget = function(e, t, i) {
  52114. this.uuid = n.Math.generateUUID(),
  52115. this.width = e,
  52116. this.height = t,
  52117. this.scissor = new n.Vector4(0,0,e,t),
  52118. this.scissorTest = !1,
  52119. this.viewport = new n.Vector4(0,0,e,t),
  52120. i = i || {},
  52121. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52122. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52123. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52124. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52125. }
  52126. ,
  52127. n.WebGLRenderTarget.prototype = {
  52128. constructor: n.WebGLRenderTarget,
  52129. setSize: function(e, t) {
  52130. this.width === e && this.height === t || (this.width = e,
  52131. this.height = t,
  52132. this.dispose()),
  52133. this.viewport.set(0, 0, e, t),
  52134. this.scissor.set(0, 0, e, t)
  52135. },
  52136. clone: function() {
  52137. return (new this.constructor).copy(this)
  52138. },
  52139. copy: function(e) {
  52140. return this.width = e.width,
  52141. this.height = e.height,
  52142. this.viewport.copy(e.viewport),
  52143. this.texture = e.texture.clone(),
  52144. this.depthBuffer = e.depthBuffer,
  52145. this.stencilBuffer = e.stencilBuffer,
  52146. this
  52147. },
  52148. dispose: function() {
  52149. this.dispatchEvent({
  52150. type: "dispose"
  52151. })
  52152. }
  52153. },
  52154. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52155. n.WebGLRenderTargetCube = function(e, t, i) {
  52156. n.WebGLRenderTarget.call(this, e, t, i),
  52157. this.activeCubeFace = 0,
  52158. this.activeMipMapLevel = 0
  52159. }
  52160. ,
  52161. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52162. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52163. n.WebGLBufferRenderer = function(e, t, i) {
  52164. function r(e) {
  52165. s = e
  52166. }
  52167. function o(t, n) {
  52168. e.drawArrays(s, t, n),
  52169. i.calls++,
  52170. i.vertices += n,
  52171. s === e.TRIANGLES && (i.faces += n / 3)
  52172. }
  52173. function a(r) {
  52174. var o = t.get("ANGLE_instanced_arrays");
  52175. if (null === o)
  52176. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52177. var a = r.attributes.position
  52178. , l = 0;
  52179. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52180. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52181. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52182. i.calls++,
  52183. i.vertices += l * r.maxInstancedCount,
  52184. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52185. }
  52186. var s;
  52187. this.setMode = r,
  52188. this.render = o,
  52189. this.renderInstances = a
  52190. }
  52191. ,
  52192. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52193. function n(e) {
  52194. s = e
  52195. }
  52196. function r(i) {
  52197. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52198. c = 4) : (l = e.UNSIGNED_SHORT,
  52199. c = 2)
  52200. }
  52201. function o(t, n) {
  52202. e.drawElements(s, n, l, t * c),
  52203. i.calls++,
  52204. i.vertices += n,
  52205. s === e.TRIANGLES && (i.faces += n / 3)
  52206. }
  52207. function a(n, r, o) {
  52208. var a = t.get("ANGLE_instanced_arrays");
  52209. 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),
  52210. i.calls++,
  52211. i.vertices += o * n.maxInstancedCount,
  52212. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52213. }
  52214. var s, l, c;
  52215. this.setMode = n,
  52216. this.setIndex = r,
  52217. this.render = o,
  52218. this.renderInstances = a
  52219. }
  52220. ,
  52221. n.WebGLExtensions = function(e) {
  52222. var t = {};
  52223. this.get = function(i) {
  52224. if (void 0 !== t[i])
  52225. return t[i];
  52226. var n;
  52227. switch (i) {
  52228. case "EXT_texture_filter_anisotropic":
  52229. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52230. break;
  52231. case "WEBGL_compressed_texture_s3tc":
  52232. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52233. break;
  52234. case "WEBGL_compressed_texture_pvrtc":
  52235. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52236. break;
  52237. case "WEBGL_compressed_texture_etc1":
  52238. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52239. break;
  52240. default:
  52241. n = e.getExtension(i)
  52242. }
  52243. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52244. t[i] = n,
  52245. n
  52246. }
  52247. }
  52248. ,
  52249. n.WebGLCapabilities = function(e, t, i) {
  52250. function n(t) {
  52251. if ("highp" === t) {
  52252. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52253. return "highp";
  52254. t = "mediump"
  52255. }
  52256. 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"
  52257. }
  52258. this.getMaxPrecision = n,
  52259. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52260. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52261. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52262. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52263. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52264. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52265. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52266. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52267. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52268. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52269. this.vertexTextures = this.maxVertexTextures > 0,
  52270. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52271. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52272. var r = n(this.precision);
  52273. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52274. this.precision = r),
  52275. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52276. }
  52277. ,
  52278. n.WebGLGeometries = function(e, t, i) {
  52279. function r(e) {
  52280. var t = e.geometry;
  52281. if (void 0 !== h[t.id])
  52282. return h[t.id];
  52283. t.addEventListener("dispose", o);
  52284. var r;
  52285. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52286. r = t._bufferGeometry),
  52287. h[t.id] = r,
  52288. i.memory.geometries++,
  52289. r
  52290. }
  52291. function o(e) {
  52292. var n = e.target
  52293. , r = h[n.id];
  52294. null !== r.index && s(r.index),
  52295. l(r.attributes),
  52296. n.removeEventListener("dispose", o),
  52297. delete h[n.id];
  52298. var a = t.get(n);
  52299. a.wireframe && s(a.wireframe),
  52300. t.delete(n);
  52301. var c = t.get(r);
  52302. c.wireframe && s(c.wireframe),
  52303. t.delete(r),
  52304. i.memory.geometries--
  52305. }
  52306. function a(e) {
  52307. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52308. }
  52309. function s(t) {
  52310. var i = a(t);
  52311. void 0 !== i && (e.deleteBuffer(i),
  52312. c(t))
  52313. }
  52314. function l(e) {
  52315. for (var t in e)
  52316. s(e[t])
  52317. }
  52318. function c(e) {
  52319. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52320. }
  52321. var h = {};
  52322. this.get = r
  52323. }
  52324. ,
  52325. n.WebGLLights = function() {
  52326. var e = {};
  52327. this.get = function(t) {
  52328. if (void 0 !== e[t.id])
  52329. return e[t.id];
  52330. var i;
  52331. switch (t.type) {
  52332. case "DirectionalLight":
  52333. i = {
  52334. direction: new n.Vector3,
  52335. color: new n.Color,
  52336. shadow: !1,
  52337. shadowBias: 0,
  52338. shadowRadius: 1,
  52339. shadowMapSize: new n.Vector2
  52340. };
  52341. break;
  52342. case "SpotLight":
  52343. i = {
  52344. position: new n.Vector3,
  52345. direction: new n.Vector3,
  52346. color: new n.Color,
  52347. distance: 0,
  52348. coneCos: 0,
  52349. penumbraCos: 0,
  52350. decay: 0,
  52351. shadow: !1,
  52352. shadowBias: 0,
  52353. shadowRadius: 1,
  52354. shadowMapSize: new n.Vector2
  52355. };
  52356. break;
  52357. case "PointLight":
  52358. i = {
  52359. position: new n.Vector3,
  52360. color: new n.Color,
  52361. distance: 0,
  52362. decay: 0,
  52363. shadow: !1,
  52364. shadowBias: 0,
  52365. shadowRadius: 1,
  52366. shadowMapSize: new n.Vector2
  52367. };
  52368. break;
  52369. case "HemisphereLight":
  52370. i = {
  52371. direction: new n.Vector3,
  52372. skyColor: new n.Color,
  52373. groundColor: new n.Color
  52374. }
  52375. }
  52376. return e[t.id] = i,
  52377. i
  52378. }
  52379. }
  52380. ,
  52381. n.WebGLObjects = function(e, t, i) {
  52382. function r(t) {
  52383. var i = u.get(t);
  52384. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52385. var r = i.index
  52386. , a = i.attributes;
  52387. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52388. for (var s in a)
  52389. o(a[s], e.ARRAY_BUFFER);
  52390. var l = i.morphAttributes;
  52391. for (var s in l)
  52392. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52393. o(c[h], e.ARRAY_BUFFER);
  52394. return i
  52395. }
  52396. function o(e, i) {
  52397. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52398. , o = t.get(r);
  52399. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52400. }
  52401. function a(t, i, n) {
  52402. t.__webglBuffer = e.createBuffer(),
  52403. e.bindBuffer(n, t.__webglBuffer);
  52404. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52405. e.bufferData(n, i.array, r),
  52406. t.version = i.version
  52407. }
  52408. function s(t, i, n) {
  52409. e.bindBuffer(n, t.__webglBuffer),
  52410. 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)),
  52411. i.updateRange.count = 0),
  52412. t.version = i.version
  52413. }
  52414. function l(e) {
  52415. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52416. }
  52417. function c(i) {
  52418. var r = t.get(i);
  52419. if (void 0 !== r.wireframe)
  52420. return r.wireframe;
  52421. var a = []
  52422. , s = i.index
  52423. , l = i.attributes
  52424. , c = l.position;
  52425. if (null !== s)
  52426. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52427. var g = d[p + 0]
  52428. , m = d[p + 1]
  52429. , v = d[p + 2];
  52430. h(u, g, m) && a.push(g, m),
  52431. h(u, m, v) && a.push(m, v),
  52432. h(u, v, g) && a.push(v, g)
  52433. }
  52434. else
  52435. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52436. var g = p + 0
  52437. , m = p + 1
  52438. , v = p + 2;
  52439. a.push(g, m, m, v, v, g)
  52440. }
  52441. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52442. , y = new n.BufferAttribute(new A(a),1);
  52443. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52444. r.wireframe = y,
  52445. y
  52446. }
  52447. function h(e, t, i) {
  52448. if (t > i) {
  52449. var n = t;
  52450. t = i,
  52451. i = n
  52452. }
  52453. var r = e[t];
  52454. return void 0 === r ? (e[t] = [i],
  52455. !0) : r.indexOf(i) === -1 && (r.push(i),
  52456. !0)
  52457. }
  52458. var u = new n.WebGLGeometries(e,t,i);
  52459. this.getAttributeBuffer = l,
  52460. this.getWireframeAttribute = c,
  52461. this.update = r
  52462. }
  52463. ,
  52464. n.WebGLProgram = function() {
  52465. function e(e) {
  52466. switch (e) {
  52467. case n.LinearEncoding:
  52468. return ["Linear", "( value )"];
  52469. case n.sRGBEncoding:
  52470. return ["sRGB", "( value )"];
  52471. case n.RGBEEncoding:
  52472. return ["RGBE", "( value )"];
  52473. case n.RGBM7Encoding:
  52474. return ["RGBM", "( value, 7.0 )"];
  52475. case n.RGBM16Encoding:
  52476. return ["RGBM", "( value, 16.0 )"];
  52477. case n.RGBDEncoding:
  52478. return ["RGBD", "( value, 256.0 )"];
  52479. case n.GammaEncoding:
  52480. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52481. default:
  52482. throw new Error("unsupported encoding: " + e)
  52483. }
  52484. }
  52485. function t(t, i) {
  52486. var n = e(i);
  52487. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52488. }
  52489. function i(t, i) {
  52490. var n = e(i);
  52491. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52492. }
  52493. function r(e, t) {
  52494. var i;
  52495. switch (t) {
  52496. case n.LinearToneMapping:
  52497. i = "Linear";
  52498. break;
  52499. case n.ReinhardToneMapping:
  52500. i = "Reinhard";
  52501. break;
  52502. case n.Uncharted2ToneMapping:
  52503. i = "Uncharted2";
  52504. break;
  52505. case n.CineonToneMapping:
  52506. i = "OptimizedCineon";
  52507. break;
  52508. default:
  52509. throw new Error("unsupported toneMapping: " + t)
  52510. }
  52511. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52512. }
  52513. function o(e, t, i) {
  52514. e = e || {};
  52515. 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" : ""];
  52516. return n.filter(c).join("\n")
  52517. }
  52518. function a(e) {
  52519. var t = [];
  52520. for (var i in e) {
  52521. var n = e[i];
  52522. n !== !1 && t.push("#define " + i + " " + n)
  52523. }
  52524. return t.join("\n")
  52525. }
  52526. function s(e, t, i) {
  52527. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52528. var a = e.getActiveUniform(t, o)
  52529. , s = a.name
  52530. , l = e.getUniformLocation(t, s)
  52531. , c = f.exec(s);
  52532. if (c) {
  52533. var h = c[1]
  52534. , u = c[2]
  52535. , d = n[h];
  52536. d || (d = n[h] = {}),
  52537. d[u] = l
  52538. } else if (c = g.exec(s)) {
  52539. var p = c[1]
  52540. , v = c[2]
  52541. , A = c[3]
  52542. , y = n[p];
  52543. y || (y = n[p] = []);
  52544. var C = y[v];
  52545. C || (C = y[v] = {}),
  52546. C[A] = l
  52547. } else if (c = m.exec(s)) {
  52548. var p = c[1];
  52549. n[p] = l
  52550. } else
  52551. n[s] = l
  52552. }
  52553. return n
  52554. }
  52555. function l(e, t, i) {
  52556. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52557. var a = e.getActiveAttrib(t, o)
  52558. , s = a.name;
  52559. n[s] = e.getAttribLocation(t, s)
  52560. }
  52561. return n
  52562. }
  52563. function c(e) {
  52564. return "" !== e
  52565. }
  52566. function h(e, t) {
  52567. 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)
  52568. }
  52569. function u(e) {
  52570. function t(e, t) {
  52571. var i = n.ShaderChunk[t];
  52572. if (void 0 === i)
  52573. throw new Error("Can not resolve #include <" + t + ">");
  52574. return u(i)
  52575. }
  52576. var i = /#include +<([\w\d.]+)>/g;
  52577. return e.replace(i, t)
  52578. }
  52579. function d(e) {
  52580. function t(e, t, i, n) {
  52581. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52582. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52583. return r
  52584. }
  52585. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52586. return e.replace(i, t)
  52587. }
  52588. var p = 0
  52589. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52590. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52591. , m = /^([\w\d_]+)\[0\]$/;
  52592. return function(e, f, g, m) {
  52593. var v = e.context
  52594. , A = g.extensions
  52595. , y = g.defines
  52596. , C = g.__webglShader.vertexShader
  52597. , I = g.__webglShader.fragmentShader
  52598. , E = "SHADOWMAP_TYPE_BASIC";
  52599. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52600. var b = "ENVMAP_TYPE_CUBE"
  52601. , w = "ENVMAP_MODE_REFLECTION"
  52602. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52603. if (m.envMap) {
  52604. switch (g.envMap.mapping) {
  52605. case n.CubeReflectionMapping:
  52606. case n.CubeRefractionMapping:
  52607. b = "ENVMAP_TYPE_CUBE";
  52608. break;
  52609. case n.CubeUVReflectionMapping:
  52610. case n.CubeUVRefractionMapping:
  52611. b = "ENVMAP_TYPE_CUBE_UV";
  52612. break;
  52613. case n.EquirectangularReflectionMapping:
  52614. case n.EquirectangularRefractionMapping:
  52615. b = "ENVMAP_TYPE_EQUIREC";
  52616. break;
  52617. case n.SphericalReflectionMapping:
  52618. b = "ENVMAP_TYPE_SPHERE"
  52619. }
  52620. switch (g.envMap.mapping) {
  52621. case n.CubeRefractionMapping:
  52622. case n.EquirectangularRefractionMapping:
  52623. w = "ENVMAP_MODE_REFRACTION"
  52624. }
  52625. switch (g.combine) {
  52626. case n.MultiplyOperation:
  52627. _ = "ENVMAP_BLENDING_MULTIPLY";
  52628. break;
  52629. case n.MixOperation:
  52630. _ = "ENVMAP_BLENDING_MIX";
  52631. break;
  52632. case n.AddOperation:
  52633. _ = "ENVMAP_BLENDING_ADD"
  52634. }
  52635. }
  52636. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52637. g instanceof n.RawShaderMaterial ? (T = "",
  52638. 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"),
  52639. 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")),
  52640. C = u(C, m),
  52641. C = h(C, m),
  52642. I = u(I, m),
  52643. I = h(I, m),
  52644. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52645. I = d(I));
  52646. var O = T + C
  52647. , L = x + I
  52648. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52649. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52650. v.attachShader(P, D),
  52651. v.attachShader(P, N),
  52652. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52653. v.linkProgram(P);
  52654. var B = v.getProgramInfoLog(P)
  52655. , F = v.getShaderInfoLog(D)
  52656. , V = v.getShaderInfoLog(N)
  52657. , U = !0
  52658. , k = !0;
  52659. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52660. 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),
  52661. k && (this.diagnostics = {
  52662. runnable: U,
  52663. material: g,
  52664. programLog: B,
  52665. vertexShader: {
  52666. log: F,
  52667. prefix: T
  52668. },
  52669. fragmentShader: {
  52670. log: V,
  52671. prefix: x
  52672. }
  52673. }),
  52674. v.deleteShader(D),
  52675. v.deleteShader(N);
  52676. var H;
  52677. this.getUniforms = function() {
  52678. return void 0 === H && (H = s(v, P)),
  52679. H
  52680. }
  52681. ;
  52682. var G;
  52683. return this.getAttributes = function() {
  52684. return void 0 === G && (G = l(v, P)),
  52685. G
  52686. }
  52687. ,
  52688. this.destroy = function() {
  52689. v.deleteProgram(P),
  52690. this.program = void 0
  52691. }
  52692. ,
  52693. Object.defineProperties(this, {
  52694. uniforms: {
  52695. get: function() {
  52696. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52697. this.getUniforms()
  52698. }
  52699. },
  52700. attributes: {
  52701. get: function() {
  52702. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52703. this.getAttributes()
  52704. }
  52705. }
  52706. }),
  52707. this.id = p++,
  52708. this.code = f,
  52709. this.usedTimes = 1,
  52710. this.program = P,
  52711. this.vertexShader = D,
  52712. this.fragmentShader = N,
  52713. this
  52714. }
  52715. }(),
  52716. n.WebGLPrograms = function(e, t) {
  52717. function i(e) {
  52718. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52719. return 1024;
  52720. var i = t.maxVertexUniforms
  52721. , r = Math.floor((i - 20) / 4)
  52722. , o = r;
  52723. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52724. 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)")),
  52725. o
  52726. }
  52727. function r(e, t) {
  52728. var i;
  52729. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52730. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52731. i
  52732. }
  52733. var o = []
  52734. , a = {
  52735. MeshDepthMaterial: "depth",
  52736. MeshNormalMaterial: "normal",
  52737. MeshBasicMaterial: "basic",
  52738. MeshLambertMaterial: "lambert",
  52739. MeshPhongMaterial: "phong",
  52740. MeshStandardMaterial: "standard",
  52741. LineBasicMaterial: "basic",
  52742. LineDashedMaterial: "dashed",
  52743. PointsMaterial: "points"
  52744. }
  52745. , 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"];
  52746. this.getParameters = function(o, s, l, c) {
  52747. var h = a[o.type]
  52748. , u = i(c)
  52749. , d = e.getPrecision();
  52750. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52751. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52752. var p = {
  52753. shaderID: h,
  52754. precision: d,
  52755. supportsVertexTextures: t.vertexTextures,
  52756. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52757. map: !!o.map,
  52758. mapEncoding: r(o.map, e.gammaInput),
  52759. envMap: !!o.envMap,
  52760. envMapMode: o.envMap && o.envMap.mapping,
  52761. envMapEncoding: r(o.envMap, e.gammaInput),
  52762. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52763. lightMap: !!o.lightMap,
  52764. aoMap: !!o.aoMap,
  52765. emissiveMap: !!o.emissiveMap,
  52766. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52767. bumpMap: !!o.bumpMap,
  52768. normalMap: !!o.normalMap,
  52769. displacementMap: !!o.displacementMap,
  52770. roughnessMap: !!o.roughnessMap,
  52771. metalnessMap: !!o.metalnessMap,
  52772. specularMap: !!o.specularMap,
  52773. alphaMap: !!o.alphaMap,
  52774. combine: o.combine,
  52775. vertexColors: o.vertexColors,
  52776. fog: l,
  52777. useFog: o.fog,
  52778. fogExp: l instanceof n.FogExp2,
  52779. flatShading: o.shading === n.FlatShading,
  52780. sizeAttenuation: o.sizeAttenuation,
  52781. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  52782. skinning: o.skinning,
  52783. maxBones: u,
  52784. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  52785. morphTargets: o.morphTargets,
  52786. morphNormals: o.morphNormals,
  52787. maxMorphTargets: e.maxMorphTargets,
  52788. maxMorphNormals: e.maxMorphNormals,
  52789. numDirLights: s.directional.length,
  52790. numPointLights: s.point.length,
  52791. numSpotLights: s.spot.length,
  52792. numHemiLights: s.hemi.length,
  52793. pointLightShadows: s.shadowsPointLight,
  52794. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  52795. shadowMapType: e.shadowMap.type,
  52796. toneMapping: e.toneMapping,
  52797. physicallyCorrectLights: e.physicallyCorrectLights,
  52798. premultipliedAlpha: o.premultipliedAlpha,
  52799. alphaTest: o.alphaTest,
  52800. doubleSided: o.side === n.DoubleSide,
  52801. flipSided: o.side === n.BackSide
  52802. };
  52803. return p
  52804. }
  52805. ,
  52806. this.getProgramCode = function(e, t) {
  52807. var i = [];
  52808. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  52809. i.push(e.vertexShader)),
  52810. void 0 !== e.defines)
  52811. for (var n in e.defines)
  52812. i.push(n),
  52813. i.push(e.defines[n]);
  52814. for (var r = 0; r < s.length; r++) {
  52815. var o = s[r];
  52816. i.push(o),
  52817. i.push(t[o])
  52818. }
  52819. return i.join()
  52820. }
  52821. ,
  52822. this.acquireProgram = function(t, i, r) {
  52823. for (var a, s = 0, l = o.length; s < l; s++) {
  52824. var c = o[s];
  52825. if (c.code === r) {
  52826. a = c,
  52827. ++a.usedTimes;
  52828. break
  52829. }
  52830. }
  52831. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  52832. o.push(a)),
  52833. a
  52834. }
  52835. ,
  52836. this.releaseProgram = function(e) {
  52837. if (0 === --e.usedTimes) {
  52838. var t = o.indexOf(e);
  52839. o[t] = o[o.length - 1],
  52840. o.pop(),
  52841. e.destroy()
  52842. }
  52843. }
  52844. ,
  52845. this.programs = o
  52846. }
  52847. ,
  52848. n.WebGLProperties = function() {
  52849. var e = {};
  52850. this.get = function(t) {
  52851. var i = t.uuid
  52852. , n = e[i];
  52853. return void 0 === n && (n = {},
  52854. e[i] = n),
  52855. n
  52856. }
  52857. ,
  52858. this.delete = function(t) {
  52859. delete e[t.uuid]
  52860. }
  52861. ,
  52862. this.clear = function() {
  52863. e = {}
  52864. }
  52865. }
  52866. ,
  52867. n.WebGLShader = function() {
  52868. function e(e) {
  52869. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  52870. t[i] = i + 1 + ": " + t[i];
  52871. return t.join("\n")
  52872. }
  52873. return function(t, i, n) {
  52874. var r = t.createShader(i);
  52875. return t.shaderSource(r, n),
  52876. t.compileShader(r),
  52877. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  52878. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  52879. r
  52880. }
  52881. }(),
  52882. n.WebGLShadowMap = function(e, t, i) {
  52883. function r(e, t, i, r) {
  52884. var o = e.geometry
  52885. , a = null
  52886. , s = v
  52887. , l = e.customDepthMaterial;
  52888. if (i && (s = A,
  52889. l = e.customDistanceMaterial),
  52890. l)
  52891. a = l;
  52892. else {
  52893. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  52894. , h = e instanceof n.SkinnedMesh && t.skinning
  52895. , u = 0;
  52896. c && (u |= f),
  52897. h && (u |= g),
  52898. a = s[u]
  52899. }
  52900. return a.visible = t.visible,
  52901. a.wireframe = t.wireframe,
  52902. a.wireframeLinewidth = t.wireframeLinewidth,
  52903. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  52904. a
  52905. }
  52906. function o(e, t, i) {
  52907. if (e.visible !== !1) {
  52908. 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)) {
  52909. var r = e.material;
  52910. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  52911. p.push(e))
  52912. }
  52913. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  52914. o(a[s], t, i)
  52915. }
  52916. }
  52917. 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) {
  52918. var x = 0 !== (T & f)
  52919. , S = 0 !== (T & g)
  52920. , M = new n.ShaderMaterial({
  52921. uniforms: b,
  52922. vertexShader: E.vertexShader,
  52923. fragmentShader: E.fragmentShader,
  52924. morphTargets: x,
  52925. skinning: S
  52926. });
  52927. v[T] = M;
  52928. var R = new n.ShaderMaterial({
  52929. defines: {
  52930. USE_SHADOWMAP: ""
  52931. },
  52932. uniforms: _,
  52933. vertexShader: w.vertexShader,
  52934. fragmentShader: w.fragmentShader,
  52935. morphTargets: x,
  52936. skinning: S
  52937. });
  52938. A[T] = R
  52939. }
  52940. var P = this;
  52941. this.enabled = !1,
  52942. this.autoUpdate = !0,
  52943. this.needsUpdate = !1,
  52944. this.type = n.PCFShadowMap,
  52945. this.cullFace = n.CullFaceFront,
  52946. this.render = function(f, g) {
  52947. var m, v, A = t.shadows;
  52948. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  52949. s.clearColor(1, 1, 1, 1),
  52950. s.disable(a.BLEND),
  52951. s.enable(a.CULL_FACE),
  52952. a.frontFace(a.CCW),
  52953. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  52954. s.setDepthTest(!0),
  52955. s.setScissorTest(!1);
  52956. for (var E = 0, b = A.length; E < b; E++) {
  52957. var w = A[E]
  52958. , _ = w.shadow
  52959. , T = _.camera;
  52960. if (h.copy(_.mapSize),
  52961. w instanceof n.PointLight) {
  52962. m = 6,
  52963. v = !0;
  52964. var x = h.x
  52965. , S = h.y;
  52966. I[0].set(2 * x, S, x, S),
  52967. I[1].set(0, S, x, S),
  52968. I[2].set(3 * x, S, x, S),
  52969. I[3].set(x, S, x, S),
  52970. I[4].set(3 * x, 0, x, S),
  52971. I[5].set(x, 0, x, S),
  52972. h.x *= 4,
  52973. h.y *= 2
  52974. } else
  52975. m = 1,
  52976. v = !1;
  52977. if (null === _.map) {
  52978. var M = {
  52979. minFilter: n.NearestFilter,
  52980. magFilter: n.NearestFilter,
  52981. format: n.RGBAFormat
  52982. };
  52983. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  52984. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  52985. T.updateProjectionMatrix()
  52986. }
  52987. var R = _.map
  52988. , O = _.matrix;
  52989. d.setFromMatrixPosition(w.matrixWorld),
  52990. T.position.copy(d),
  52991. e.setRenderTarget(R),
  52992. e.clear();
  52993. for (var L = 0; L < m; L++) {
  52994. if (v) {
  52995. u.copy(T.position),
  52996. u.add(y[L]),
  52997. T.up.copy(C[L]),
  52998. T.lookAt(u);
  52999. var D = I[L];
  53000. s.viewport(D)
  53001. } else
  53002. u.setFromMatrixPosition(w.target.matrixWorld),
  53003. T.lookAt(u);
  53004. T.updateMatrixWorld(),
  53005. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53006. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53007. O.multiply(T.projectionMatrix),
  53008. O.multiply(T.matrixWorldInverse),
  53009. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53010. l.setFromMatrix(c),
  53011. p.length = 0,
  53012. o(f, g, T);
  53013. for (var N = 0, B = p.length; N < B; N++) {
  53014. var F = p[N]
  53015. , V = i.update(F)
  53016. , U = F.material;
  53017. if (U instanceof n.MultiMaterial)
  53018. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53019. var W = k[G]
  53020. , j = H[W.materialIndex];
  53021. if (j.visible === !0) {
  53022. var Y = r(F, j, v, d);
  53023. e.renderBufferDirect(T, null, V, Y, F, W)
  53024. }
  53025. }
  53026. else {
  53027. var Y = r(F, U, v, d);
  53028. e.renderBufferDirect(T, null, V, Y, F, null)
  53029. }
  53030. }
  53031. }
  53032. }
  53033. var X = e.getClearColor()
  53034. , Z = e.getClearAlpha();
  53035. e.setClearColor(X, Z),
  53036. s.enable(a.BLEND),
  53037. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53038. P.needsUpdate = !1
  53039. }
  53040. }
  53041. }
  53042. ,
  53043. n.WebGLState = function(e, t, i) {
  53044. var r = this
  53045. , o = new n.Vector4
  53046. , a = new Uint8Array(16)
  53047. , s = new Uint8Array(16)
  53048. , l = new Uint8Array(16)
  53049. , c = {}
  53050. , h = null
  53051. , u = null
  53052. , d = null
  53053. , p = null
  53054. , f = null
  53055. , g = null
  53056. , m = null
  53057. , v = null
  53058. , A = !1
  53059. , y = null
  53060. , C = null
  53061. , I = null
  53062. , E = null
  53063. , b = null
  53064. , w = null
  53065. , _ = null
  53066. , T = null
  53067. , x = null
  53068. , S = null
  53069. , M = null
  53070. , R = null
  53071. , P = null
  53072. , O = null
  53073. , L = null
  53074. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53075. , N = void 0
  53076. , B = {}
  53077. , F = new n.Vector4
  53078. , V = null
  53079. , U = null
  53080. , k = new n.Vector4
  53081. , H = new n.Vector4
  53082. , G = e.createTexture();
  53083. e.bindTexture(e.TEXTURE_2D, G),
  53084. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53085. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53086. this.init = function() {
  53087. this.clearColor(0, 0, 0, 1),
  53088. this.clearDepth(1),
  53089. this.clearStencil(0),
  53090. this.enable(e.DEPTH_TEST),
  53091. e.depthFunc(e.LEQUAL),
  53092. e.frontFace(e.CCW),
  53093. e.cullFace(e.BACK),
  53094. this.enable(e.CULL_FACE),
  53095. this.enable(e.BLEND),
  53096. e.blendEquation(e.FUNC_ADD),
  53097. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53098. }
  53099. ,
  53100. this.initAttributes = function() {
  53101. for (var e = 0, t = a.length; e < t; e++)
  53102. a[e] = 0
  53103. }
  53104. ,
  53105. this.enableAttribute = function(i) {
  53106. if (a[i] = 1,
  53107. 0 === s[i] && (e.enableVertexAttribArray(i),
  53108. s[i] = 1),
  53109. 0 !== l[i]) {
  53110. var n = t.get("ANGLE_instanced_arrays");
  53111. n.vertexAttribDivisorANGLE(i, 0),
  53112. l[i] = 0
  53113. }
  53114. }
  53115. ,
  53116. this.enableAttributeAndDivisor = function(t, i, n) {
  53117. a[t] = 1,
  53118. 0 === s[t] && (e.enableVertexAttribArray(t),
  53119. s[t] = 1),
  53120. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53121. l[t] = i)
  53122. }
  53123. ,
  53124. this.disableUnusedAttributes = function() {
  53125. for (var t = 0, i = s.length; t < i; t++)
  53126. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53127. s[t] = 0)
  53128. }
  53129. ,
  53130. this.enable = function(t) {
  53131. c[t] !== !0 && (e.enable(t),
  53132. c[t] = !0)
  53133. }
  53134. ,
  53135. this.disable = function(t) {
  53136. c[t] !== !1 && (e.disable(t),
  53137. c[t] = !1)
  53138. }
  53139. ,
  53140. this.getCompressedTextureFormats = function() {
  53141. if (null === h && (h = [],
  53142. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53143. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53144. h.push(i[n]);
  53145. return h
  53146. }
  53147. ,
  53148. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53149. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53150. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53151. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53152. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53153. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53154. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53155. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53156. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53157. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53158. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53159. u = t,
  53160. A = h),
  53161. t === n.CustomBlending ? (s = s || r,
  53162. l = l || o,
  53163. c = c || a,
  53164. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53165. d = r,
  53166. g = s),
  53167. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53168. p = o,
  53169. f = a,
  53170. m = l,
  53171. v = c)) : (d = null,
  53172. p = null,
  53173. f = null,
  53174. g = null,
  53175. m = null,
  53176. v = null)
  53177. }
  53178. ,
  53179. this.setDepthFunc = function(t) {
  53180. if (y !== t) {
  53181. if (t)
  53182. switch (t) {
  53183. case n.NeverDepth:
  53184. e.depthFunc(e.NEVER);
  53185. break;
  53186. case n.AlwaysDepth:
  53187. e.depthFunc(e.ALWAYS);
  53188. break;
  53189. case n.LessDepth:
  53190. e.depthFunc(e.LESS);
  53191. break;
  53192. case n.LessEqualDepth:
  53193. e.depthFunc(e.LEQUAL);
  53194. break;
  53195. case n.EqualDepth:
  53196. e.depthFunc(e.EQUAL);
  53197. break;
  53198. case n.GreaterEqualDepth:
  53199. e.depthFunc(e.GEQUAL);
  53200. break;
  53201. case n.GreaterDepth:
  53202. e.depthFunc(e.GREATER);
  53203. break;
  53204. case n.NotEqualDepth:
  53205. e.depthFunc(e.NOTEQUAL);
  53206. break;
  53207. default:
  53208. e.depthFunc(e.LEQUAL)
  53209. }
  53210. else
  53211. e.depthFunc(e.LEQUAL);
  53212. y = t
  53213. }
  53214. }
  53215. ,
  53216. this.setDepthTest = function(t) {
  53217. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53218. }
  53219. ,
  53220. this.setDepthWrite = function(t) {
  53221. C !== t && (e.depthMask(t),
  53222. C = t)
  53223. }
  53224. ,
  53225. this.setColorWrite = function(t) {
  53226. I !== t && (e.colorMask(t, t, t, t),
  53227. I = t)
  53228. }
  53229. ,
  53230. this.setStencilFunc = function(t, i, n) {
  53231. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53232. b = t,
  53233. w = i,
  53234. _ = n)
  53235. }
  53236. ,
  53237. this.setStencilOp = function(t, i, n) {
  53238. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53239. T = t,
  53240. x = i,
  53241. S = n)
  53242. }
  53243. ,
  53244. this.setStencilTest = function(t) {
  53245. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53246. }
  53247. ,
  53248. this.setStencilWrite = function(t) {
  53249. E !== t && (e.stencilMask(t),
  53250. E = t)
  53251. }
  53252. ,
  53253. this.setFlipSided = function(t) {
  53254. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53255. M = t)
  53256. }
  53257. ,
  53258. this.setLineWidth = function(t) {
  53259. t !== R && (e.lineWidth(t),
  53260. R = t)
  53261. }
  53262. ,
  53263. this.setPolygonOffset = function(t, i, n) {
  53264. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53265. !t || P === i && O === n || (e.polygonOffset(i, n),
  53266. P = i,
  53267. O = n)
  53268. }
  53269. ,
  53270. this.getScissorTest = function() {
  53271. return L
  53272. }
  53273. ,
  53274. this.setScissorTest = function(t) {
  53275. L = t,
  53276. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53277. }
  53278. ,
  53279. this.activeTexture = function(t) {
  53280. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53281. N !== t && (e.activeTexture(t),
  53282. N = t)
  53283. }
  53284. ,
  53285. this.bindTexture = function(t, i) {
  53286. void 0 === N && r.activeTexture();
  53287. var n = B[N];
  53288. void 0 === n && (n = {
  53289. type: void 0,
  53290. texture: void 0
  53291. },
  53292. B[N] = n),
  53293. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53294. n.type = t,
  53295. n.texture = i)
  53296. }
  53297. ,
  53298. this.compressedTexImage2D = function() {
  53299. try {
  53300. e.compressedTexImage2D.apply(e, arguments)
  53301. } catch (e) {
  53302. console.error(e)
  53303. }
  53304. }
  53305. ,
  53306. this.texImage2D = function() {
  53307. try {
  53308. e.texImage2D.apply(e, arguments)
  53309. } catch (e) {
  53310. console.error(e)
  53311. }
  53312. }
  53313. ,
  53314. this.clearColor = function(t, i, n, r) {
  53315. o.set(t, i, n, r),
  53316. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53317. F.copy(o))
  53318. }
  53319. ,
  53320. this.clearDepth = function(t) {
  53321. V !== t && (e.clearDepth(t),
  53322. V = t)
  53323. }
  53324. ,
  53325. this.clearStencil = function(t) {
  53326. U !== t && (e.clearStencil(t),
  53327. U = t)
  53328. }
  53329. ,
  53330. this.scissor = function(t) {
  53331. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53332. k.copy(t))
  53333. }
  53334. ,
  53335. this.viewport = function(t) {
  53336. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53337. H.copy(t))
  53338. }
  53339. ,
  53340. this.reset = function() {
  53341. for (var t = 0; t < s.length; t++)
  53342. 1 === s[t] && (e.disableVertexAttribArray(t),
  53343. s[t] = 0);
  53344. c = {},
  53345. h = null,
  53346. N = void 0,
  53347. B = {},
  53348. u = null,
  53349. I = null,
  53350. C = null,
  53351. E = null,
  53352. M = null
  53353. }
  53354. }
  53355. ,
  53356. n.LensFlarePlugin = function(e, t) {
  53357. function i() {
  53358. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53359. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53360. o = p.createBuffer(),
  53361. a = p.createBuffer(),
  53362. p.bindBuffer(p.ARRAY_BUFFER, o),
  53363. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53364. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53365. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53366. u = p.createTexture(),
  53367. d = p.createTexture(),
  53368. f.bindTexture(p.TEXTURE_2D, u),
  53369. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53370. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53371. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53372. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53373. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53374. f.bindTexture(p.TEXTURE_2D, d),
  53375. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53376. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53377. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53378. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53379. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53380. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53381. var i;
  53382. i = h ? {
  53383. 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"),
  53384. 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")
  53385. } : {
  53386. 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"),
  53387. 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")
  53388. },
  53389. s = r(i),
  53390. l = {
  53391. vertex: p.getAttribLocation(s, "position"),
  53392. uv: p.getAttribLocation(s, "uv")
  53393. },
  53394. c = {
  53395. renderType: p.getUniformLocation(s, "renderType"),
  53396. map: p.getUniformLocation(s, "map"),
  53397. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53398. opacity: p.getUniformLocation(s, "opacity"),
  53399. color: p.getUniformLocation(s, "color"),
  53400. scale: p.getUniformLocation(s, "scale"),
  53401. rotation: p.getUniformLocation(s, "rotation"),
  53402. screenPosition: p.getUniformLocation(s, "screenPosition")
  53403. }
  53404. }
  53405. function r(t) {
  53406. var i = p.createProgram()
  53407. , n = p.createShader(p.FRAGMENT_SHADER)
  53408. , r = p.createShader(p.VERTEX_SHADER)
  53409. , o = "precision " + e.getPrecision() + " float;\n";
  53410. return p.shaderSource(n, o + t.fragmentShader),
  53411. p.shaderSource(r, o + t.vertexShader),
  53412. p.compileShader(n),
  53413. p.compileShader(r),
  53414. p.attachShader(i, n),
  53415. p.attachShader(i, r),
  53416. p.linkProgram(i),
  53417. i
  53418. }
  53419. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53420. this.render = function(r, g, m) {
  53421. if (0 !== t.length) {
  53422. var v = new n.Vector3
  53423. , A = m.w / m.z
  53424. , y = .5 * m.z
  53425. , C = .5 * m.w
  53426. , I = 16 / m.w
  53427. , E = new n.Vector2(I * A,I)
  53428. , b = new n.Vector3(1,1,0)
  53429. , w = new n.Vector2(1,1);
  53430. void 0 === s && i(),
  53431. p.useProgram(s),
  53432. f.initAttributes(),
  53433. f.enableAttribute(l.vertex),
  53434. f.enableAttribute(l.uv),
  53435. f.disableUnusedAttributes(),
  53436. p.uniform1i(c.occlusionMap, 0),
  53437. p.uniform1i(c.map, 1),
  53438. p.bindBuffer(p.ARRAY_BUFFER, o),
  53439. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53440. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53441. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53442. f.disable(p.CULL_FACE),
  53443. f.setDepthWrite(!1);
  53444. for (var _ = 0, T = t.length; _ < T; _++) {
  53445. I = 16 / m.w,
  53446. E.set(I * A, I);
  53447. var x = t[_];
  53448. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53449. v.applyMatrix4(g.matrixWorldInverse),
  53450. v.applyProjection(g.projectionMatrix),
  53451. b.copy(v),
  53452. w.x = b.x * y + y,
  53453. w.y = b.y * C + C,
  53454. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53455. f.activeTexture(p.TEXTURE0),
  53456. f.bindTexture(p.TEXTURE_2D, null),
  53457. f.activeTexture(p.TEXTURE1),
  53458. f.bindTexture(p.TEXTURE_2D, u),
  53459. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53460. p.uniform1i(c.renderType, 0),
  53461. p.uniform2f(c.scale, E.x, E.y),
  53462. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53463. f.disable(p.BLEND),
  53464. f.enable(p.DEPTH_TEST),
  53465. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53466. f.activeTexture(p.TEXTURE0),
  53467. f.bindTexture(p.TEXTURE_2D, d),
  53468. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53469. p.uniform1i(c.renderType, 1),
  53470. f.disable(p.DEPTH_TEST),
  53471. f.activeTexture(p.TEXTURE1),
  53472. f.bindTexture(p.TEXTURE_2D, u),
  53473. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53474. x.positionScreen.copy(b),
  53475. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53476. p.uniform1i(c.renderType, 2),
  53477. f.enable(p.BLEND);
  53478. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53479. var R = x.lensFlares[S];
  53480. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53481. b.y = R.y,
  53482. b.z = R.z,
  53483. I = R.size * R.scale / m.w,
  53484. E.x = I * A,
  53485. E.y = I,
  53486. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53487. p.uniform2f(c.scale, E.x, E.y),
  53488. p.uniform1f(c.rotation, R.rotation),
  53489. p.uniform1f(c.opacity, R.opacity),
  53490. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53491. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53492. e.setTexture(R.texture, 1),
  53493. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53494. }
  53495. }
  53496. }
  53497. f.enable(p.CULL_FACE),
  53498. f.enable(p.DEPTH_TEST),
  53499. f.setDepthWrite(!0),
  53500. e.resetGLState()
  53501. }
  53502. }
  53503. }
  53504. ,
  53505. n.SpritePlugin = function(e, t) {
  53506. function i() {
  53507. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53508. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53509. a = d.createBuffer(),
  53510. s = d.createBuffer(),
  53511. d.bindBuffer(d.ARRAY_BUFFER, a),
  53512. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53513. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53514. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53515. l = r(),
  53516. c = {
  53517. position: d.getAttribLocation(l, "position"),
  53518. uv: d.getAttribLocation(l, "uv")
  53519. },
  53520. h = {
  53521. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53522. uvScale: d.getUniformLocation(l, "uvScale"),
  53523. rotation: d.getUniformLocation(l, "rotation"),
  53524. scale: d.getUniformLocation(l, "scale"),
  53525. color: d.getUniformLocation(l, "color"),
  53526. map: d.getUniformLocation(l, "map"),
  53527. opacity: d.getUniformLocation(l, "opacity"),
  53528. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53529. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53530. fogType: d.getUniformLocation(l, "fogType"),
  53531. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53532. fogNear: d.getUniformLocation(l, "fogNear"),
  53533. fogFar: d.getUniformLocation(l, "fogFar"),
  53534. fogColor: d.getUniformLocation(l, "fogColor"),
  53535. alphaTest: d.getUniformLocation(l, "alphaTest")
  53536. };
  53537. var i = document.createElement("canvas");
  53538. i.width = 8,
  53539. i.height = 8;
  53540. var o = i.getContext("2d");
  53541. o.fillStyle = "white",
  53542. o.fillRect(0, 0, 8, 8),
  53543. u = new n.Texture(i),
  53544. u.needsUpdate = !0
  53545. }
  53546. function r() {
  53547. var t = d.createProgram()
  53548. , i = d.createShader(d.VERTEX_SHADER)
  53549. , n = d.createShader(d.FRAGMENT_SHADER);
  53550. 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")),
  53551. 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")),
  53552. d.compileShader(i),
  53553. d.compileShader(n),
  53554. d.attachShader(t, i),
  53555. d.attachShader(t, n),
  53556. d.linkProgram(t),
  53557. t
  53558. }
  53559. function o(e, t) {
  53560. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53561. }
  53562. 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;
  53563. this.render = function(r, v) {
  53564. if (0 !== t.length) {
  53565. void 0 === l && i(),
  53566. d.useProgram(l),
  53567. p.initAttributes(),
  53568. p.enableAttribute(c.position),
  53569. p.enableAttribute(c.uv),
  53570. p.disableUnusedAttributes(),
  53571. p.disable(d.CULL_FACE),
  53572. p.enable(d.BLEND),
  53573. d.bindBuffer(d.ARRAY_BUFFER, a),
  53574. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53575. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53576. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53577. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53578. p.activeTexture(d.TEXTURE0),
  53579. d.uniform1i(h.map, 0);
  53580. var A = 0
  53581. , y = 0
  53582. , C = r.fog;
  53583. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53584. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53585. d.uniform1f(h.fogFar, C.far),
  53586. d.uniform1i(h.fogType, 1),
  53587. A = 1,
  53588. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53589. d.uniform1i(h.fogType, 2),
  53590. A = 2,
  53591. y = 2)) : (d.uniform1i(h.fogType, 0),
  53592. A = 0,
  53593. y = 0);
  53594. for (var I = 0, E = t.length; I < E; I++) {
  53595. var b = t[I];
  53596. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53597. b.z = -b.modelViewMatrix.elements[14]
  53598. }
  53599. t.sort(o);
  53600. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53601. var b = t[I]
  53602. , _ = b.material;
  53603. d.uniform1f(h.alphaTest, _.alphaTest),
  53604. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53605. b.matrixWorld.decompose(f, g, m),
  53606. w[0] = m.x,
  53607. w[1] = m.y;
  53608. var T = 0;
  53609. r.fog && _.fog && (T = y),
  53610. A !== T && (d.uniform1i(h.fogType, T),
  53611. A = T),
  53612. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53613. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53614. d.uniform2f(h.uvScale, 1, 1)),
  53615. d.uniform1f(h.opacity, _.opacity),
  53616. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53617. d.uniform1f(h.rotation, _.rotation),
  53618. d.uniform2fv(h.scale, w),
  53619. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53620. p.setDepthTest(_.depthTest),
  53621. p.setDepthWrite(_.depthWrite),
  53622. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53623. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53624. }
  53625. p.enable(d.CULL_FACE),
  53626. e.resetGLState()
  53627. }
  53628. }
  53629. }
  53630. ,
  53631. Object.defineProperties(n.Box2.prototype, {
  53632. empty: {
  53633. value: function() {
  53634. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53635. this.isEmpty()
  53636. }
  53637. },
  53638. isIntersectionBox: {
  53639. value: function(e) {
  53640. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53641. this.intersectsBox(e)
  53642. }
  53643. }
  53644. }),
  53645. Object.defineProperties(n.Box3.prototype, {
  53646. empty: {
  53647. value: function() {
  53648. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53649. this.isEmpty()
  53650. }
  53651. },
  53652. isIntersectionBox: {
  53653. value: function(e) {
  53654. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53655. this.intersectsBox(e)
  53656. }
  53657. },
  53658. isIntersectionSphere: {
  53659. value: function(e) {
  53660. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53661. this.intersectsSphere(e)
  53662. }
  53663. }
  53664. }),
  53665. Object.defineProperties(n.Matrix3.prototype, {
  53666. multiplyVector3: {
  53667. value: function(e) {
  53668. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53669. e.applyMatrix3(this)
  53670. }
  53671. },
  53672. multiplyVector3Array: {
  53673. value: function(e) {
  53674. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53675. this.applyToVector3Array(e)
  53676. }
  53677. }
  53678. }),
  53679. Object.defineProperties(n.Matrix4.prototype, {
  53680. extractPosition: {
  53681. value: function(e) {
  53682. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53683. this.copyPosition(e)
  53684. }
  53685. },
  53686. setRotationFromQuaternion: {
  53687. value: function(e) {
  53688. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53689. this.makeRotationFromQuaternion(e)
  53690. }
  53691. },
  53692. multiplyVector3: {
  53693. value: function(e) {
  53694. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53695. e.applyProjection(this)
  53696. }
  53697. },
  53698. multiplyVector4: {
  53699. value: function(e) {
  53700. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53701. e.applyMatrix4(this)
  53702. }
  53703. },
  53704. multiplyVector3Array: {
  53705. value: function(e) {
  53706. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53707. this.applyToVector3Array(e)
  53708. }
  53709. },
  53710. rotateAxis: {
  53711. value: function(e) {
  53712. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53713. e.transformDirection(this)
  53714. }
  53715. },
  53716. crossVector: {
  53717. value: function(e) {
  53718. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53719. e.applyMatrix4(this)
  53720. }
  53721. },
  53722. translate: {
  53723. value: function(e) {
  53724. console.error("THREE.Matrix4: .translate() has been removed.")
  53725. }
  53726. },
  53727. rotateX: {
  53728. value: function(e) {
  53729. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53730. }
  53731. },
  53732. rotateY: {
  53733. value: function(e) {
  53734. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53735. }
  53736. },
  53737. rotateZ: {
  53738. value: function(e) {
  53739. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53740. }
  53741. },
  53742. rotateByAxis: {
  53743. value: function(e, t) {
  53744. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53745. }
  53746. }
  53747. }),
  53748. Object.defineProperties(n.Plane.prototype, {
  53749. isIntersectionLine: {
  53750. value: function(e) {
  53751. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53752. this.intersectsLine(e)
  53753. }
  53754. }
  53755. }),
  53756. Object.defineProperties(n.Quaternion.prototype, {
  53757. multiplyVector3: {
  53758. value: function(e) {
  53759. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53760. e.applyQuaternion(this)
  53761. }
  53762. }
  53763. }),
  53764. Object.defineProperties(n.Ray.prototype, {
  53765. isIntersectionBox: {
  53766. value: function(e) {
  53767. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53768. this.intersectsBox(e)
  53769. }
  53770. },
  53771. isIntersectionPlane: {
  53772. value: function(e) {
  53773. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  53774. this.intersectsPlane(e)
  53775. }
  53776. },
  53777. isIntersectionSphere: {
  53778. value: function(e) {
  53779. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53780. this.intersectsSphere(e)
  53781. }
  53782. }
  53783. }),
  53784. Object.defineProperties(n.Vector3.prototype, {
  53785. setEulerFromRotationMatrix: {
  53786. value: function() {
  53787. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  53788. }
  53789. },
  53790. setEulerFromQuaternion: {
  53791. value: function() {
  53792. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  53793. }
  53794. },
  53795. getPositionFromMatrix: {
  53796. value: function(e) {
  53797. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  53798. this.setFromMatrixPosition(e)
  53799. }
  53800. },
  53801. getScaleFromMatrix: {
  53802. value: function(e) {
  53803. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  53804. this.setFromMatrixScale(e)
  53805. }
  53806. },
  53807. getColumnFromMatrix: {
  53808. value: function(e, t) {
  53809. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  53810. this.setFromMatrixColumn(e, t)
  53811. }
  53812. }
  53813. }),
  53814. n.Face4 = function(e, t, i, r, o, a, s) {
  53815. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  53816. new n.Face3(e,t,i,o,a,s)
  53817. }
  53818. ,
  53819. n.Vertex = function(e, t, i) {
  53820. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  53821. new n.Vector3(e,t,i)
  53822. }
  53823. ,
  53824. Object.defineProperties(n.Object3D.prototype, {
  53825. eulerOrder: {
  53826. get: function() {
  53827. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53828. this.rotation.order
  53829. },
  53830. set: function(e) {
  53831. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53832. this.rotation.order = e
  53833. }
  53834. },
  53835. getChildByName: {
  53836. value: function(e) {
  53837. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  53838. this.getObjectByName(e)
  53839. }
  53840. },
  53841. renderDepth: {
  53842. set: function(e) {
  53843. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  53844. }
  53845. },
  53846. translate: {
  53847. value: function(e, t) {
  53848. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  53849. this.translateOnAxis(t, e)
  53850. }
  53851. },
  53852. useQuaternion: {
  53853. get: function() {
  53854. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53855. },
  53856. set: function(e) {
  53857. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53858. }
  53859. }
  53860. }),
  53861. Object.defineProperties(n, {
  53862. PointCloud: {
  53863. value: function(e, t) {
  53864. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  53865. new n.Points(e,t)
  53866. }
  53867. },
  53868. ParticleSystem: {
  53869. value: function(e, t) {
  53870. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  53871. new n.Points(e,t)
  53872. }
  53873. }
  53874. }),
  53875. Object.defineProperties(n.Light.prototype, {
  53876. onlyShadow: {
  53877. set: function(e) {
  53878. console.warn("THREE.Light: .onlyShadow has been removed.")
  53879. }
  53880. },
  53881. shadowCameraFov: {
  53882. set: function(e) {
  53883. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  53884. this.shadow.camera.fov = e
  53885. }
  53886. },
  53887. shadowCameraLeft: {
  53888. set: function(e) {
  53889. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  53890. this.shadow.camera.left = e
  53891. }
  53892. },
  53893. shadowCameraRight: {
  53894. set: function(e) {
  53895. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  53896. this.shadow.camera.right = e
  53897. }
  53898. },
  53899. shadowCameraTop: {
  53900. set: function(e) {
  53901. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  53902. this.shadow.camera.top = e
  53903. }
  53904. },
  53905. shadowCameraBottom: {
  53906. set: function(e) {
  53907. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  53908. this.shadow.camera.bottom = e
  53909. }
  53910. },
  53911. shadowCameraNear: {
  53912. set: function(e) {
  53913. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  53914. this.shadow.camera.near = e
  53915. }
  53916. },
  53917. shadowCameraFar: {
  53918. set: function(e) {
  53919. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  53920. this.shadow.camera.far = e
  53921. }
  53922. },
  53923. shadowCameraVisible: {
  53924. set: function(e) {
  53925. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  53926. }
  53927. },
  53928. shadowBias: {
  53929. set: function(e) {
  53930. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  53931. this.shadow.bias = e
  53932. }
  53933. },
  53934. shadowDarkness: {
  53935. set: function(e) {
  53936. console.warn("THREE.Light: .shadowDarkness has been removed.")
  53937. }
  53938. },
  53939. shadowMapWidth: {
  53940. set: function(e) {
  53941. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  53942. this.shadow.mapSize.width = e
  53943. }
  53944. },
  53945. shadowMapHeight: {
  53946. set: function(e) {
  53947. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  53948. this.shadow.mapSize.height = e
  53949. }
  53950. }
  53951. }),
  53952. Object.defineProperties(n.BufferAttribute.prototype, {
  53953. length: {
  53954. get: function() {
  53955. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  53956. this.array.length
  53957. }
  53958. }
  53959. }),
  53960. Object.defineProperties(n.BufferGeometry.prototype, {
  53961. drawcalls: {
  53962. get: function() {
  53963. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  53964. this.groups
  53965. }
  53966. },
  53967. offsets: {
  53968. get: function() {
  53969. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  53970. this.groups
  53971. }
  53972. },
  53973. addIndex: {
  53974. value: function(e) {
  53975. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  53976. this.setIndex(e)
  53977. }
  53978. },
  53979. addDrawCall: {
  53980. value: function(e, t, i) {
  53981. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  53982. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  53983. this.addGroup(e, t)
  53984. }
  53985. },
  53986. clearDrawCalls: {
  53987. value: function() {
  53988. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  53989. this.clearGroups()
  53990. }
  53991. },
  53992. computeTangents: {
  53993. value: function() {
  53994. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  53995. }
  53996. },
  53997. computeOffsets: {
  53998. value: function() {
  53999. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54000. }
  54001. }
  54002. }),
  54003. Object.defineProperties(n.Material.prototype, {
  54004. wrapAround: {
  54005. get: function() {
  54006. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54007. },
  54008. set: function(e) {
  54009. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54010. }
  54011. },
  54012. wrapRGB: {
  54013. get: function() {
  54014. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54015. new n.Color
  54016. }
  54017. }
  54018. }),
  54019. Object.defineProperties(n, {
  54020. PointCloudMaterial: {
  54021. value: function(e) {
  54022. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54023. new n.PointsMaterial(e)
  54024. }
  54025. },
  54026. ParticleBasicMaterial: {
  54027. value: function(e) {
  54028. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54029. new n.PointsMaterial(e)
  54030. }
  54031. },
  54032. ParticleSystemMaterial: {
  54033. value: function(e) {
  54034. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54035. new n.PointsMaterial(e)
  54036. }
  54037. }
  54038. }),
  54039. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54040. metal: {
  54041. get: function() {
  54042. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54043. !1
  54044. },
  54045. set: function(e) {
  54046. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54047. }
  54048. }
  54049. }),
  54050. Object.defineProperties(n.ShaderMaterial.prototype, {
  54051. derivatives: {
  54052. get: function() {
  54053. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54054. this.extensions.derivatives
  54055. },
  54056. set: function(e) {
  54057. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54058. this.extensions.derivatives = e
  54059. }
  54060. }
  54061. }),
  54062. Object.defineProperties(n.WebGLRenderer.prototype, {
  54063. supportsFloatTextures: {
  54064. value: function() {
  54065. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54066. this.extensions.get("OES_texture_float")
  54067. }
  54068. },
  54069. supportsHalfFloatTextures: {
  54070. value: function() {
  54071. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54072. this.extensions.get("OES_texture_half_float")
  54073. }
  54074. },
  54075. supportsStandardDerivatives: {
  54076. value: function() {
  54077. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54078. this.extensions.get("OES_standard_derivatives")
  54079. }
  54080. },
  54081. supportsCompressedTextureS3TC: {
  54082. value: function() {
  54083. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54084. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54085. }
  54086. },
  54087. supportsCompressedTexturePVRTC: {
  54088. value: function() {
  54089. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54090. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54091. }
  54092. },
  54093. supportsBlendMinMax: {
  54094. value: function() {
  54095. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54096. this.extensions.get("EXT_blend_minmax")
  54097. }
  54098. },
  54099. supportsVertexTextures: {
  54100. value: function() {
  54101. return this.capabilities.vertexTextures
  54102. }
  54103. },
  54104. supportsInstancedArrays: {
  54105. value: function() {
  54106. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54107. this.extensions.get("ANGLE_instanced_arrays")
  54108. }
  54109. },
  54110. enableScissorTest: {
  54111. value: function(e) {
  54112. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54113. this.setScissorTest(e)
  54114. }
  54115. },
  54116. initMaterial: {
  54117. value: function() {
  54118. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54119. }
  54120. },
  54121. addPrePlugin: {
  54122. value: function() {
  54123. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54124. }
  54125. },
  54126. addPostPlugin: {
  54127. value: function() {
  54128. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54129. }
  54130. },
  54131. updateShadowMap: {
  54132. value: function() {
  54133. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54134. }
  54135. },
  54136. shadowMapEnabled: {
  54137. get: function() {
  54138. return this.shadowMap.enabled
  54139. },
  54140. set: function(e) {
  54141. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54142. this.shadowMap.enabled = e
  54143. }
  54144. },
  54145. shadowMapType: {
  54146. get: function() {
  54147. return this.shadowMap.type
  54148. },
  54149. set: function(e) {
  54150. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54151. this.shadowMap.type = e
  54152. }
  54153. },
  54154. shadowMapCullFace: {
  54155. get: function() {
  54156. return this.shadowMap.cullFace
  54157. },
  54158. set: function(e) {
  54159. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54160. this.shadowMap.cullFace = e
  54161. }
  54162. }
  54163. }),
  54164. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54165. wrapS: {
  54166. get: function() {
  54167. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54168. this.texture.wrapS
  54169. },
  54170. set: function(e) {
  54171. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54172. this.texture.wrapS = e
  54173. }
  54174. },
  54175. wrapT: {
  54176. get: function() {
  54177. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54178. this.texture.wrapT
  54179. },
  54180. set: function(e) {
  54181. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54182. this.texture.wrapT = e
  54183. }
  54184. },
  54185. magFilter: {
  54186. get: function() {
  54187. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54188. this.texture.magFilter
  54189. },
  54190. set: function(e) {
  54191. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54192. this.texture.magFilter = e
  54193. }
  54194. },
  54195. minFilter: {
  54196. get: function() {
  54197. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54198. this.texture.minFilter
  54199. },
  54200. set: function(e) {
  54201. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54202. this.texture.minFilter = e
  54203. }
  54204. },
  54205. anisotropy: {
  54206. get: function() {
  54207. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54208. this.texture.anisotropy
  54209. },
  54210. set: function(e) {
  54211. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54212. this.texture.anisotropy = e
  54213. }
  54214. },
  54215. offset: {
  54216. get: function() {
  54217. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54218. this.texture.offset
  54219. },
  54220. set: function(e) {
  54221. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54222. this.texture.offset = e
  54223. }
  54224. },
  54225. repeat: {
  54226. get: function() {
  54227. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54228. this.texture.repeat
  54229. },
  54230. set: function(e) {
  54231. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54232. this.texture.repeat = e
  54233. }
  54234. },
  54235. format: {
  54236. get: function() {
  54237. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54238. this.texture.format
  54239. },
  54240. set: function(e) {
  54241. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54242. this.texture.format = e
  54243. }
  54244. },
  54245. type: {
  54246. get: function() {
  54247. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54248. this.texture.type
  54249. },
  54250. set: function(e) {
  54251. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54252. this.texture.type = e
  54253. }
  54254. },
  54255. generateMipmaps: {
  54256. get: function() {
  54257. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54258. this.texture.generateMipmaps
  54259. },
  54260. set: function(e) {
  54261. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54262. this.texture.generateMipmaps = e
  54263. }
  54264. }
  54265. }),
  54266. n.GeometryUtils = {
  54267. merge: function(e, t, i) {
  54268. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54269. var r;
  54270. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54271. r = t.matrix,
  54272. t = t.geometry),
  54273. e.merge(t, r, i)
  54274. },
  54275. center: function(e) {
  54276. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54277. e.center()
  54278. }
  54279. },
  54280. n.ImageUtils = {
  54281. crossOrigin: void 0,
  54282. loadTexture: function(e, t, i, r) {
  54283. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54284. var o = new n.TextureLoader;
  54285. o.setCrossOrigin(this.crossOrigin);
  54286. var a = o.load(e, i, void 0, r);
  54287. return t && (a.mapping = t),
  54288. a
  54289. },
  54290. loadTextureCube: function(e, t, i, r) {
  54291. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54292. var o = new n.CubeTextureLoader;
  54293. o.setCrossOrigin(this.crossOrigin);
  54294. var a = o.load(e, i, void 0, r);
  54295. return t && (a.mapping = t),
  54296. a
  54297. },
  54298. loadCompressedTexture: function() {
  54299. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54300. },
  54301. loadCompressedTextureCube: function() {
  54302. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54303. }
  54304. },
  54305. n.Projector = function() {
  54306. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54307. this.projectVector = function(e, t) {
  54308. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54309. e.project(t)
  54310. }
  54311. ,
  54312. this.unprojectVector = function(e, t) {
  54313. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54314. e.unproject(t)
  54315. }
  54316. ,
  54317. this.pickingRay = function(e, t) {
  54318. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54319. }
  54320. }
  54321. ,
  54322. n.CanvasRenderer = function() {
  54323. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54324. this.domElement = document.createElement("canvas"),
  54325. this.clear = function() {}
  54326. ,
  54327. this.render = function() {}
  54328. ,
  54329. this.setClearColor = function() {}
  54330. ,
  54331. this.setSize = function() {}
  54332. }
  54333. ,
  54334. n.MeshFaceMaterial = n.MultiMaterial,
  54335. n.CurveUtils = {
  54336. tangentQuadraticBezier: function(e, t, i, n) {
  54337. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54338. },
  54339. tangentCubicBezier: function(e, t, i, n, r) {
  54340. 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
  54341. },
  54342. tangentSpline: function(e, t, i, n, r) {
  54343. var o = 6 * e * e - 6 * e
  54344. , a = 3 * e * e - 4 * e + 1
  54345. , s = -6 * e * e + 6 * e
  54346. , l = 3 * e * e - 2 * e;
  54347. return o + a + s + l
  54348. },
  54349. interpolate: function(e, t, i, n, r) {
  54350. var o = .5 * (i - e)
  54351. , a = .5 * (n - t)
  54352. , s = r * r
  54353. , l = r * s;
  54354. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54355. }
  54356. },
  54357. n.SceneUtils = {
  54358. createMultiMaterialObject: function(e, t) {
  54359. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54360. i.add(new n.Mesh(e,t[r]));
  54361. return i
  54362. },
  54363. detach: function(e, t, i) {
  54364. e.applyMatrix(t.matrixWorld),
  54365. t.remove(e),
  54366. i.add(e)
  54367. },
  54368. attach: function(e, t, i) {
  54369. var r = new n.Matrix4;
  54370. r.getInverse(i.matrixWorld),
  54371. e.applyMatrix(r),
  54372. t.remove(e),
  54373. i.add(e)
  54374. }
  54375. },
  54376. n.ShapeUtils = {
  54377. area: function(e) {
  54378. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54379. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54380. return .5 * i
  54381. },
  54382. triangulate: function() {
  54383. function e(e, t, i, n, r, o) {
  54384. var a, s, l, c, h, u, d, p, f;
  54385. if (s = e[o[t]].x,
  54386. l = e[o[t]].y,
  54387. c = e[o[i]].x,
  54388. h = e[o[i]].y,
  54389. u = e[o[n]].x,
  54390. d = e[o[n]].y,
  54391. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54392. return !1;
  54393. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54394. for (g = u - c,
  54395. m = d - h,
  54396. v = s - u,
  54397. A = l - d,
  54398. y = c - s,
  54399. C = h - l,
  54400. a = 0; a < r; a++)
  54401. if (p = e[o[a]].x,
  54402. f = e[o[a]].y,
  54403. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54404. E = f - l,
  54405. b = p - c,
  54406. w = f - h,
  54407. _ = p - u,
  54408. T = f - d,
  54409. M = g * w - m * b,
  54410. x = y * E - C * I,
  54411. S = v * T - A * _,
  54412. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54413. return !1;
  54414. return !0
  54415. }
  54416. return function(t, i) {
  54417. var r = t.length;
  54418. if (r < 3)
  54419. return null;
  54420. var o, a, s, l = [], c = [], h = [];
  54421. if (n.ShapeUtils.area(t) > 0)
  54422. for (a = 0; a < r; a++)
  54423. c[a] = a;
  54424. else
  54425. for (a = 0; a < r; a++)
  54426. c[a] = r - 1 - a;
  54427. var u = r
  54428. , d = 2 * u;
  54429. for (a = u - 1; u > 2; ) {
  54430. if (d-- <= 0)
  54431. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54432. i ? h : l;
  54433. if (o = a,
  54434. u <= o && (o = 0),
  54435. a = o + 1,
  54436. u <= a && (a = 0),
  54437. s = a + 1,
  54438. u <= s && (s = 0),
  54439. e(t, o, a, s, u, c)) {
  54440. var p, f, g, m, v;
  54441. for (p = c[o],
  54442. f = c[a],
  54443. g = c[s],
  54444. l.push([t[p], t[f], t[g]]),
  54445. h.push([c[o], c[a], c[s]]),
  54446. m = a,
  54447. v = a + 1; v < u; m++,
  54448. v++)
  54449. c[m] = c[v];
  54450. u--,
  54451. d = 2 * u
  54452. }
  54453. }
  54454. return i ? h : l
  54455. }
  54456. }(),
  54457. triangulateShape: function(e, t) {
  54458. function i(e, t, i) {
  54459. 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
  54460. }
  54461. function r(e, t, n, r, o) {
  54462. var a = t.x - e.x
  54463. , s = t.y - e.y
  54464. , l = r.x - n.x
  54465. , c = r.y - n.y
  54466. , h = e.x - n.x
  54467. , u = e.y - n.y
  54468. , d = s * l - a * c
  54469. , p = s * h - a * u;
  54470. if (Math.abs(d) > Number.EPSILON) {
  54471. var f;
  54472. if (d > 0) {
  54473. if (p < 0 || p > d)
  54474. return [];
  54475. if (f = c * h - l * u,
  54476. f < 0 || f > d)
  54477. return []
  54478. } else {
  54479. if (p > 0 || p < d)
  54480. return [];
  54481. if (f = c * h - l * u,
  54482. f > 0 || f < d)
  54483. return []
  54484. }
  54485. if (0 === f)
  54486. return !o || 0 !== p && p !== d ? [e] : [];
  54487. if (f === d)
  54488. return !o || 0 !== p && p !== d ? [t] : [];
  54489. if (0 === p)
  54490. return [n];
  54491. if (p === d)
  54492. return [r];
  54493. var g = f / d;
  54494. return [{
  54495. x: e.x + g * a,
  54496. y: e.y + g * s
  54497. }]
  54498. }
  54499. if (0 !== p || c * h !== l * u)
  54500. return [];
  54501. var m = 0 === a && 0 === s
  54502. , v = 0 === l && 0 === c;
  54503. if (m && v)
  54504. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54505. if (m)
  54506. return i(n, r, e) ? [e] : [];
  54507. if (v)
  54508. return i(e, t, n) ? [n] : [];
  54509. var A, y, C, I, E, b, w, _;
  54510. return 0 !== a ? (e.x < t.x ? (A = e,
  54511. C = e.x,
  54512. y = t,
  54513. I = t.x) : (A = t,
  54514. C = t.x,
  54515. y = e,
  54516. I = e.x),
  54517. n.x < r.x ? (E = n,
  54518. w = n.x,
  54519. b = r,
  54520. _ = r.x) : (E = r,
  54521. w = r.x,
  54522. b = n,
  54523. _ = n.x)) : (e.y < t.y ? (A = e,
  54524. C = e.y,
  54525. y = t,
  54526. I = t.y) : (A = t,
  54527. C = t.y,
  54528. y = e,
  54529. I = e.y),
  54530. n.y < r.y ? (E = n,
  54531. w = n.y,
  54532. b = r,
  54533. _ = r.y) : (E = r,
  54534. w = r.y,
  54535. b = n,
  54536. _ = n.y)),
  54537. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54538. }
  54539. function o(e, t, i, n) {
  54540. var r = t.x - e.x
  54541. , o = t.y - e.y
  54542. , a = i.x - e.x
  54543. , s = i.y - e.y
  54544. , l = n.x - e.x
  54545. , c = n.y - e.y
  54546. , h = r * s - o * a
  54547. , u = r * c - o * l;
  54548. if (Math.abs(h) > Number.EPSILON) {
  54549. var d = l * s - c * a;
  54550. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54551. }
  54552. return u > 0
  54553. }
  54554. function a(e, t) {
  54555. function i(e, t) {
  54556. var i = A.length - 1
  54557. , n = e - 1;
  54558. n < 0 && (n = i);
  54559. var r = e + 1;
  54560. r > i && (r = 0);
  54561. var a = o(A[e], A[n], A[r], s[t]);
  54562. if (!a)
  54563. return !1;
  54564. var l = s.length - 1
  54565. , c = t - 1;
  54566. c < 0 && (c = l);
  54567. var h = t + 1;
  54568. return h > l && (h = 0),
  54569. a = o(s[t], s[c], s[h], A[e]),
  54570. !!a
  54571. }
  54572. function n(e, t) {
  54573. var i, n, o;
  54574. for (i = 0; i < A.length; i++)
  54575. if (n = i + 1,
  54576. n %= A.length,
  54577. o = r(e, t, A[i], A[n], !0),
  54578. o.length > 0)
  54579. return !0;
  54580. return !1
  54581. }
  54582. function a(e, i) {
  54583. var n, o, a, s, l;
  54584. for (n = 0; n < y.length; n++)
  54585. for (o = t[y[n]],
  54586. a = 0; a < o.length; a++)
  54587. if (s = a + 1,
  54588. s %= o.length,
  54589. l = r(e, i, o[a], o[s], !0),
  54590. l.length > 0)
  54591. return !0;
  54592. return !1
  54593. }
  54594. 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++)
  54595. y.push(I);
  54596. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54597. if (w--,
  54598. w < 0) {
  54599. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54600. break
  54601. }
  54602. for (c = b; c < A.length; c++) {
  54603. h = A[c],
  54604. l = -1;
  54605. for (var I = 0; I < y.length; I++)
  54606. if (d = y[I],
  54607. p = h.x + ":" + h.y + ":" + d,
  54608. void 0 === C[p]) {
  54609. s = t[d];
  54610. for (var _ = 0; _ < s.length; _++)
  54611. if (u = s[_],
  54612. i(c, _) && !n(h, u) && !a(h, u)) {
  54613. l = _,
  54614. y.splice(I, 1),
  54615. f = A.slice(0, c + 1),
  54616. g = A.slice(c),
  54617. m = s.slice(l),
  54618. v = s.slice(0, l + 1),
  54619. A = f.concat(m).concat(v).concat(g),
  54620. b = c;
  54621. break
  54622. }
  54623. if (l >= 0)
  54624. break;
  54625. C[p] = !0
  54626. }
  54627. if (l >= 0)
  54628. break
  54629. }
  54630. }
  54631. return A
  54632. }
  54633. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54634. Array.prototype.push.apply(f, t[g]);
  54635. for (s = 0,
  54636. l = f.length; s < l; s++)
  54637. u = f[s].x + ":" + f[s].y,
  54638. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54639. p[u] = s;
  54640. var v = a(e, t)
  54641. , A = n.ShapeUtils.triangulate(v, !1);
  54642. for (s = 0,
  54643. l = A.length; s < l; s++)
  54644. for (h = A[s],
  54645. c = 0; c < 3; c++)
  54646. u = h[c].x + ":" + h[c].y,
  54647. d = p[u],
  54648. void 0 !== d && (h[c] = d);
  54649. return A.concat()
  54650. },
  54651. isClockWise: function(e) {
  54652. return n.ShapeUtils.area(e) < 0
  54653. },
  54654. b2: function() {
  54655. function e(e, t) {
  54656. var i = 1 - e;
  54657. return i * i * t
  54658. }
  54659. function t(e, t) {
  54660. return 2 * (1 - e) * e * t
  54661. }
  54662. function i(e, t) {
  54663. return e * e * t
  54664. }
  54665. return function(n, r, o, a) {
  54666. return e(n, r) + t(n, o) + i(n, a)
  54667. }
  54668. }(),
  54669. b3: function() {
  54670. function e(e, t) {
  54671. var i = 1 - e;
  54672. return i * i * i * t
  54673. }
  54674. function t(e, t) {
  54675. var i = 1 - e;
  54676. return 3 * i * i * e * t
  54677. }
  54678. function i(e, t) {
  54679. var i = 1 - e;
  54680. return 3 * i * e * e * t
  54681. }
  54682. function n(e, t) {
  54683. return e * e * e * t
  54684. }
  54685. return function(r, o, a, s, l) {
  54686. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54687. }
  54688. }()
  54689. },
  54690. n.Curve = function() {}
  54691. ,
  54692. n.Curve.prototype = {
  54693. constructor: n.Curve,
  54694. getPoint: function(e) {
  54695. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54696. null
  54697. },
  54698. getPointAt: function(e) {
  54699. var t = this.getUtoTmapping(e);
  54700. return this.getPoint(t)
  54701. },
  54702. getPoints: function(e) {
  54703. e || (e = 5);
  54704. var t, i = [];
  54705. for (t = 0; t <= e; t++)
  54706. i.push(this.getPoint(t / e));
  54707. return i
  54708. },
  54709. getSpacedPoints: function(e) {
  54710. e || (e = 5);
  54711. var t, i = [];
  54712. for (t = 0; t <= e; t++)
  54713. i.push(this.getPointAt(t / e));
  54714. return i
  54715. },
  54716. getLength: function() {
  54717. var e = this.getLengths();
  54718. return e[e.length - 1]
  54719. },
  54720. getLengths: function(e) {
  54721. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54722. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54723. return this.cacheArcLengths;
  54724. this.needsUpdate = !1;
  54725. var t, i, n = [], r = this.getPoint(0), o = 0;
  54726. for (n.push(0),
  54727. i = 1; i <= e; i++)
  54728. t = this.getPoint(i / e),
  54729. o += t.distanceTo(r),
  54730. n.push(o),
  54731. r = t;
  54732. return this.cacheArcLengths = n,
  54733. n
  54734. },
  54735. updateArcLengths: function() {
  54736. this.needsUpdate = !0,
  54737. this.getLengths()
  54738. },
  54739. getUtoTmapping: function(e, t) {
  54740. var i, n = this.getLengths(), r = 0, o = n.length;
  54741. i = t ? t : e * n[o - 1];
  54742. for (var a, s = 0, l = o - 1; s <= l; )
  54743. if (r = Math.floor(s + (l - s) / 2),
  54744. a = n[r] - i,
  54745. a < 0)
  54746. s = r + 1;
  54747. else {
  54748. if (!(a > 0)) {
  54749. l = r;
  54750. break
  54751. }
  54752. l = r - 1
  54753. }
  54754. if (r = l,
  54755. n[r] === i) {
  54756. var c = r / (o - 1);
  54757. return c
  54758. }
  54759. var h = n[r]
  54760. , u = n[r + 1]
  54761. , d = u - h
  54762. , p = (i - h) / d
  54763. , c = (r + p) / (o - 1);
  54764. return c
  54765. },
  54766. getTangent: function(e) {
  54767. var t = 1e-4
  54768. , i = e - t
  54769. , n = e + t;
  54770. i < 0 && (i = 0),
  54771. n > 1 && (n = 1);
  54772. var r = this.getPoint(i)
  54773. , o = this.getPoint(n)
  54774. , a = o.clone().sub(r);
  54775. return a.normalize()
  54776. },
  54777. getTangentAt: function(e) {
  54778. var t = this.getUtoTmapping(e);
  54779. return this.getTangent(t)
  54780. }
  54781. },
  54782. n.Curve.create = function(e, t) {
  54783. return e.prototype = Object.create(n.Curve.prototype),
  54784. e.prototype.constructor = e,
  54785. e.prototype.getPoint = t,
  54786. e
  54787. }
  54788. ,
  54789. n.CurvePath = function() {
  54790. this.curves = [],
  54791. this.autoClose = !1
  54792. }
  54793. ,
  54794. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  54795. n.CurvePath.prototype.constructor = n.CurvePath,
  54796. n.CurvePath.prototype.add = function(e) {
  54797. this.curves.push(e)
  54798. }
  54799. ,
  54800. n.CurvePath.prototype.closePath = function() {
  54801. var e = this.curves[0].getPoint(0)
  54802. , t = this.curves[this.curves.length - 1].getPoint(1);
  54803. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  54804. }
  54805. ,
  54806. n.CurvePath.prototype.getPoint = function(e) {
  54807. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  54808. if (i[n] >= t) {
  54809. var r = i[n] - t
  54810. , o = this.curves[n]
  54811. , a = 1 - r / o.getLength();
  54812. return o.getPointAt(a)
  54813. }
  54814. n++
  54815. }
  54816. return null
  54817. }
  54818. ,
  54819. n.CurvePath.prototype.getLength = function() {
  54820. var e = this.getCurveLengths();
  54821. return e[e.length - 1]
  54822. }
  54823. ,
  54824. n.CurvePath.prototype.getCurveLengths = function() {
  54825. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  54826. return this.cacheLengths;
  54827. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  54828. t += this.curves[i].getLength(),
  54829. e.push(t);
  54830. return this.cacheLengths = e,
  54831. e
  54832. }
  54833. ,
  54834. n.CurvePath.prototype.createPointsGeometry = function(e) {
  54835. var t = this.getPoints(e);
  54836. return this.createGeometry(t)
  54837. }
  54838. ,
  54839. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  54840. var t = this.getSpacedPoints(e);
  54841. return this.createGeometry(t)
  54842. }
  54843. ,
  54844. n.CurvePath.prototype.createGeometry = function(e) {
  54845. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  54846. var o = e[i];
  54847. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  54848. }
  54849. return t
  54850. }
  54851. ,
  54852. n.Font = function(e) {
  54853. this.data = e
  54854. }
  54855. ,
  54856. n.Font.prototype = {
  54857. constructor: n.Font,
  54858. generateShapes: function(e, t, i) {
  54859. function r(e) {
  54860. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  54861. var c = o(i[l], n, r);
  54862. r += c.offset,
  54863. s.push(c.path)
  54864. }
  54865. return s
  54866. }
  54867. function o(e, t, r) {
  54868. var o = a.glyphs[e] || a.glyphs["?"];
  54869. if (o) {
  54870. 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;
  54871. if (o.o)
  54872. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  54873. var _ = E[b++];
  54874. switch (_) {
  54875. case "m":
  54876. s = E[b++] * t + r,
  54877. l = E[b++] * t,
  54878. A.moveTo(s, l);
  54879. break;
  54880. case "l":
  54881. s = E[b++] * t + r,
  54882. l = E[b++] * t,
  54883. A.lineTo(s, l);
  54884. break;
  54885. case "q":
  54886. if (c = E[b++] * t + r,
  54887. h = E[b++] * t,
  54888. p = E[b++] * t + r,
  54889. f = E[b++] * t,
  54890. A.quadraticCurveTo(p, f, c, h),
  54891. v = y[y.length - 1]) {
  54892. u = v.x,
  54893. d = v.y;
  54894. for (var T = 1; T <= i; T++) {
  54895. var x = T / i;
  54896. C(x, u, p, c),
  54897. C(x, d, f, h)
  54898. }
  54899. }
  54900. break;
  54901. case "b":
  54902. if (c = E[b++] * t + r,
  54903. h = E[b++] * t,
  54904. p = E[b++] * t + r,
  54905. f = E[b++] * t,
  54906. g = E[b++] * t + r,
  54907. m = E[b++] * t,
  54908. A.bezierCurveTo(p, f, g, m, c, h),
  54909. v = y[y.length - 1]) {
  54910. u = v.x,
  54911. d = v.y;
  54912. for (var T = 1; T <= i; T++) {
  54913. var x = T / i;
  54914. I(x, u, p, g, c),
  54915. I(x, d, f, m, h)
  54916. }
  54917. }
  54918. }
  54919. }
  54920. return {
  54921. offset: o.ha * t,
  54922. path: A
  54923. }
  54924. }
  54925. }
  54926. void 0 === t && (t = 100),
  54927. void 0 === i && (i = 4);
  54928. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  54929. Array.prototype.push.apply(l, s[c].toShapes());
  54930. return l
  54931. }
  54932. },
  54933. n.Path = function(e) {
  54934. n.CurvePath.call(this),
  54935. this.actions = [],
  54936. e && this.fromPoints(e)
  54937. }
  54938. ,
  54939. n.Path.prototype = Object.create(n.CurvePath.prototype),
  54940. n.Path.prototype.constructor = n.Path,
  54941. n.Path.prototype.fromPoints = function(e) {
  54942. this.moveTo(e[0].x, e[0].y);
  54943. for (var t = 1, i = e.length; t < i; t++)
  54944. this.lineTo(e[t].x, e[t].y)
  54945. }
  54946. ,
  54947. n.Path.prototype.moveTo = function(e, t) {
  54948. this.actions.push({
  54949. action: "moveTo",
  54950. args: [e, t]
  54951. })
  54952. }
  54953. ,
  54954. n.Path.prototype.lineTo = function(e, t) {
  54955. var i = this.actions[this.actions.length - 1].args
  54956. , r = i[i.length - 2]
  54957. , o = i[i.length - 1]
  54958. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  54959. this.curves.push(a),
  54960. this.actions.push({
  54961. action: "lineTo",
  54962. args: [e, t]
  54963. })
  54964. }
  54965. ,
  54966. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  54967. var o = this.actions[this.actions.length - 1].args
  54968. , a = o[o.length - 2]
  54969. , s = o[o.length - 1]
  54970. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  54971. this.curves.push(l),
  54972. this.actions.push({
  54973. action: "quadraticCurveTo",
  54974. args: [e, t, i, r]
  54975. })
  54976. }
  54977. ,
  54978. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  54979. var s = this.actions[this.actions.length - 1].args
  54980. , l = s[s.length - 2]
  54981. , c = s[s.length - 1]
  54982. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  54983. this.curves.push(h),
  54984. this.actions.push({
  54985. action: "bezierCurveTo",
  54986. args: [e, t, i, r, o, a]
  54987. })
  54988. }
  54989. ,
  54990. n.Path.prototype.splineThru = function(e) {
  54991. var t = Array.prototype.slice.call(arguments)
  54992. , i = this.actions[this.actions.length - 1].args
  54993. , r = i[i.length - 2]
  54994. , o = i[i.length - 1]
  54995. , a = [new n.Vector2(r,o)];
  54996. Array.prototype.push.apply(a, e);
  54997. var s = new n.SplineCurve(a);
  54998. this.curves.push(s),
  54999. this.actions.push({
  55000. action: "splineThru",
  55001. args: t
  55002. })
  55003. }
  55004. ,
  55005. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55006. var a = this.actions[this.actions.length - 1].args
  55007. , s = a[a.length - 2]
  55008. , l = a[a.length - 1];
  55009. this.absarc(e + s, t + l, i, n, r, o)
  55010. }
  55011. ,
  55012. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55013. this.absellipse(e, t, i, i, n, r, o)
  55014. }
  55015. ,
  55016. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55017. var l = this.actions[this.actions.length - 1].args
  55018. , c = l[l.length - 2]
  55019. , h = l[l.length - 1];
  55020. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55021. }
  55022. ,
  55023. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55024. var c = [e, t, i, r, o, a, s, l || 0]
  55025. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55026. this.curves.push(h);
  55027. var u = h.getPoint(1);
  55028. c.push(u.x),
  55029. c.push(u.y),
  55030. this.actions.push({
  55031. action: "ellipse",
  55032. args: c
  55033. })
  55034. }
  55035. ,
  55036. n.Path.prototype.getSpacedPoints = function(e) {
  55037. e || (e = 40);
  55038. for (var t = [], i = 0; i < e; i++)
  55039. t.push(this.getPoint(i / e));
  55040. return this.autoClose && t.push(t[0]),
  55041. t
  55042. }
  55043. ,
  55044. n.Path.prototype.getPoints = function(e) {
  55045. e = e || 12;
  55046. 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++) {
  55047. var A = this.actions[m]
  55048. , y = A.action
  55049. , C = A.args;
  55050. switch (y) {
  55051. case "moveTo":
  55052. g.push(new n.Vector2(C[0],C[1]));
  55053. break;
  55054. case "lineTo":
  55055. g.push(new n.Vector2(C[0],C[1]));
  55056. break;
  55057. case "quadraticCurveTo":
  55058. t = C[2],
  55059. i = C[3],
  55060. a = C[0],
  55061. s = C[1],
  55062. g.length > 0 ? (h = g[g.length - 1],
  55063. l = h.x,
  55064. c = h.y) : (h = this.actions[m - 1].args,
  55065. l = h[h.length - 2],
  55066. c = h[h.length - 1]);
  55067. for (var I = 1; I <= e; I++) {
  55068. var E = I / e;
  55069. u = p(E, l, a, t),
  55070. d = p(E, c, s, i),
  55071. g.push(new n.Vector2(u,d))
  55072. }
  55073. break;
  55074. case "bezierCurveTo":
  55075. t = C[4],
  55076. i = C[5],
  55077. a = C[0],
  55078. s = C[1],
  55079. r = C[2],
  55080. o = C[3],
  55081. g.length > 0 ? (h = g[g.length - 1],
  55082. l = h.x,
  55083. c = h.y) : (h = this.actions[m - 1].args,
  55084. l = h[h.length - 2],
  55085. c = h[h.length - 1]);
  55086. for (var I = 1; I <= e; I++) {
  55087. var E = I / e;
  55088. u = f(E, l, a, r, t),
  55089. d = f(E, c, s, o, i),
  55090. g.push(new n.Vector2(u,d))
  55091. }
  55092. break;
  55093. case "splineThru":
  55094. h = this.actions[m - 1].args;
  55095. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55096. , w = [b]
  55097. , _ = e * C[0].length;
  55098. w = w.concat(C[0]);
  55099. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55100. g.push(T.getPointAt(I / _));
  55101. break;
  55102. case "arc":
  55103. 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++) {
  55104. var E = I / N;
  55105. L || (E = 1 - E),
  55106. x = P + E * D,
  55107. u = S + R * Math.cos(x),
  55108. d = M + R * Math.sin(x),
  55109. g.push(new n.Vector2(u,d))
  55110. }
  55111. break;
  55112. case "ellipse":
  55113. 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;
  55114. 0 !== k && (B = Math.cos(k),
  55115. F = Math.sin(k));
  55116. for (var I = 1; I <= N; I++) {
  55117. var E = I / N;
  55118. if (L || (E = 1 - E),
  55119. x = P + E * D,
  55120. u = S + V * Math.cos(x),
  55121. d = M + U * Math.sin(x),
  55122. 0 !== k) {
  55123. var H = u
  55124. , G = d;
  55125. u = (H - S) * B - (G - M) * F + S,
  55126. d = (H - S) * F + (G - M) * B + M
  55127. }
  55128. g.push(new n.Vector2(u,d))
  55129. }
  55130. }
  55131. }
  55132. var z = g[g.length - 1];
  55133. 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),
  55134. this.autoClose && g.push(g[0]),
  55135. g
  55136. }
  55137. ,
  55138. n.Path.prototype.toShapes = function(e, t) {
  55139. function i(e) {
  55140. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55141. var a = e[r]
  55142. , s = a.args
  55143. , l = a.action;
  55144. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55145. i = new n.Path),
  55146. i[l].apply(i, s)
  55147. }
  55148. return 0 !== i.actions.length && t.push(i),
  55149. t
  55150. }
  55151. function r(e) {
  55152. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55153. var o = e[i]
  55154. , a = new n.Shape;
  55155. a.actions = o.actions,
  55156. a.curves = o.curves,
  55157. t.push(a)
  55158. }
  55159. return t
  55160. }
  55161. function o(e, t) {
  55162. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55163. var a = t[r]
  55164. , s = t[o]
  55165. , l = s.x - a.x
  55166. , c = s.y - a.y;
  55167. if (Math.abs(c) > Number.EPSILON) {
  55168. if (c < 0 && (a = t[o],
  55169. l = -l,
  55170. s = t[r],
  55171. c = -c),
  55172. e.y < a.y || e.y > s.y)
  55173. continue;
  55174. if (e.y === a.y) {
  55175. if (e.x === a.x)
  55176. return !0
  55177. } else {
  55178. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55179. if (0 === h)
  55180. return !0;
  55181. if (h < 0)
  55182. continue;
  55183. n = !n
  55184. }
  55185. } else {
  55186. if (e.y !== a.y)
  55187. continue;
  55188. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55189. return !0
  55190. }
  55191. }
  55192. return n
  55193. }
  55194. var a = n.ShapeUtils.isClockWise
  55195. , s = i(this.actions);
  55196. if (0 === s.length)
  55197. return [];
  55198. if (t === !0)
  55199. return r(s);
  55200. var l, c, h, u = [];
  55201. if (1 === s.length)
  55202. return c = s[0],
  55203. h = new n.Shape,
  55204. h.actions = c.actions,
  55205. h.curves = c.curves,
  55206. u.push(h),
  55207. u;
  55208. var d = !a(s[0].getPoints());
  55209. d = e ? !d : d;
  55210. var p, f = [], g = [], m = [], v = 0;
  55211. g[v] = void 0,
  55212. m[v] = [];
  55213. for (var A = 0, y = s.length; A < y; A++)
  55214. c = s[A],
  55215. p = c.getPoints(),
  55216. l = a(p),
  55217. l = e ? !l : l,
  55218. l ? (!d && g[v] && v++,
  55219. g[v] = {
  55220. s: new n.Shape,
  55221. p: p
  55222. },
  55223. g[v].s.actions = c.actions,
  55224. g[v].s.curves = c.curves,
  55225. d && v++,
  55226. m[v] = []) : m[v].push({
  55227. h: c,
  55228. p: p[0]
  55229. });
  55230. if (!g[0])
  55231. return r(s);
  55232. if (g.length > 1) {
  55233. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55234. f[E] = [];
  55235. for (var E = 0, b = g.length; E < b; E++)
  55236. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55237. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55238. o(T.p, g[S].p) && (E !== S && I.push({
  55239. froms: E,
  55240. tos: S,
  55241. hole: _
  55242. }),
  55243. x ? (x = !1,
  55244. f[S].push(T)) : C = !0);
  55245. x && f[E].push(T)
  55246. }
  55247. I.length > 0 && (C || (m = f))
  55248. }
  55249. for (var M, A = 0, R = g.length; A < R; A++) {
  55250. h = g[A].s,
  55251. u.push(h),
  55252. M = m[A];
  55253. for (var P = 0, O = M.length; P < O; P++)
  55254. h.holes.push(M[P].h)
  55255. }
  55256. return u
  55257. }
  55258. ,
  55259. n.Shape = function() {
  55260. n.Path.apply(this, arguments),
  55261. this.holes = []
  55262. }
  55263. ,
  55264. n.Shape.prototype = Object.create(n.Path.prototype),
  55265. n.Shape.prototype.constructor = n.Shape,
  55266. n.Shape.prototype.extrude = function(e) {
  55267. return new n.ExtrudeGeometry(this,e)
  55268. }
  55269. ,
  55270. n.Shape.prototype.makeGeometry = function(e) {
  55271. return new n.ShapeGeometry(this,e)
  55272. }
  55273. ,
  55274. n.Shape.prototype.getPointsHoles = function(e) {
  55275. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55276. t[i] = this.holes[i].getPoints(e);
  55277. return t
  55278. }
  55279. ,
  55280. n.Shape.prototype.extractAllPoints = function(e) {
  55281. return {
  55282. shape: this.getPoints(e),
  55283. holes: this.getPointsHoles(e)
  55284. }
  55285. }
  55286. ,
  55287. n.Shape.prototype.extractPoints = function(e) {
  55288. return this.extractAllPoints(e)
  55289. }
  55290. ,
  55291. n.LineCurve = function(e, t) {
  55292. this.v1 = e,
  55293. this.v2 = t
  55294. }
  55295. ,
  55296. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55297. n.LineCurve.prototype.constructor = n.LineCurve,
  55298. n.LineCurve.prototype.getPoint = function(e) {
  55299. var t = this.v2.clone().sub(this.v1);
  55300. return t.multiplyScalar(e).add(this.v1),
  55301. t
  55302. }
  55303. ,
  55304. n.LineCurve.prototype.getPointAt = function(e) {
  55305. return this.getPoint(e)
  55306. }
  55307. ,
  55308. n.LineCurve.prototype.getTangent = function(e) {
  55309. var t = this.v2.clone().sub(this.v1);
  55310. return t.normalize()
  55311. }
  55312. ,
  55313. n.QuadraticBezierCurve = function(e, t, i) {
  55314. this.v0 = e,
  55315. this.v1 = t,
  55316. this.v2 = i
  55317. }
  55318. ,
  55319. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55320. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55321. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55322. var t = n.ShapeUtils.b2;
  55323. 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))
  55324. }
  55325. ,
  55326. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55327. var t = n.CurveUtils.tangentQuadraticBezier;
  55328. 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()
  55329. }
  55330. ,
  55331. n.CubicBezierCurve = function(e, t, i, n) {
  55332. this.v0 = e,
  55333. this.v1 = t,
  55334. this.v2 = i,
  55335. this.v3 = n
  55336. }
  55337. ,
  55338. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55339. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55340. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55341. var t = n.ShapeUtils.b3;
  55342. 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))
  55343. }
  55344. ,
  55345. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55346. var t = n.CurveUtils.tangentCubicBezier;
  55347. 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()
  55348. }
  55349. ,
  55350. n.SplineCurve = function(e) {
  55351. this.points = void 0 == e ? [] : e
  55352. }
  55353. ,
  55354. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55355. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55356. n.SplineCurve.prototype.getPoint = function(e) {
  55357. var t = this.points
  55358. , i = (t.length - 1) * e
  55359. , r = Math.floor(i)
  55360. , o = i - r
  55361. , a = t[0 === r ? r : r - 1]
  55362. , s = t[r]
  55363. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55364. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55365. , h = n.CurveUtils.interpolate;
  55366. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55367. }
  55368. ,
  55369. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55370. this.aX = e,
  55371. this.aY = t,
  55372. this.xRadius = i,
  55373. this.yRadius = n,
  55374. this.aStartAngle = r,
  55375. this.aEndAngle = o,
  55376. this.aClockwise = a,
  55377. this.aRotation = s || 0
  55378. }
  55379. ,
  55380. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55381. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55382. n.EllipseCurve.prototype.getPoint = function(e) {
  55383. var t = this.aEndAngle - this.aStartAngle;
  55384. t < 0 && (t += 2 * Math.PI),
  55385. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55386. var i;
  55387. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55388. var r = this.aX + this.xRadius * Math.cos(i)
  55389. , o = this.aY + this.yRadius * Math.sin(i);
  55390. if (0 !== this.aRotation) {
  55391. var a = Math.cos(this.aRotation)
  55392. , s = Math.sin(this.aRotation)
  55393. , l = r
  55394. , c = o;
  55395. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55396. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55397. }
  55398. return new n.Vector2(r,o)
  55399. }
  55400. ,
  55401. n.ArcCurve = function(e, t, i, r, o, a) {
  55402. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55403. }
  55404. ,
  55405. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55406. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55407. n.LineCurve3 = n.Curve.create(function(e, t) {
  55408. this.v1 = e,
  55409. this.v2 = t
  55410. }, function(e) {
  55411. var t = new n.Vector3;
  55412. return t.subVectors(this.v2, this.v1),
  55413. t.multiplyScalar(e),
  55414. t.add(this.v1),
  55415. t
  55416. }),
  55417. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55418. this.v0 = e,
  55419. this.v1 = t,
  55420. this.v2 = i
  55421. }, function(e) {
  55422. var t = n.ShapeUtils.b2;
  55423. 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))
  55424. }),
  55425. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55426. this.v0 = e,
  55427. this.v1 = t,
  55428. this.v2 = i,
  55429. this.v3 = n
  55430. }, function(e) {
  55431. var t = n.ShapeUtils.b3;
  55432. 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))
  55433. }),
  55434. n.SplineCurve3 = n.Curve.create(function(e) {
  55435. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55436. this.points = void 0 == e ? [] : e
  55437. }, function(e) {
  55438. var t = this.points
  55439. , i = (t.length - 1) * e
  55440. , r = Math.floor(i)
  55441. , o = i - r
  55442. , a = t[0 == r ? r : r - 1]
  55443. , s = t[r]
  55444. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55445. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55446. , h = n.CurveUtils.interpolate;
  55447. 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))
  55448. }),
  55449. n.CatmullRomCurve3 = function() {
  55450. function e() {}
  55451. var t = new n.Vector3
  55452. , i = new e
  55453. , r = new e
  55454. , o = new e;
  55455. return e.prototype.init = function(e, t, i, n) {
  55456. this.c0 = e,
  55457. this.c1 = i,
  55458. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55459. this.c3 = 2 * e - 2 * t + i + n
  55460. }
  55461. ,
  55462. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55463. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55464. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55465. s *= o,
  55466. l *= o,
  55467. this.init(t, i, s, l)
  55468. }
  55469. ,
  55470. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55471. this.init(t, i, r * (i - e), r * (n - t))
  55472. }
  55473. ,
  55474. e.prototype.calc = function(e) {
  55475. var t = e * e
  55476. , i = t * e;
  55477. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55478. }
  55479. ,
  55480. n.Curve.create(function(e) {
  55481. this.points = e || [],
  55482. this.closed = !1
  55483. }, function(e) {
  55484. var a, s, l, c, h = this.points;
  55485. c = h.length,
  55486. c < 2 && console.log("duh, you need at least 2 points"),
  55487. a = (c - (this.closed ? 0 : 1)) * e,
  55488. s = Math.floor(a),
  55489. l = a - s,
  55490. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55491. l = 1);
  55492. var u, d, p, f;
  55493. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55494. u = t),
  55495. d = h[s % c],
  55496. p = h[(s + 1) % c],
  55497. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55498. f = t),
  55499. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55500. var g = "chordal" === this.type ? .5 : .25
  55501. , m = Math.pow(u.distanceToSquared(d), g)
  55502. , v = Math.pow(d.distanceToSquared(p), g)
  55503. , A = Math.pow(p.distanceToSquared(f), g);
  55504. v < 1e-4 && (v = 1),
  55505. m < 1e-4 && (m = v),
  55506. A < 1e-4 && (A = v),
  55507. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55508. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55509. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55510. } else if ("catmullrom" === this.type) {
  55511. var y = void 0 !== this.tension ? this.tension : .5;
  55512. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55513. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55514. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55515. }
  55516. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55517. return C
  55518. })
  55519. }(),
  55520. n.ClosedSplineCurve3 = function(e) {
  55521. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55522. n.CatmullRomCurve3.call(this, e),
  55523. this.type = "catmullrom",
  55524. this.closed = !0
  55525. }
  55526. ,
  55527. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55528. n.BoxGeometry = function(e, t, i, r, o, a) {
  55529. n.Geometry.call(this),
  55530. this.type = "BoxGeometry",
  55531. this.parameters = {
  55532. width: e,
  55533. height: t,
  55534. depth: i,
  55535. widthSegments: r,
  55536. heightSegments: o,
  55537. depthSegments: a
  55538. },
  55539. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55540. this.mergeVertices()
  55541. }
  55542. ,
  55543. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55544. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55545. n.CubeGeometry = n.BoxGeometry,
  55546. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55547. function s(e, t, i) {
  55548. var n = 0;
  55549. return n += e * t * 2,
  55550. n += e * i * 2,
  55551. n += i * t * 2,
  55552. 4 * n
  55553. }
  55554. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55555. 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++)
  55556. for (var L = O * b - _, D = 0; D < x; D++) {
  55557. var N = D * E - w;
  55558. P[e] = N * r,
  55559. P[t] = L * o,
  55560. P[i] = T,
  55561. p[m] = P.x,
  55562. p[m + 1] = P.y,
  55563. p[m + 2] = P.z,
  55564. P[e] = 0,
  55565. P[t] = 0,
  55566. P[i] = l > 0 ? 1 : -1,
  55567. f[m] = P.x,
  55568. f[m + 1] = P.y,
  55569. f[m + 2] = P.z,
  55570. g[v] = D / h,
  55571. g[v + 1] = 1 - O / u,
  55572. m += 3,
  55573. v += 2,
  55574. M += 1
  55575. }
  55576. for (O = 0; O < u; O++)
  55577. for (D = 0; D < h; D++) {
  55578. var B = y + D + x * O
  55579. , F = y + D + x * (O + 1)
  55580. , V = y + (D + 1) + x * (O + 1)
  55581. , U = y + (D + 1) + x * O;
  55582. d[A] = B,
  55583. d[A + 1] = F,
  55584. d[A + 2] = U,
  55585. d[A + 3] = F,
  55586. d[A + 4] = V,
  55587. d[A + 5] = U,
  55588. A += 6,
  55589. R += 6
  55590. }
  55591. c.addGroup(C, R, I),
  55592. C += R,
  55593. y += M
  55594. }
  55595. n.BufferGeometry.call(this),
  55596. this.type = "BoxBufferGeometry",
  55597. this.parameters = {
  55598. width: e,
  55599. height: t,
  55600. depth: i,
  55601. widthSegments: r,
  55602. heightSegments: o,
  55603. depthSegments: a
  55604. };
  55605. var c = this;
  55606. r = Math.floor(r) || 1,
  55607. o = Math.floor(o) || 1,
  55608. a = Math.floor(a) || 1;
  55609. var h = s(r, o, a)
  55610. , u = h / 4 * 6
  55611. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55612. , p = new Float32Array(3 * h)
  55613. , f = new Float32Array(3 * h)
  55614. , g = new Float32Array(2 * h)
  55615. , m = 0
  55616. , v = 0
  55617. , A = 0
  55618. , y = 0
  55619. , C = 0;
  55620. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55621. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55622. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55623. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55624. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55625. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55626. this.setIndex(new n.BufferAttribute(d,1)),
  55627. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55628. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55629. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55630. }
  55631. ,
  55632. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55633. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55634. n.CircleGeometry = function(e, t, i, r) {
  55635. n.Geometry.call(this),
  55636. this.type = "CircleGeometry",
  55637. this.parameters = {
  55638. radius: e,
  55639. segments: t,
  55640. thetaStart: i,
  55641. thetaLength: r
  55642. },
  55643. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55644. }
  55645. ,
  55646. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55647. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55648. n.CircleBufferGeometry = function(e, t, i, r) {
  55649. n.BufferGeometry.call(this),
  55650. this.type = "CircleBufferGeometry",
  55651. this.parameters = {
  55652. radius: e,
  55653. segments: t,
  55654. thetaStart: i,
  55655. thetaLength: r
  55656. },
  55657. e = e || 50,
  55658. t = void 0 !== t ? Math.max(3, t) : 8,
  55659. i = void 0 !== i ? i : 0,
  55660. r = void 0 !== r ? r : 2 * Math.PI;
  55661. var o = t + 2
  55662. , a = new Float32Array(3 * o)
  55663. , s = new Float32Array(3 * o)
  55664. , l = new Float32Array(2 * o);
  55665. s[2] = 1,
  55666. l[0] = .5,
  55667. l[1] = .5;
  55668. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55669. h += 3,
  55670. u += 2) {
  55671. var d = i + c / t * r;
  55672. a[h] = e * Math.cos(d),
  55673. a[h + 1] = e * Math.sin(d),
  55674. s[h + 2] = 1,
  55675. l[u] = (a[h] / e + 1) / 2,
  55676. l[u + 1] = (a[h + 1] / e + 1) / 2
  55677. }
  55678. for (var p = [], h = 1; h <= t; h++)
  55679. p.push(h, h + 1, 0);
  55680. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55681. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55682. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55683. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55684. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55685. }
  55686. ,
  55687. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55688. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55689. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55690. function c() {
  55691. var e = (r + 1) * (o + 1);
  55692. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55693. e
  55694. }
  55695. function h() {
  55696. var e = r * o * 2 * 3;
  55697. return a === !1 && (e += 2 * r * 3),
  55698. e
  55699. }
  55700. function u() {
  55701. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55702. for (c = 0; c <= o; c++) {
  55703. var p = []
  55704. , f = c / o
  55705. , b = f * (t - e) + e;
  55706. for (a = 0; a <= r; a++) {
  55707. var w = a / r;
  55708. u.x = b * Math.sin(w * l + s),
  55709. u.y = -f * i + E,
  55710. u.z = b * Math.cos(w * l + s),
  55711. m.setXYZ(y, u.x, u.y, u.z),
  55712. h.copy(u),
  55713. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55714. h.z = Math.cos(w * l + s)),
  55715. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55716. v.setXYZ(y, h.x, h.y, h.z),
  55717. A.setXY(y, w, 1 - f),
  55718. p.push(y),
  55719. y++
  55720. }
  55721. I.push(p)
  55722. }
  55723. for (a = 0; a < r; a++)
  55724. for (c = 0; c < o; c++) {
  55725. var _ = I[c][a]
  55726. , T = I[c + 1][a]
  55727. , x = I[c + 1][a + 1]
  55728. , S = I[c][a + 1];
  55729. g.setX(C, _),
  55730. C++,
  55731. g.setX(C, T),
  55732. C++,
  55733. g.setX(C, S),
  55734. C++,
  55735. g.setX(C, T),
  55736. C++,
  55737. g.setX(C, x),
  55738. C++,
  55739. g.setX(C, S),
  55740. C++
  55741. }
  55742. }
  55743. function d(i) {
  55744. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55745. for (a = y,
  55746. o = 1; o <= r; o++)
  55747. m.setXYZ(y, 0, E * p, 0),
  55748. v.setXYZ(y, 0, p, 0),
  55749. i === !0 ? (h.x = o / r,
  55750. h.y = 0) : (h.x = (o - 1) / r,
  55751. h.y = 1),
  55752. A.setXY(y, h.x, h.y),
  55753. y++;
  55754. for (c = y,
  55755. o = 0; o <= r; o++) {
  55756. var f = o / r;
  55757. u.x = d * Math.sin(f * l + s),
  55758. u.y = E * p,
  55759. u.z = d * Math.cos(f * l + s),
  55760. m.setXYZ(y, u.x, u.y, u.z),
  55761. v.setXYZ(y, 0, p, 0),
  55762. A.setXY(y, f, i === !0 ? 1 : 0),
  55763. y++
  55764. }
  55765. for (o = 0; o < r; o++) {
  55766. var I = a + o
  55767. , b = c + o;
  55768. i === !0 ? (g.setX(C, b),
  55769. C++,
  55770. g.setX(C, b + 1),
  55771. C++,
  55772. g.setX(C, I),
  55773. C++) : (g.setX(C, b + 1),
  55774. C++,
  55775. g.setX(C, b),
  55776. C++,
  55777. g.setX(C, I),
  55778. C++)
  55779. }
  55780. }
  55781. n.BufferGeometry.call(this),
  55782. this.type = "CylinderBufferGeometry",
  55783. this.parameters = {
  55784. radiusTop: e,
  55785. radiusBottom: t,
  55786. height: i,
  55787. radialSegments: r,
  55788. heightSegments: o,
  55789. openEnded: a,
  55790. thetaStart: s,
  55791. thetaLength: l
  55792. },
  55793. e = void 0 !== e ? e : 20,
  55794. t = void 0 !== t ? t : 20,
  55795. i = void 0 !== i ? i : 100,
  55796. r = Math.floor(r) || 8,
  55797. o = Math.floor(o) || 1,
  55798. a = void 0 !== a && a,
  55799. s = void 0 !== s ? s : 0,
  55800. l = void 0 !== l ? l : 2 * Math.PI;
  55801. var p = c()
  55802. , f = h()
  55803. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  55804. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  55805. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  55806. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  55807. , y = 0
  55808. , C = 0
  55809. , I = []
  55810. , E = i / 2;
  55811. u(),
  55812. a === !1 && (e > 0 && d(!0),
  55813. t > 0 && d(!1)),
  55814. this.setIndex(g),
  55815. this.addAttribute("position", m),
  55816. this.addAttribute("normal", v),
  55817. this.addAttribute("uv", A)
  55818. }
  55819. ,
  55820. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55821. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  55822. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  55823. n.Geometry.call(this),
  55824. this.type = "CylinderGeometry",
  55825. this.parameters = {
  55826. radiusTop: e,
  55827. radiusBottom: t,
  55828. height: i,
  55829. radialSegments: r,
  55830. heightSegments: o,
  55831. openEnded: a,
  55832. thetaStart: s,
  55833. thetaLength: l
  55834. },
  55835. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  55836. this.mergeVertices()
  55837. }
  55838. ,
  55839. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  55840. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  55841. n.EdgesGeometry = function(e, t) {
  55842. function i(e, t) {
  55843. return e - t
  55844. }
  55845. n.BufferGeometry.call(this),
  55846. t = void 0 !== t ? t : 1;
  55847. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  55848. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  55849. r.fromBufferGeometry(e)) : r = e.clone(),
  55850. r.mergeVertices(),
  55851. r.computeFaceNormals();
  55852. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  55853. for (var p = h[u], f = 0; f < 3; f++) {
  55854. a[0] = p[l[f]],
  55855. a[1] = p[l[(f + 1) % 3]],
  55856. a.sort(i);
  55857. var g = a.toString();
  55858. void 0 === s[g] ? s[g] = {
  55859. vert1: a[0],
  55860. vert2: a[1],
  55861. face1: u,
  55862. face2: void 0
  55863. } : s[g].face2 = u
  55864. }
  55865. var m = [];
  55866. for (var g in s) {
  55867. var v = s[g];
  55868. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  55869. var A = c[v.vert1];
  55870. m.push(A.x),
  55871. m.push(A.y),
  55872. m.push(A.z),
  55873. A = c[v.vert2],
  55874. m.push(A.x),
  55875. m.push(A.y),
  55876. m.push(A.z)
  55877. }
  55878. }
  55879. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  55880. }
  55881. ,
  55882. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55883. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  55884. n.ExtrudeGeometry = function(e, t) {
  55885. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  55886. this.type = "ExtrudeGeometry",
  55887. e = Array.isArray(e) ? e : [e],
  55888. this.addShapeList(e, t),
  55889. void this.computeFaceNormals())
  55890. }
  55891. ;
  55892. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  55893. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  55894. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  55895. for (var i = e.length, n = 0; n < i; n++) {
  55896. var r = e[n];
  55897. this.addShape(r, t)
  55898. }
  55899. }
  55900. ,
  55901. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  55902. function i(e, t, i) {
  55903. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  55904. t.clone().multiplyScalar(i).add(e)
  55905. }
  55906. function r(e, t, i) {
  55907. 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;
  55908. if (Math.abs(d) > Number.EPSILON) {
  55909. var p = Math.sqrt(u)
  55910. , f = Math.sqrt(c * c + h * h)
  55911. , g = t.x - l / p
  55912. , m = t.y + s / p
  55913. , v = i.x - h / f
  55914. , A = i.y + c / f
  55915. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  55916. r = g + s * y - e.x,
  55917. o = m + l * y - e.y;
  55918. var C = r * r + o * o;
  55919. if (C <= 2)
  55920. return new n.Vector2(r,o);
  55921. a = Math.sqrt(C / 2)
  55922. } else {
  55923. var I = !1;
  55924. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  55925. I ? (r = -l,
  55926. o = s,
  55927. a = Math.sqrt(u)) : (r = s,
  55928. o = l,
  55929. a = Math.sqrt(u / 2))
  55930. }
  55931. return new n.Vector2(r / a,o / a)
  55932. }
  55933. function o() {
  55934. if (C) {
  55935. var e = 0
  55936. , t = z * e;
  55937. for (Y = 0; Y < W; Y++)
  55938. G = N[Y],
  55939. c(G[2] + t, G[1] + t, G[0] + t);
  55940. for (e = E + 2 * y,
  55941. t = z * e,
  55942. Y = 0; Y < W; Y++)
  55943. G = N[Y],
  55944. c(G[0] + t, G[1] + t, G[2] + t)
  55945. } else {
  55946. for (Y = 0; Y < W; Y++)
  55947. G = N[Y],
  55948. c(G[2], G[1], G[0]);
  55949. for (Y = 0; Y < W; Y++)
  55950. G = N[Y],
  55951. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  55952. }
  55953. }
  55954. function a() {
  55955. var e = 0;
  55956. for (s(B, e),
  55957. e += B.length,
  55958. x = 0,
  55959. S = L.length; x < S; x++)
  55960. T = L[x],
  55961. s(T, e),
  55962. e += T.length
  55963. }
  55964. function s(e, t) {
  55965. var i, n;
  55966. for (Y = e.length; --Y >= 0; ) {
  55967. i = Y,
  55968. n = Y - 1,
  55969. n < 0 && (n = e.length - 1);
  55970. var r = 0
  55971. , o = E + 2 * y;
  55972. for (r = 0; r < o; r++) {
  55973. var a = z * r
  55974. , s = z * (r + 1)
  55975. , l = t + i + a
  55976. , c = t + n + a
  55977. , u = t + n + s
  55978. , d = t + i + s;
  55979. h(l, c, u, d, e, r, o, i, n)
  55980. }
  55981. }
  55982. }
  55983. function l(e, t, i) {
  55984. M.vertices.push(new n.Vector3(e,t,i))
  55985. }
  55986. function c(e, t, i) {
  55987. e += R,
  55988. t += R,
  55989. i += R,
  55990. M.faces.push(new n.Face3(e,t,i,null,null,0));
  55991. var r = _.generateTopUV(M, e, t, i);
  55992. M.faceVertexUvs[0].push(r)
  55993. }
  55994. function h(e, t, i, r, o, a, s, l, c) {
  55995. e += R,
  55996. t += R,
  55997. i += R,
  55998. r += R,
  55999. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56000. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56001. var h = _.generateSideWallUV(M, e, t, i, r);
  56002. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56003. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56004. }
  56005. 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;
  56006. b && (u = b.getSpacedPoints(E),
  56007. w = !0,
  56008. C = !1,
  56009. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56010. p = new n.Vector3,
  56011. f = new n.Vector3,
  56012. g = new n.Vector3),
  56013. C || (y = 0,
  56014. v = 0,
  56015. A = 0);
  56016. 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);
  56017. if (D) {
  56018. for (O = O.reverse(),
  56019. x = 0,
  56020. S = L.length; x < S; x++)
  56021. T = L[x],
  56022. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56023. D = !1
  56024. }
  56025. var N = n.ShapeUtils.triangulateShape(O, L)
  56026. , B = O;
  56027. for (x = 0,
  56028. S = L.length; x < S; x++)
  56029. T = L[x],
  56030. O = O.concat(T);
  56031. 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++,
  56032. Z++,
  56033. q++)
  56034. Z === X && (Z = 0),
  56035. q === X && (q = 0),
  56036. j[Y] = r(B[Y], B[Z], B[q]);
  56037. var K, Q = [], J = j.concat();
  56038. for (x = 0,
  56039. S = L.length; x < S; x++) {
  56040. for (T = L[x],
  56041. K = [],
  56042. Y = 0,
  56043. X = T.length,
  56044. Z = X - 1,
  56045. q = Y + 1; Y < X; Y++,
  56046. Z++,
  56047. q++)
  56048. Z === X && (Z = 0),
  56049. q === X && (q = 0),
  56050. K[Y] = r(T[Y], T[Z], T[q]);
  56051. Q.push(K),
  56052. J = J.concat(K)
  56053. }
  56054. for (F = 0; F < y; F++) {
  56055. for (U = F / y,
  56056. k = v * (1 - U),
  56057. V = A * Math.sin(U * Math.PI / 2),
  56058. Y = 0,
  56059. X = B.length; Y < X; Y++)
  56060. H = i(B[Y], j[Y], V),
  56061. l(H.x, H.y, -k);
  56062. for (x = 0,
  56063. S = L.length; x < S; x++)
  56064. for (T = L[x],
  56065. K = Q[x],
  56066. Y = 0,
  56067. X = T.length; Y < X; Y++)
  56068. H = i(T[Y], K[Y], V),
  56069. l(H.x, H.y, -k)
  56070. }
  56071. for (V = A,
  56072. Y = 0; Y < z; Y++)
  56073. H = C ? i(O[Y], J[Y], V) : O[Y],
  56074. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56075. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56076. g.copy(u[0]).add(f).add(p),
  56077. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56078. var $;
  56079. for ($ = 1; $ <= E; $++)
  56080. for (Y = 0; Y < z; Y++)
  56081. H = C ? i(O[Y], J[Y], V) : O[Y],
  56082. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56083. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56084. g.copy(u[$]).add(f).add(p),
  56085. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56086. for (F = y - 1; F >= 0; F--) {
  56087. for (U = F / y,
  56088. k = v * (1 - U),
  56089. V = A * Math.sin(U * Math.PI / 2),
  56090. Y = 0,
  56091. X = B.length; Y < X; Y++)
  56092. H = i(B[Y], j[Y], V),
  56093. l(H.x, H.y, m + k);
  56094. for (x = 0,
  56095. S = L.length; x < S; x++)
  56096. for (T = L[x],
  56097. K = Q[x],
  56098. Y = 0,
  56099. X = T.length; Y < X; Y++)
  56100. H = i(T[Y], K[Y], V),
  56101. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56102. }
  56103. o(),
  56104. a()
  56105. }
  56106. ,
  56107. n.ExtrudeGeometry.WorldUVGenerator = {
  56108. generateTopUV: function(e, t, i, r) {
  56109. var o = e.vertices
  56110. , a = o[t]
  56111. , s = o[i]
  56112. , l = o[r];
  56113. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56114. },
  56115. generateSideWallUV: function(e, t, i, r, o) {
  56116. var a = e.vertices
  56117. , s = a[t]
  56118. , l = a[i]
  56119. , c = a[r]
  56120. , h = a[o];
  56121. 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)]
  56122. }
  56123. },
  56124. n.ShapeGeometry = function(e, t) {
  56125. n.Geometry.call(this),
  56126. this.type = "ShapeGeometry",
  56127. Array.isArray(e) === !1 && (e = [e]),
  56128. this.addShapeList(e, t),
  56129. this.computeFaceNormals()
  56130. }
  56131. ,
  56132. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56133. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56134. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56135. for (var i = 0, n = e.length; i < n; i++)
  56136. this.addShape(e[i], t);
  56137. return this
  56138. }
  56139. ,
  56140. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56141. void 0 === t && (t = {});
  56142. 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);
  56143. if (p) {
  56144. for (u = u.reverse(),
  56145. i = 0,
  56146. r = d.length; i < r; i++)
  56147. o = d[i],
  56148. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56149. p = !1
  56150. }
  56151. var f = n.ShapeUtils.triangulateShape(u, d);
  56152. for (i = 0,
  56153. r = d.length; i < r; i++)
  56154. o = d[i],
  56155. u = u.concat(o);
  56156. var g, m, v = u.length, A = f.length;
  56157. for (i = 0; i < v; i++)
  56158. g = u[i],
  56159. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56160. for (i = 0; i < A; i++) {
  56161. m = f[i];
  56162. var y = m[0] + c
  56163. , C = m[1] + c
  56164. , I = m[2] + c;
  56165. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56166. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56167. }
  56168. }
  56169. ,
  56170. n.LatheBufferGeometry = function(e, t, i, r) {
  56171. n.BufferGeometry.call(this),
  56172. this.type = "LatheBufferGeometry",
  56173. this.parameters = {
  56174. points: e,
  56175. segments: t,
  56176. phiStart: i,
  56177. phiLength: r
  56178. },
  56179. t = Math.floor(t) || 12,
  56180. i = i || 0,
  56181. r = r || 2 * Math.PI,
  56182. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56183. 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),
  56184. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56185. for (a = 0; a <= t; a++) {
  56186. var A = i + a * g * r
  56187. , y = Math.sin(A)
  56188. , C = Math.cos(A);
  56189. for (s = 0; s <= e.length - 1; s++)
  56190. m.x = e[s].x * y,
  56191. m.y = e[s].y,
  56192. m.z = e[s].x * C,
  56193. u.setXYZ(p, m.x, m.y, m.z),
  56194. v.x = a / t,
  56195. v.y = s / (e.length - 1),
  56196. d.setXY(p, v.x, v.y),
  56197. p++
  56198. }
  56199. for (a = 0; a < t; a++)
  56200. for (s = 0; s < e.length - 1; s++) {
  56201. o = s + a * e.length;
  56202. var I = o
  56203. , E = o + e.length
  56204. , b = o + e.length + 1
  56205. , w = o + 1;
  56206. h.setX(f, I),
  56207. f++,
  56208. h.setX(f, E),
  56209. f++,
  56210. h.setX(f, w),
  56211. f++,
  56212. h.setX(f, E),
  56213. f++,
  56214. h.setX(f, b),
  56215. f++,
  56216. h.setX(f, w),
  56217. f++
  56218. }
  56219. if (this.setIndex(h),
  56220. this.addAttribute("position", u),
  56221. this.addAttribute("uv", d),
  56222. this.computeVertexNormals(),
  56223. r === 2 * Math.PI) {
  56224. var _ = this.attributes.normal.array
  56225. , T = new n.Vector3
  56226. , x = new n.Vector3
  56227. , S = new n.Vector3;
  56228. for (o = t * e.length * 3,
  56229. a = 0,
  56230. s = 0; a < e.length; a++,
  56231. s += 3)
  56232. T.x = _[s + 0],
  56233. T.y = _[s + 1],
  56234. T.z = _[s + 2],
  56235. x.x = _[o + s + 0],
  56236. x.y = _[o + s + 1],
  56237. x.z = _[o + s + 2],
  56238. S.addVectors(T, x).normalize(),
  56239. _[s + 0] = _[o + s + 0] = S.x,
  56240. _[s + 1] = _[o + s + 1] = S.y,
  56241. _[s + 2] = _[o + s + 2] = S.z
  56242. }
  56243. }
  56244. ,
  56245. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56246. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56247. n.LatheGeometry = function(e, t, i, r) {
  56248. n.Geometry.call(this),
  56249. this.type = "LatheGeometry",
  56250. this.parameters = {
  56251. points: e,
  56252. segments: t,
  56253. phiStart: i,
  56254. phiLength: r
  56255. },
  56256. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56257. this.mergeVertices()
  56258. }
  56259. ,
  56260. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56261. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56262. n.PlaneGeometry = function(e, t, i, r) {
  56263. n.Geometry.call(this),
  56264. this.type = "PlaneGeometry",
  56265. this.parameters = {
  56266. width: e,
  56267. height: t,
  56268. widthSegments: i,
  56269. heightSegments: r
  56270. },
  56271. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56272. }
  56273. ,
  56274. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56275. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56276. n.PlaneBufferGeometry = function(e, t, i, r) {
  56277. n.BufferGeometry.call(this),
  56278. this.type = "PlaneBufferGeometry",
  56279. this.parameters = {
  56280. width: e,
  56281. height: t,
  56282. widthSegments: i,
  56283. heightSegments: r
  56284. };
  56285. 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++)
  56286. for (var y = A * d - a, C = 0; C < c; C++) {
  56287. var I = C * u - o;
  56288. p[m] = I,
  56289. p[m + 1] = -y,
  56290. f[m + 2] = 1,
  56291. g[v] = C / s,
  56292. g[v + 1] = 1 - A / l,
  56293. m += 3,
  56294. v += 2
  56295. }
  56296. m = 0;
  56297. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56298. for (var C = 0; C < s; C++) {
  56299. var b = C + c * A
  56300. , w = C + c * (A + 1)
  56301. , _ = C + 1 + c * (A + 1)
  56302. , T = C + 1 + c * A;
  56303. E[m] = b,
  56304. E[m + 1] = w,
  56305. E[m + 2] = T,
  56306. E[m + 3] = w,
  56307. E[m + 4] = _,
  56308. E[m + 5] = T,
  56309. m += 6
  56310. }
  56311. this.setIndex(new n.BufferAttribute(E,1)),
  56312. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56313. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56314. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56315. }
  56316. ,
  56317. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56318. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56319. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56320. n.BufferGeometry.call(this),
  56321. this.type = "RingBufferGeometry",
  56322. this.parameters = {
  56323. innerRadius: e,
  56324. outerRadius: t,
  56325. thetaSegments: i,
  56326. phiSegments: r,
  56327. thetaStart: o,
  56328. thetaLength: a
  56329. },
  56330. e = e || 20,
  56331. t = t || 50,
  56332. o = void 0 !== o ? o : 0,
  56333. a = void 0 !== a ? a : 2 * Math.PI,
  56334. i = void 0 !== i ? Math.max(3, i) : 8,
  56335. r = void 0 !== r ? Math.max(1, r) : 1;
  56336. 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;
  56337. for (l = 0; l <= r; l++) {
  56338. for (c = 0; c <= i; c++)
  56339. s = o + c / i * a,
  56340. C.x = A * Math.cos(s),
  56341. C.y = A * Math.sin(s),
  56342. p.setXYZ(m, C.x, C.y, C.z),
  56343. f.setXYZ(m, 0, 0, 1),
  56344. I.x = (C.x / t + 1) / 2,
  56345. I.y = (C.y / t + 1) / 2,
  56346. g.setXY(m, I.x, I.y),
  56347. m++;
  56348. A += y
  56349. }
  56350. for (l = 0; l < r; l++) {
  56351. var E = l * (i + 1);
  56352. for (c = 0; c < i; c++) {
  56353. s = c + E;
  56354. var b = s
  56355. , w = s + i + 1
  56356. , _ = s + i + 2
  56357. , T = s + 1;
  56358. d.setX(v, b),
  56359. v++,
  56360. d.setX(v, w),
  56361. v++,
  56362. d.setX(v, _),
  56363. v++,
  56364. d.setX(v, b),
  56365. v++,
  56366. d.setX(v, _),
  56367. v++,
  56368. d.setX(v, T),
  56369. v++
  56370. }
  56371. }
  56372. this.setIndex(d),
  56373. this.addAttribute("position", p),
  56374. this.addAttribute("normal", f),
  56375. this.addAttribute("uv", g)
  56376. }
  56377. ,
  56378. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56379. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56380. n.RingGeometry = function(e, t, i, r, o, a) {
  56381. n.Geometry.call(this),
  56382. this.type = "RingGeometry",
  56383. this.parameters = {
  56384. innerRadius: e,
  56385. outerRadius: t,
  56386. thetaSegments: i,
  56387. phiSegments: r,
  56388. thetaStart: o,
  56389. thetaLength: a
  56390. },
  56391. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56392. }
  56393. ,
  56394. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56395. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56396. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56397. n.Geometry.call(this),
  56398. this.type = "SphereGeometry",
  56399. this.parameters = {
  56400. radius: e,
  56401. widthSegments: t,
  56402. heightSegments: i,
  56403. phiStart: r,
  56404. phiLength: o,
  56405. thetaStart: a,
  56406. thetaLength: s
  56407. },
  56408. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56409. }
  56410. ,
  56411. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56412. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56413. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56414. n.BufferGeometry.call(this),
  56415. this.type = "SphereBufferGeometry",
  56416. this.parameters = {
  56417. radius: e,
  56418. widthSegments: t,
  56419. heightSegments: i,
  56420. phiStart: r,
  56421. phiLength: o,
  56422. thetaStart: a,
  56423. thetaLength: s
  56424. },
  56425. e = e || 50,
  56426. t = Math.max(3, Math.floor(t) || 8),
  56427. i = Math.max(2, Math.floor(i) || 6),
  56428. r = void 0 !== r ? r : 0,
  56429. o = void 0 !== o ? o : 2 * Math.PI,
  56430. a = void 0 !== a ? a : 0,
  56431. s = void 0 !== s ? s : Math.PI;
  56432. 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++) {
  56433. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56434. var C = y / t
  56435. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56436. , E = e * Math.cos(a + A * s)
  56437. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56438. g.set(I, E, b).normalize(),
  56439. h.setXYZ(p, I, E, b),
  56440. u.setXYZ(p, g.x, g.y, g.z),
  56441. d.setXY(p, C, 1 - A),
  56442. v.push(p),
  56443. p++
  56444. }
  56445. f.push(v)
  56446. }
  56447. for (var w = [], m = 0; m < i; m++)
  56448. for (var y = 0; y < t; y++) {
  56449. var _ = f[m][y + 1]
  56450. , T = f[m][y]
  56451. , x = f[m + 1][y]
  56452. , S = f[m + 1][y + 1];
  56453. (0 !== m || a > 0) && w.push(_, T, S),
  56454. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56455. }
  56456. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56457. this.addAttribute("position", h),
  56458. this.addAttribute("normal", u),
  56459. this.addAttribute("uv", d),
  56460. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56461. }
  56462. ,
  56463. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56464. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56465. n.TextGeometry = function(e, t) {
  56466. t = t || {};
  56467. var i = t.font;
  56468. if (i instanceof n.Font == !1)
  56469. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56470. new n.Geometry;
  56471. var r = i.generateShapes(e, t.size, t.curveSegments);
  56472. t.amount = void 0 !== t.height ? t.height : 50,
  56473. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56474. void 0 === t.bevelSize && (t.bevelSize = 8),
  56475. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56476. n.ExtrudeGeometry.call(this, r, t),
  56477. this.type = "TextGeometry"
  56478. }
  56479. ,
  56480. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56481. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56482. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56483. n.BufferGeometry.call(this),
  56484. this.type = "TorusBufferGeometry",
  56485. this.parameters = {
  56486. radius: e,
  56487. tube: t,
  56488. radialSegments: i,
  56489. tubularSegments: r,
  56490. arc: o
  56491. },
  56492. e = e || 100,
  56493. t = t || 40,
  56494. i = Math.floor(i) || 8,
  56495. r = Math.floor(r) || 6,
  56496. o = o || 2 * Math.PI;
  56497. 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;
  56498. for (a = 0; a <= i; a++)
  56499. for (s = 0; s <= r; s++) {
  56500. var C = s / r * o
  56501. , I = a / i * Math.PI * 2;
  56502. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56503. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56504. A.z = t * Math.sin(I),
  56505. u[f] = A.x,
  56506. u[f + 1] = A.y,
  56507. u[f + 2] = A.z,
  56508. v.x = e * Math.cos(C),
  56509. v.y = e * Math.sin(C),
  56510. y.subVectors(A, v).normalize(),
  56511. d[f] = y.x,
  56512. d[f + 1] = y.y,
  56513. d[f + 2] = y.z,
  56514. p[g] = s / r,
  56515. p[g + 1] = a / i,
  56516. f += 3,
  56517. g += 2
  56518. }
  56519. for (a = 1; a <= i; a++)
  56520. for (s = 1; s <= r; s++) {
  56521. var E = (r + 1) * a + s - 1
  56522. , b = (r + 1) * (a - 1) + s - 1
  56523. , w = (r + 1) * (a - 1) + s
  56524. , _ = (r + 1) * a + s;
  56525. h[m] = E,
  56526. h[m + 1] = b,
  56527. h[m + 2] = _,
  56528. h[m + 3] = b,
  56529. h[m + 4] = w,
  56530. h[m + 5] = _,
  56531. m += 6
  56532. }
  56533. this.setIndex(new n.BufferAttribute(h,1)),
  56534. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56535. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56536. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56537. }
  56538. ,
  56539. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56540. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56541. n.TorusGeometry = function(e, t, i, r, o) {
  56542. n.Geometry.call(this),
  56543. this.type = "TorusGeometry",
  56544. this.parameters = {
  56545. radius: e,
  56546. tube: t,
  56547. radialSegments: i,
  56548. tubularSegments: r,
  56549. arc: o
  56550. },
  56551. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56552. }
  56553. ,
  56554. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56555. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56556. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56557. function s(e, t, i, n, r) {
  56558. var o = Math.cos(e)
  56559. , a = Math.sin(e)
  56560. , s = i / t * e
  56561. , l = Math.cos(s);
  56562. r.x = n * (2 + l) * .5 * o,
  56563. r.y = n * (2 + l) * a * .5,
  56564. r.z = n * Math.sin(s) * .5
  56565. }
  56566. n.BufferGeometry.call(this),
  56567. this.type = "TorusKnotBufferGeometry",
  56568. this.parameters = {
  56569. radius: e,
  56570. tube: t,
  56571. tubularSegments: i,
  56572. radialSegments: r,
  56573. p: o,
  56574. q: a
  56575. },
  56576. e = e || 100,
  56577. t = t || 40,
  56578. i = Math.floor(i) || 64,
  56579. r = Math.floor(r) || 8,
  56580. o = o || 2,
  56581. a = a || 3;
  56582. 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;
  56583. for (l = 0; l <= i; ++l) {
  56584. var T = l / i * o * Math.PI * 2;
  56585. for (s(T, o, a, e, I),
  56586. s(T + .01, o, a, e, E),
  56587. w.subVectors(E, I),
  56588. _.addVectors(E, I),
  56589. b.crossVectors(w, _),
  56590. _.crossVectors(b, w),
  56591. b.normalize(),
  56592. _.normalize(),
  56593. c = 0; c <= r; ++c) {
  56594. var x = c / r * Math.PI * 2
  56595. , S = -t * Math.cos(x)
  56596. , M = t * Math.sin(x);
  56597. A.x = I.x + (S * _.x + M * b.x),
  56598. A.y = I.y + (S * _.y + M * b.y),
  56599. A.z = I.z + (S * _.z + M * b.z),
  56600. p.setXYZ(m, A.x, A.y, A.z),
  56601. y.subVectors(A, I).normalize(),
  56602. f.setXYZ(m, y.x, y.y, y.z),
  56603. C.x = l / i,
  56604. C.y = c / r,
  56605. g.setXY(m, C.x, C.y),
  56606. m++
  56607. }
  56608. }
  56609. for (c = 1; c <= i; c++)
  56610. for (l = 1; l <= r; l++) {
  56611. var R = (r + 1) * (c - 1) + (l - 1)
  56612. , P = (r + 1) * c + (l - 1)
  56613. , O = (r + 1) * c + l
  56614. , L = (r + 1) * (c - 1) + l;
  56615. d.setX(v, R),
  56616. v++,
  56617. d.setX(v, P),
  56618. v++,
  56619. d.setX(v, L),
  56620. v++,
  56621. d.setX(v, P),
  56622. v++,
  56623. d.setX(v, O),
  56624. v++,
  56625. d.setX(v, L),
  56626. v++
  56627. }
  56628. this.setIndex(d),
  56629. this.addAttribute("position", p),
  56630. this.addAttribute("normal", f),
  56631. this.addAttribute("uv", g)
  56632. }
  56633. ,
  56634. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56635. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56636. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56637. n.Geometry.call(this),
  56638. this.type = "TorusKnotGeometry",
  56639. this.parameters = {
  56640. radius: e,
  56641. tube: t,
  56642. tubularSegments: i,
  56643. radialSegments: r,
  56644. p: o,
  56645. q: a
  56646. },
  56647. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56648. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56649. this.mergeVertices()
  56650. }
  56651. ,
  56652. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56653. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56654. n.TubeGeometry = function(e, t, i, r, o, a) {
  56655. function s(e, t, i) {
  56656. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56657. }
  56658. n.Geometry.call(this),
  56659. this.type = "TubeGeometry",
  56660. this.parameters = {
  56661. path: e,
  56662. segments: t,
  56663. radius: i,
  56664. radialSegments: r,
  56665. closed: o,
  56666. taper: a
  56667. },
  56668. t = t || 64,
  56669. i = i || 1,
  56670. r = r || 8,
  56671. o = o || !1,
  56672. a = a || n.TubeGeometry.NoTaper;
  56673. 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;
  56674. for (this.tangents = D,
  56675. this.normals = N,
  56676. this.binormals = B,
  56677. v = 0; v < P; v++)
  56678. for (M[v] = [],
  56679. u = v / (P - 1),
  56680. m = e.getPointAt(u),
  56681. l = D[v],
  56682. c = N[v],
  56683. h = B[v],
  56684. p = i * a(u),
  56685. A = 0; A < r; A++)
  56686. d = A / r * 2 * Math.PI,
  56687. f = -p * Math.cos(d),
  56688. g = p * Math.sin(d),
  56689. O.copy(m),
  56690. O.x += f * c.x + g * h.x,
  56691. O.y += f * c.y + g * h.y,
  56692. O.z += f * c.z + g * h.z,
  56693. M[v][A] = s(O.x, O.y, O.z);
  56694. for (v = 0; v < t; v++)
  56695. for (A = 0; A < r; A++)
  56696. y = o ? (v + 1) % t : v + 1,
  56697. C = (A + 1) % r,
  56698. I = M[v][A],
  56699. E = M[y][A],
  56700. b = M[y][C],
  56701. w = M[v][C],
  56702. _ = new n.Vector2(v / t,A / r),
  56703. T = new n.Vector2((v + 1) / t,A / r),
  56704. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56705. S = new n.Vector2(v / t,(A + 1) / r),
  56706. this.faces.push(new n.Face3(I,E,w)),
  56707. this.faceVertexUvs[0].push([_, T, S]),
  56708. this.faces.push(new n.Face3(E,b,w)),
  56709. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56710. this.computeFaceNormals(),
  56711. this.computeVertexNormals()
  56712. }
  56713. ,
  56714. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56715. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56716. n.TubeGeometry.NoTaper = function(e) {
  56717. return 1
  56718. }
  56719. ,
  56720. n.TubeGeometry.SinusoidalTaper = function(e) {
  56721. return Math.sin(Math.PI * e)
  56722. }
  56723. ,
  56724. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56725. function r() {
  56726. f[0] = new n.Vector3,
  56727. g[0] = new n.Vector3,
  56728. a = Number.MAX_VALUE,
  56729. s = Math.abs(p[0].x),
  56730. l = Math.abs(p[0].y),
  56731. c = Math.abs(p[0].z),
  56732. s <= a && (a = s,
  56733. d.set(1, 0, 0)),
  56734. l <= a && (a = l,
  56735. d.set(0, 1, 0)),
  56736. c <= a && d.set(0, 0, 1),
  56737. m.crossVectors(p[0], d).normalize(),
  56738. f[0].crossVectors(p[0], m),
  56739. g[0].crossVectors(p[0], f[0])
  56740. }
  56741. 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;
  56742. for (this.tangents = p,
  56743. this.normals = f,
  56744. this.binormals = g,
  56745. h = 0; h < A; h++)
  56746. u = h / (A - 1),
  56747. p[h] = e.getTangentAt(u),
  56748. p[h].normalize();
  56749. for (r(),
  56750. h = 1; h < A; h++)
  56751. f[h] = f[h - 1].clone(),
  56752. g[h] = g[h - 1].clone(),
  56753. m.crossVectors(p[h - 1], p[h]),
  56754. m.length() > Number.EPSILON && (m.normalize(),
  56755. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56756. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56757. g[h].crossVectors(p[h], f[h]);
  56758. if (i)
  56759. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56760. o /= A - 1,
  56761. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56762. h = 1; h < A; h++)
  56763. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56764. g[h].crossVectors(p[h], f[h])
  56765. }
  56766. ,
  56767. n.PolyhedronGeometry = function(e, t, i, r) {
  56768. function o(e) {
  56769. var t = e.normalize().clone();
  56770. t.index = u.vertices.push(t) - 1;
  56771. var i = l(e) / 2 / Math.PI + .5
  56772. , r = c(e) / Math.PI + .5;
  56773. return t.uv = new n.Vector2(i,1 - r),
  56774. t
  56775. }
  56776. function a(e, t, i, r) {
  56777. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  56778. u.faces.push(o),
  56779. C.copy(e).add(t).add(i).divideScalar(3);
  56780. var a = l(C);
  56781. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  56782. }
  56783. function s(e, t) {
  56784. 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++) {
  56785. l[h] = [];
  56786. 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++)
  56787. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  56788. }
  56789. for (var h = 0; h < i; h++)
  56790. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  56791. var m = Math.floor(g / 2);
  56792. 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)
  56793. }
  56794. }
  56795. function l(e) {
  56796. return Math.atan2(e.z, -e.x)
  56797. }
  56798. function c(e) {
  56799. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  56800. }
  56801. function h(e, t, i) {
  56802. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  56803. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  56804. e.clone()
  56805. }
  56806. n.Geometry.call(this),
  56807. this.type = "PolyhedronGeometry",
  56808. this.parameters = {
  56809. vertices: e,
  56810. indices: t,
  56811. radius: i,
  56812. detail: r
  56813. },
  56814. i = i || 1,
  56815. r = r || 0;
  56816. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  56817. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  56818. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  56819. m++) {
  56820. var v = f[t[d]]
  56821. , A = f[t[d + 1]]
  56822. , y = f[t[d + 2]];
  56823. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  56824. }
  56825. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  56826. s(g[d], r);
  56827. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  56828. var I = this.faceVertexUvs[0][d]
  56829. , E = I[0].x
  56830. , b = I[1].x
  56831. , w = I[2].x
  56832. , _ = Math.max(E, b, w)
  56833. , T = Math.min(E, b, w);
  56834. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  56835. b < .2 && (I[1].x += 1),
  56836. w < .2 && (I[2].x += 1))
  56837. }
  56838. for (var d = 0, p = this.vertices.length; d < p; d++)
  56839. this.vertices[d].multiplyScalar(i);
  56840. this.mergeVertices(),
  56841. this.computeFaceNormals(),
  56842. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  56843. }
  56844. ,
  56845. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  56846. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  56847. n.DodecahedronGeometry = function(e, t) {
  56848. var i = (1 + Math.sqrt(5)) / 2
  56849. , r = 1 / i
  56850. , 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]
  56851. , 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];
  56852. n.PolyhedronGeometry.call(this, o, a, e, t),
  56853. this.type = "DodecahedronGeometry",
  56854. this.parameters = {
  56855. radius: e,
  56856. detail: t
  56857. }
  56858. }
  56859. ,
  56860. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56861. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  56862. n.IcosahedronGeometry = function(e, t) {
  56863. var i = (1 + Math.sqrt(5)) / 2
  56864. , 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]
  56865. , 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];
  56866. n.PolyhedronGeometry.call(this, r, o, e, t),
  56867. this.type = "IcosahedronGeometry",
  56868. this.parameters = {
  56869. radius: e,
  56870. detail: t
  56871. }
  56872. }
  56873. ,
  56874. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56875. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  56876. n.OctahedronGeometry = function(e, t) {
  56877. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  56878. , 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];
  56879. n.PolyhedronGeometry.call(this, i, r, e, t),
  56880. this.type = "OctahedronGeometry",
  56881. this.parameters = {
  56882. radius: e,
  56883. detail: t
  56884. }
  56885. }
  56886. ,
  56887. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56888. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  56889. n.TetrahedronGeometry = function(e, t) {
  56890. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  56891. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  56892. n.PolyhedronGeometry.call(this, i, r, e, t),
  56893. this.type = "TetrahedronGeometry",
  56894. this.parameters = {
  56895. radius: e,
  56896. detail: t
  56897. }
  56898. }
  56899. ,
  56900. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56901. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  56902. n.ParametricGeometry = function(e, t, i) {
  56903. n.Geometry.call(this),
  56904. this.type = "ParametricGeometry",
  56905. this.parameters = {
  56906. func: e,
  56907. slices: t,
  56908. stacks: i
  56909. };
  56910. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  56911. for (r = 0; r <= i; r++)
  56912. for (l = r / i,
  56913. o = 0; o <= t; o++)
  56914. s = o / t,
  56915. a = e(s, l),
  56916. c.push(a);
  56917. var p, f, g, m, v, A, y, C;
  56918. for (r = 0; r < i; r++)
  56919. for (o = 0; o < t; o++)
  56920. p = r * d + o,
  56921. f = r * d + o + 1,
  56922. g = (r + 1) * d + o + 1,
  56923. m = (r + 1) * d + o,
  56924. v = new n.Vector2(o / t,r / i),
  56925. A = new n.Vector2((o + 1) / t,r / i),
  56926. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  56927. C = new n.Vector2(o / t,(r + 1) / i),
  56928. h.push(new n.Face3(p,f,m)),
  56929. u.push([v, A, C]),
  56930. h.push(new n.Face3(f,g,m)),
  56931. u.push([A.clone(), y, C.clone()]);
  56932. this.computeFaceNormals(),
  56933. this.computeVertexNormals()
  56934. }
  56935. ,
  56936. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  56937. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  56938. n.WireframeGeometry = function(e) {
  56939. function t(e, t) {
  56940. return e - t
  56941. }
  56942. n.BufferGeometry.call(this);
  56943. var i = [0, 0]
  56944. , r = {}
  56945. , o = ["a", "b", "c"];
  56946. if (e instanceof n.Geometry) {
  56947. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  56948. for (var d = s[h], p = 0; p < 3; p++) {
  56949. i[0] = d[o[p]],
  56950. i[1] = d[o[(p + 1) % 3]],
  56951. i.sort(t);
  56952. var f = i.toString();
  56953. void 0 === r[f] && (c[2 * l] = i[0],
  56954. c[2 * l + 1] = i[1],
  56955. r[f] = !0,
  56956. l++)
  56957. }
  56958. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56959. for (var p = 0; p < 2; p++) {
  56960. var m = a[c[2 * h + p]]
  56961. , v = 6 * h + 3 * p;
  56962. g[v + 0] = m.x,
  56963. g[v + 1] = m.y,
  56964. g[v + 2] = m.z
  56965. }
  56966. this.addAttribute("position", new n.BufferAttribute(g,3))
  56967. } else if (e instanceof n.BufferGeometry)
  56968. if (null !== e.index) {
  56969. var A = e.index.array
  56970. , a = e.attributes.position
  56971. , y = e.groups
  56972. , l = 0;
  56973. 0 === y.length && e.addGroup(0, A.length);
  56974. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  56975. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  56976. for (var p = 0; p < 3; p++) {
  56977. i[0] = A[h + p],
  56978. i[1] = A[h + (p + 1) % 3],
  56979. i.sort(t);
  56980. var f = i.toString();
  56981. void 0 === r[f] && (c[2 * l] = i[0],
  56982. c[2 * l + 1] = i[1],
  56983. r[f] = !0,
  56984. l++)
  56985. }
  56986. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56987. for (var p = 0; p < 2; p++) {
  56988. var v = 6 * h + 3 * p
  56989. , T = c[2 * h + p];
  56990. g[v + 0] = a.getX(T),
  56991. g[v + 1] = a.getY(T),
  56992. g[v + 2] = a.getZ(T)
  56993. }
  56994. this.addAttribute("position", new n.BufferAttribute(g,3))
  56995. } else {
  56996. 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++)
  56997. for (var p = 0; p < 3; p++) {
  56998. var v = 18 * h + 6 * p
  56999. , S = 9 * h + 3 * p;
  57000. g[v + 0] = a[S],
  57001. g[v + 1] = a[S + 1],
  57002. g[v + 2] = a[S + 2];
  57003. var T = 9 * h + 3 * ((p + 1) % 3);
  57004. g[v + 3] = a[T],
  57005. g[v + 4] = a[T + 1],
  57006. g[v + 5] = a[T + 2]
  57007. }
  57008. this.addAttribute("position", new n.BufferAttribute(g,3))
  57009. }
  57010. }
  57011. ,
  57012. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57013. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57014. n.AxisHelper = function(e) {
  57015. e = e || 1;
  57016. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57017. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57018. , r = new n.BufferGeometry;
  57019. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57020. r.addAttribute("color", new n.BufferAttribute(i,3));
  57021. var o = new n.LineBasicMaterial({
  57022. vertexColors: n.VertexColors
  57023. });
  57024. n.LineSegments.call(this, r, o)
  57025. }
  57026. ,
  57027. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57028. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57029. n.ArrowHelper = function() {
  57030. var e = new n.Geometry;
  57031. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57032. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57033. return t.translate(0, -.5, 0),
  57034. function(i, r, o, a, s, l) {
  57035. n.Object3D.call(this),
  57036. void 0 === a && (a = 16776960),
  57037. void 0 === o && (o = 1),
  57038. void 0 === s && (s = .2 * o),
  57039. void 0 === l && (l = .2 * s),
  57040. this.position.copy(r),
  57041. this.line = new n.Line(e,new n.LineBasicMaterial({
  57042. color: a
  57043. })),
  57044. this.line.matrixAutoUpdate = !1,
  57045. this.add(this.line),
  57046. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57047. color: a
  57048. })),
  57049. this.cone.matrixAutoUpdate = !1,
  57050. this.add(this.cone),
  57051. this.setDirection(i),
  57052. this.setLength(o, s, l)
  57053. }
  57054. }(),
  57055. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57056. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57057. n.ArrowHelper.prototype.setDirection = function() {
  57058. var e, t = new n.Vector3;
  57059. return function(i) {
  57060. 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(),
  57061. e = Math.acos(i.y),
  57062. this.quaternion.setFromAxisAngle(t, e))
  57063. }
  57064. }(),
  57065. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57066. void 0 === t && (t = .2 * e),
  57067. void 0 === i && (i = .2 * t),
  57068. this.line.scale.set(1, Math.max(0, e - t), 1),
  57069. this.line.updateMatrix(),
  57070. this.cone.scale.set(i, t, i),
  57071. this.cone.position.y = e,
  57072. this.cone.updateMatrix()
  57073. }
  57074. ,
  57075. n.ArrowHelper.prototype.setColor = function(e) {
  57076. this.line.material.color.set(e),
  57077. this.cone.material.color.set(e)
  57078. }
  57079. ,
  57080. n.BoxHelper = function(e) {
  57081. 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])
  57082. , i = new Float32Array(24)
  57083. , r = new n.BufferGeometry;
  57084. r.setIndex(new n.BufferAttribute(t,1)),
  57085. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57086. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57087. color: 16776960
  57088. })),
  57089. void 0 !== e && this.update(e)
  57090. }
  57091. ,
  57092. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57093. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57094. n.BoxHelper.prototype.update = function() {
  57095. var e = new n.Box3;
  57096. return function(t) {
  57097. if (e.setFromObject(t),
  57098. !e.isEmpty()) {
  57099. var i = e.min
  57100. , n = e.max
  57101. , r = this.geometry.attributes.position
  57102. , o = r.array;
  57103. o[0] = n.x,
  57104. o[1] = n.y,
  57105. o[2] = n.z,
  57106. o[3] = i.x,
  57107. o[4] = n.y,
  57108. o[5] = n.z,
  57109. o[6] = i.x,
  57110. o[7] = i.y,
  57111. o[8] = n.z,
  57112. o[9] = n.x,
  57113. o[10] = i.y,
  57114. o[11] = n.z,
  57115. o[12] = n.x,
  57116. o[13] = n.y,
  57117. o[14] = i.z,
  57118. o[15] = i.x,
  57119. o[16] = n.y,
  57120. o[17] = i.z,
  57121. o[18] = i.x,
  57122. o[19] = i.y,
  57123. o[20] = i.z,
  57124. o[21] = n.x,
  57125. o[22] = i.y,
  57126. o[23] = i.z,
  57127. r.needsUpdate = !0,
  57128. this.geometry.computeBoundingSphere()
  57129. }
  57130. }
  57131. }(),
  57132. n.BoundingBoxHelper = function(e, t) {
  57133. var i = void 0 !== t ? t : 8947848;
  57134. this.object = e,
  57135. this.box = new n.Box3,
  57136. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57137. color: i,
  57138. wireframe: !0
  57139. }))
  57140. }
  57141. ,
  57142. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57143. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57144. n.BoundingBoxHelper.prototype.update = function() {
  57145. this.box.setFromObject(this.object),
  57146. this.box.size(this.scale),
  57147. this.box.center(this.position)
  57148. }
  57149. ,
  57150. n.CameraHelper = function(e) {
  57151. function t(e, t, n) {
  57152. i(e, n),
  57153. i(t, n)
  57154. }
  57155. function i(e, t) {
  57156. r.vertices.push(new n.Vector3),
  57157. r.colors.push(new n.Color(t)),
  57158. void 0 === a[e] && (a[e] = []),
  57159. a[e].push(r.vertices.length - 1)
  57160. }
  57161. var r = new n.Geometry
  57162. , o = new n.LineBasicMaterial({
  57163. color: 16777215,
  57164. vertexColors: n.FaceColors
  57165. })
  57166. , a = {}
  57167. , s = 16755200
  57168. , l = 16711680
  57169. , c = 43775
  57170. , h = 16777215
  57171. , u = 3355443;
  57172. t("n1", "n2", s),
  57173. t("n2", "n4", s),
  57174. t("n4", "n3", s),
  57175. t("n3", "n1", s),
  57176. t("f1", "f2", s),
  57177. t("f2", "f4", s),
  57178. t("f4", "f3", s),
  57179. t("f3", "f1", s),
  57180. t("n1", "f1", s),
  57181. t("n2", "f2", s),
  57182. t("n3", "f3", s),
  57183. t("n4", "f4", s),
  57184. t("p", "n1", l),
  57185. t("p", "n2", l),
  57186. t("p", "n3", l),
  57187. t("p", "n4", l),
  57188. t("u1", "u2", c),
  57189. t("u2", "u3", c),
  57190. t("u3", "u1", c),
  57191. t("c", "t", h),
  57192. t("p", "c", u),
  57193. t("cn1", "cn2", u),
  57194. t("cn3", "cn4", u),
  57195. t("cf1", "cf2", u),
  57196. t("cf3", "cf4", u),
  57197. n.LineSegments.call(this, r, o),
  57198. this.camera = e,
  57199. this.camera.updateProjectionMatrix(),
  57200. this.matrix = e.matrixWorld,
  57201. this.matrixAutoUpdate = !1,
  57202. this.pointMap = a,
  57203. this.update()
  57204. }
  57205. ,
  57206. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57207. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57208. n.CameraHelper.prototype.update = function() {
  57209. function e(e, n, a, s) {
  57210. r.set(n, a, s).unproject(o);
  57211. var l = i[e];
  57212. if (void 0 !== l)
  57213. for (var c = 0, h = l.length; c < h; c++)
  57214. t.vertices[l[c]].copy(r)
  57215. }
  57216. var t, i, r = new n.Vector3, o = new n.Camera;
  57217. return function() {
  57218. t = this.geometry,
  57219. i = this.pointMap;
  57220. var n = 1
  57221. , r = 1;
  57222. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57223. e("c", 0, 0, -1),
  57224. e("t", 0, 0, 1),
  57225. e("n1", -n, -r, -1),
  57226. e("n2", n, -r, -1),
  57227. e("n3", -n, r, -1),
  57228. e("n4", n, r, -1),
  57229. e("f1", -n, -r, 1),
  57230. e("f2", n, -r, 1),
  57231. e("f3", -n, r, 1),
  57232. e("f4", n, r, 1),
  57233. e("u1", .7 * n, 1.1 * r, -1),
  57234. e("u2", .7 * -n, 1.1 * r, -1),
  57235. e("u3", 0, 2 * r, -1),
  57236. e("cf1", -n, 0, 1),
  57237. e("cf2", n, 0, 1),
  57238. e("cf3", 0, -r, 1),
  57239. e("cf4", 0, r, 1),
  57240. e("cn1", -n, 0, -1),
  57241. e("cn2", n, 0, -1),
  57242. e("cn3", 0, -r, -1),
  57243. e("cn4", 0, r, -1),
  57244. t.verticesNeedUpdate = !0
  57245. }
  57246. }(),
  57247. n.DirectionalLightHelper = function(e, t) {
  57248. n.Object3D.call(this),
  57249. this.light = e,
  57250. this.light.updateMatrixWorld(),
  57251. this.matrix = e.matrixWorld,
  57252. this.matrixAutoUpdate = !1,
  57253. t = t || 1;
  57254. var i = new n.Geometry;
  57255. 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));
  57256. var r = new n.LineBasicMaterial({
  57257. fog: !1
  57258. });
  57259. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57260. this.lightPlane = new n.Line(i,r),
  57261. this.add(this.lightPlane),
  57262. i = new n.Geometry,
  57263. i.vertices.push(new n.Vector3, new n.Vector3),
  57264. r = new n.LineBasicMaterial({
  57265. fog: !1
  57266. }),
  57267. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57268. this.targetLine = new n.Line(i,r),
  57269. this.add(this.targetLine),
  57270. this.update()
  57271. }
  57272. ,
  57273. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57274. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57275. n.DirectionalLightHelper.prototype.dispose = function() {
  57276. this.lightPlane.geometry.dispose(),
  57277. this.lightPlane.material.dispose(),
  57278. this.targetLine.geometry.dispose(),
  57279. this.targetLine.material.dispose()
  57280. }
  57281. ,
  57282. n.DirectionalLightHelper.prototype.update = function() {
  57283. var e = new n.Vector3
  57284. , t = new n.Vector3
  57285. , i = new n.Vector3;
  57286. return function() {
  57287. e.setFromMatrixPosition(this.light.matrixWorld),
  57288. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57289. i.subVectors(t, e),
  57290. this.lightPlane.lookAt(i),
  57291. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57292. this.targetLine.geometry.vertices[1].copy(i),
  57293. this.targetLine.geometry.verticesNeedUpdate = !0,
  57294. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57295. }
  57296. }(),
  57297. n.EdgesHelper = function(e, t, i) {
  57298. var r = void 0 !== t ? t : 16777215;
  57299. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57300. color: r
  57301. })),
  57302. this.matrix = e.matrixWorld,
  57303. this.matrixAutoUpdate = !1
  57304. }
  57305. ,
  57306. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57307. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57308. n.FaceNormalsHelper = function(e, t, i, r) {
  57309. this.object = e,
  57310. this.size = void 0 !== t ? t : 1;
  57311. var o = void 0 !== i ? i : 16776960
  57312. , a = void 0 !== r ? r : 1
  57313. , s = 0
  57314. , l = this.object.geometry;
  57315. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57316. var c = new n.BufferGeometry
  57317. , h = new n.Float32Attribute(2 * s * 3,3);
  57318. c.addAttribute("position", h),
  57319. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57320. color: o,
  57321. linewidth: a
  57322. })),
  57323. this.matrixAutoUpdate = !1,
  57324. this.update()
  57325. }
  57326. ,
  57327. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57328. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57329. n.FaceNormalsHelper.prototype.update = function() {
  57330. var e = new n.Vector3
  57331. , t = new n.Vector3
  57332. , i = new n.Matrix3;
  57333. return function() {
  57334. this.object.updateMatrixWorld(!0),
  57335. i.getNormalMatrix(this.object.matrixWorld);
  57336. 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++) {
  57337. var u = s[c]
  57338. , d = u.normal;
  57339. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57340. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57341. r.setXYZ(l, e.x, e.y, e.z),
  57342. l += 1,
  57343. r.setXYZ(l, t.x, t.y, t.z),
  57344. l += 1
  57345. }
  57346. return r.needsUpdate = !0,
  57347. this
  57348. }
  57349. }(),
  57350. n.GridHelper = function(e, t) {
  57351. var i = new n.Geometry
  57352. , r = new n.LineBasicMaterial({
  57353. vertexColors: n.VertexColors
  57354. });
  57355. this.color1 = new n.Color(4473924),
  57356. this.color2 = new n.Color(8947848);
  57357. for (var o = -e; o <= e; o += t) {
  57358. 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));
  57359. var a = 0 === o ? this.color1 : this.color2;
  57360. i.colors.push(a, a, a, a)
  57361. }
  57362. n.LineSegments.call(this, i, r)
  57363. }
  57364. ,
  57365. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57366. n.GridHelper.prototype.constructor = n.GridHelper,
  57367. n.GridHelper.prototype.setColors = function(e, t) {
  57368. this.color1.set(e),
  57369. this.color2.set(t),
  57370. this.geometry.colorsNeedUpdate = !0
  57371. }
  57372. ,
  57373. n.HemisphereLightHelper = function(e, t) {
  57374. n.Object3D.call(this),
  57375. this.light = e,
  57376. this.light.updateMatrixWorld(),
  57377. this.matrix = e.matrixWorld,
  57378. this.matrixAutoUpdate = !1,
  57379. this.colors = [new n.Color, new n.Color];
  57380. var i = new n.SphereGeometry(t,4,2);
  57381. i.rotateX(-Math.PI / 2);
  57382. for (var r = 0, o = 8; r < o; r++)
  57383. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57384. var a = new n.MeshBasicMaterial({
  57385. vertexColors: n.FaceColors,
  57386. wireframe: !0
  57387. });
  57388. this.lightSphere = new n.Mesh(i,a),
  57389. this.add(this.lightSphere),
  57390. this.update()
  57391. }
  57392. ,
  57393. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57394. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57395. n.HemisphereLightHelper.prototype.dispose = function() {
  57396. this.lightSphere.geometry.dispose(),
  57397. this.lightSphere.material.dispose()
  57398. }
  57399. ,
  57400. n.HemisphereLightHelper.prototype.update = function() {
  57401. var e = new n.Vector3;
  57402. return function() {
  57403. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57404. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57405. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57406. this.lightSphere.geometry.colorsNeedUpdate = !0
  57407. }
  57408. }(),
  57409. n.PointLightHelper = function(e, t) {
  57410. this.light = e,
  57411. this.light.updateMatrixWorld();
  57412. var i = new n.SphereGeometry(t,4,2)
  57413. , r = new n.MeshBasicMaterial({
  57414. wireframe: !0,
  57415. fog: !1
  57416. });
  57417. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57418. n.Mesh.call(this, i, r),
  57419. this.matrix = this.light.matrixWorld,
  57420. this.matrixAutoUpdate = !1
  57421. }
  57422. ,
  57423. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57424. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57425. n.PointLightHelper.prototype.dispose = function() {
  57426. this.geometry.dispose(),
  57427. this.material.dispose()
  57428. }
  57429. ,
  57430. n.PointLightHelper.prototype.update = function() {
  57431. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57432. }
  57433. ,
  57434. n.SkeletonHelper = function(e) {
  57435. this.bones = this.getBoneList(e);
  57436. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57437. var r = this.bones[i];
  57438. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57439. t.vertices.push(new n.Vector3),
  57440. t.colors.push(new n.Color(0,0,1)),
  57441. t.colors.push(new n.Color(0,1,0)))
  57442. }
  57443. t.dynamic = !0;
  57444. var o = new n.LineBasicMaterial({
  57445. vertexColors: n.VertexColors,
  57446. depthTest: !1,
  57447. depthWrite: !1,
  57448. transparent: !0
  57449. });
  57450. n.LineSegments.call(this, t, o),
  57451. this.root = e,
  57452. this.matrix = e.matrixWorld,
  57453. this.matrixAutoUpdate = !1,
  57454. this.update()
  57455. }
  57456. ,
  57457. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57458. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57459. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57460. var t = [];
  57461. e instanceof n.Bone && t.push(e);
  57462. for (var i = 0; i < e.children.length; i++)
  57463. t.push.apply(t, this.getBoneList(e.children[i]));
  57464. return t
  57465. }
  57466. ,
  57467. n.SkeletonHelper.prototype.update = function() {
  57468. 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++) {
  57469. var a = this.bones[o];
  57470. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57471. e.vertices[r].setFromMatrixPosition(i),
  57472. i.multiplyMatrices(t, a.parent.matrixWorld),
  57473. e.vertices[r + 1].setFromMatrixPosition(i),
  57474. r += 2)
  57475. }
  57476. e.verticesNeedUpdate = !0,
  57477. e.computeBoundingSphere()
  57478. }
  57479. ,
  57480. n.SpotLightHelper = function(e) {
  57481. n.Object3D.call(this),
  57482. this.light = e,
  57483. this.light.updateMatrixWorld(),
  57484. this.matrix = e.matrixWorld,
  57485. this.matrixAutoUpdate = !1;
  57486. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57487. t.translate(0, -.5, 0),
  57488. t.rotateX(-Math.PI / 2);
  57489. var i = new n.MeshBasicMaterial({
  57490. wireframe: !0,
  57491. fog: !1
  57492. });
  57493. this.cone = new n.Mesh(t,i),
  57494. this.add(this.cone),
  57495. this.update()
  57496. }
  57497. ,
  57498. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57499. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57500. n.SpotLightHelper.prototype.dispose = function() {
  57501. this.cone.geometry.dispose(),
  57502. this.cone.material.dispose()
  57503. }
  57504. ,
  57505. n.SpotLightHelper.prototype.update = function() {
  57506. var e = new n.Vector3
  57507. , t = new n.Vector3;
  57508. return function() {
  57509. var i = this.light.distance ? this.light.distance : 1e4
  57510. , n = i * Math.tan(this.light.angle);
  57511. this.cone.scale.set(n, n, i),
  57512. e.setFromMatrixPosition(this.light.matrixWorld),
  57513. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57514. this.cone.lookAt(t.sub(e)),
  57515. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57516. }
  57517. }(),
  57518. n.VertexNormalsHelper = function(e, t, i, r) {
  57519. this.object = e,
  57520. this.size = void 0 !== t ? t : 1;
  57521. var o = void 0 !== i ? i : 16711680
  57522. , a = void 0 !== r ? r : 1
  57523. , s = 0
  57524. , l = this.object.geometry;
  57525. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57526. var c = new n.BufferGeometry
  57527. , h = new n.Float32Attribute(2 * s * 3,3);
  57528. c.addAttribute("position", h),
  57529. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57530. color: o,
  57531. linewidth: a
  57532. })),
  57533. this.matrixAutoUpdate = !1,
  57534. this.update()
  57535. }
  57536. ,
  57537. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57538. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57539. n.VertexNormalsHelper.prototype.update = function() {
  57540. var e = new n.Vector3
  57541. , t = new n.Vector3
  57542. , i = new n.Matrix3;
  57543. return function() {
  57544. var r = ["a", "b", "c"];
  57545. this.object.updateMatrixWorld(!0),
  57546. i.getNormalMatrix(this.object.matrixWorld);
  57547. var o = this.object.matrixWorld
  57548. , a = this.geometry.attributes.position
  57549. , s = this.object.geometry;
  57550. if (s instanceof n.Geometry)
  57551. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57552. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57553. var m = l[p[r[f]]]
  57554. , v = p.vertexNormals[f];
  57555. e.copy(m).applyMatrix4(o),
  57556. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57557. a.setXYZ(h, e.x, e.y, e.z),
  57558. h += 1,
  57559. a.setXYZ(h, t.x, t.y, t.z),
  57560. h += 1
  57561. }
  57562. else if (s instanceof n.BufferGeometry)
  57563. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57564. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57565. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57566. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57567. a.setXYZ(h, e.x, e.y, e.z),
  57568. h += 1,
  57569. a.setXYZ(h, t.x, t.y, t.z),
  57570. h += 1;
  57571. return a.needsUpdate = !0,
  57572. this
  57573. }
  57574. }(),
  57575. n.WireframeHelper = function(e, t) {
  57576. var i = void 0 !== t ? t : 16777215;
  57577. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57578. color: i
  57579. })),
  57580. this.matrix = e.matrixWorld,
  57581. this.matrixAutoUpdate = !1
  57582. }
  57583. ,
  57584. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57585. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57586. n.ImmediateRenderObject = function(e) {
  57587. n.Object3D.call(this),
  57588. this.material = e,
  57589. this.render = function(e) {}
  57590. }
  57591. ,
  57592. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57593. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57594. n.MorphBlendMesh = function(e, t) {
  57595. n.Mesh.call(this, e, t),
  57596. this.animationsMap = {},
  57597. this.animationsList = [];
  57598. var i = this.geometry.morphTargets.length
  57599. , r = "__default"
  57600. , o = 0
  57601. , a = i - 1
  57602. , s = i / 1;
  57603. this.createAnimation(r, o, a, s),
  57604. this.setAnimationWeight(r, 1)
  57605. }
  57606. ,
  57607. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57608. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57609. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57610. var r = {
  57611. start: t,
  57612. end: i,
  57613. length: i - t + 1,
  57614. fps: n,
  57615. duration: (i - t) / n,
  57616. lastFrame: 0,
  57617. currentFrame: 0,
  57618. active: !1,
  57619. time: 0,
  57620. direction: 1,
  57621. weight: 1,
  57622. directionBackwards: !1,
  57623. mirroredLoop: !1
  57624. };
  57625. this.animationsMap[e] = r,
  57626. this.animationsList.push(r)
  57627. }
  57628. ,
  57629. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57630. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57631. var s = r.morphTargets[o]
  57632. , l = s.name.match(i);
  57633. if (l && l.length > 1) {
  57634. var c = l[1];
  57635. n[c] || (n[c] = {
  57636. start: 1 / 0,
  57637. end: -(1 / 0)
  57638. });
  57639. var h = n[c];
  57640. o < h.start && (h.start = o),
  57641. o > h.end && (h.end = o),
  57642. t || (t = c)
  57643. }
  57644. }
  57645. for (var c in n) {
  57646. var h = n[c];
  57647. this.createAnimation(c, h.start, h.end, e)
  57648. }
  57649. this.firstAnimation = t
  57650. }
  57651. ,
  57652. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57653. var t = this.animationsMap[e];
  57654. t && (t.direction = 1,
  57655. t.directionBackwards = !1)
  57656. }
  57657. ,
  57658. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57659. var t = this.animationsMap[e];
  57660. t && (t.direction = -1,
  57661. t.directionBackwards = !0)
  57662. }
  57663. ,
  57664. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57665. var i = this.animationsMap[e];
  57666. i && (i.fps = t,
  57667. i.duration = (i.end - i.start) / i.fps)
  57668. }
  57669. ,
  57670. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57671. var i = this.animationsMap[e];
  57672. i && (i.duration = t,
  57673. i.fps = (i.end - i.start) / i.duration)
  57674. }
  57675. ,
  57676. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57677. var i = this.animationsMap[e];
  57678. i && (i.weight = t)
  57679. }
  57680. ,
  57681. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57682. var i = this.animationsMap[e];
  57683. i && (i.time = t)
  57684. }
  57685. ,
  57686. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57687. var t = 0
  57688. , i = this.animationsMap[e];
  57689. return i && (t = i.time),
  57690. t
  57691. }
  57692. ,
  57693. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57694. var t = -1
  57695. , i = this.animationsMap[e];
  57696. return i && (t = i.duration),
  57697. t
  57698. }
  57699. ,
  57700. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57701. var t = this.animationsMap[e];
  57702. t ? (t.time = 0,
  57703. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57704. }
  57705. ,
  57706. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57707. var t = this.animationsMap[e];
  57708. t && (t.active = !1)
  57709. }
  57710. ,
  57711. n.MorphBlendMesh.prototype.update = function(e) {
  57712. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57713. var r = this.animationsList[t];
  57714. if (r.active) {
  57715. var o = r.duration / r.length;
  57716. r.time += r.direction * e,
  57717. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57718. r.time > r.duration && (r.time = r.duration,
  57719. r.directionBackwards = !0),
  57720. r.time < 0 && (r.time = 0,
  57721. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57722. r.time < 0 && (r.time += r.duration));
  57723. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57724. , s = r.weight;
  57725. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57726. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57727. this.morphTargetInfluences[a] = 0,
  57728. r.lastFrame = r.currentFrame,
  57729. r.currentFrame = a);
  57730. var l = r.time % o / o;
  57731. r.directionBackwards && (l = 1 - l),
  57732. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57733. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57734. }
  57735. }
  57736. }
  57737. ,
  57738. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57739. i.THREE = n) : this.THREE = n
  57740. window.THREE = n
  57741. }
  57742. , {}]
  57743. }, {}, [116]);